src/share/vm/code/location.hpp
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File
6706829 Cdiff src/share/vm/code/location.hpp
src/share/vm/code/location.hpp
Print this page
*** 1,7 ****
/*
! * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
--- 1,7 ----
/*
! * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*** 26,39 ****
// (such as integer or floating point register or a stack-held
// variable). Used when generating debug-information for nmethods.
//
// Encoding:
//
! // bits:
! // Where: [15]
! // Type: [14..12]
! // Offset: [11..0]
class Location VALUE_OBJ_CLASS_SPEC {
friend class VMStructs;
public:
enum Where {
--- 26,39 ----
// (such as integer or floating point register or a stack-held
// variable). Used when generating debug-information for nmethods.
//
// Encoding:
//
! // bits (use low bits for best compression):
! // Type: [3..0]
! // Where: [4]
! // Offset: [31..5]
class Location VALUE_OBJ_CLASS_SPEC {
friend class VMStructs;
public:
enum Where {
*** 40,71 ****
on_stack,
in_register
};
enum Type {
normal, // Ints, floats, double halves
oop, // Oop (please GC me!)
int_in_long, // Integer held in long register
lng, // Long held in one register
float_in_dbl, // Float held in double register
dbl, // Double held in one register
addr, // JSR return address
! invalid // Invalid location
};
private:
enum {
! OFFSET_MASK = (jchar) 0x0FFF,
! OFFSET_SHIFT = 0,
! TYPE_MASK = (jchar) 0x7000,
! TYPE_SHIFT = 12,
! WHERE_MASK = (jchar) 0x8000,
! WHERE_SHIFT = 15
};
! uint16_t _value;
// Create a bit-packed Location
Location(Where where_, Type type_, unsigned offset_) {
set(where_, type_, offset_);
assert( where () == where_ , "" );
--- 40,72 ----
on_stack,
in_register
};
enum Type {
+ invalid, // Invalid location
normal, // Ints, floats, double halves
oop, // Oop (please GC me!)
int_in_long, // Integer held in long register
lng, // Long held in one register
float_in_dbl, // Float held in double register
dbl, // Double held in one register
addr, // JSR return address
! narrowoop // Narrow Oop (please GC me!)
};
private:
enum {
! TYPE_MASK = (juint) 0x0F,
! TYPE_SHIFT = 0,
! WHERE_MASK = (juint) 0x10,
! WHERE_SHIFT = 4,
! OFFSET_MASK = (juint) 0xFFFFFFE0,
! OFFSET_SHIFT = 5
};
! juint _value;
// Create a bit-packed Location
Location(Where where_, Type type_, unsigned offset_) {
set(where_, type_, offset_);
assert( where () == where_ , "" );
*** 72,82 ****
assert( type () == type_ , "" );
assert( offset() == offset_, "" );
}
inline void set(Where where_, Type type_, unsigned offset_) {
! _value = (uint16_t) ((where_ << WHERE_SHIFT) |
(type_ << TYPE_SHIFT) |
((offset_ << OFFSET_SHIFT) & OFFSET_MASK));
}
public:
--- 73,83 ----
assert( type () == type_ , "" );
assert( offset() == offset_, "" );
}
inline void set(Where where_, Type type_, unsigned offset_) {
! _value = (juint) ((where_ << WHERE_SHIFT) |
(type_ << TYPE_SHIFT) |
((offset_ << OFFSET_SHIFT) & OFFSET_MASK));
}
public:
*** 84,94 ****
// Stack location Factory. Offset is 4-byte aligned; remove low bits
static Location new_stk_loc( Type t, int offset ) { return Location(on_stack,t,offset>>LogBytesPerInt); }
// Register location Factory
static Location new_reg_loc( Type t, VMReg reg ) { return Location(in_register, t, reg->value()); }
// Default constructor
! Location() { set(on_stack,invalid,(unsigned) -1); }
// Bit field accessors
Where where() const { return (Where) ((_value & WHERE_MASK) >> WHERE_SHIFT);}
Type type() const { return (Type) ((_value & TYPE_MASK) >> TYPE_SHIFT); }
unsigned offset() const { return (unsigned) ((_value & OFFSET_MASK) >> OFFSET_SHIFT); }
--- 85,95 ----
// Stack location Factory. Offset is 4-byte aligned; remove low bits
static Location new_stk_loc( Type t, int offset ) { return Location(on_stack,t,offset>>LogBytesPerInt); }
// Register location Factory
static Location new_reg_loc( Type t, VMReg reg ) { return Location(in_register, t, reg->value()); }
// Default constructor
! Location() { set(on_stack,invalid,0); }
// Bit field accessors
Where where() const { return (Where) ((_value & WHERE_MASK) >> WHERE_SHIFT);}
Type type() const { return (Type) ((_value & TYPE_MASK) >> TYPE_SHIFT); }
unsigned offset() const { return (unsigned) ((_value & OFFSET_MASK) >> OFFSET_SHIFT); }
src/share/vm/code/location.hpp
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File