Refactor the enum RelocMode changing the naming scheme from lower case to
authorsgjesse@chromium.org <sgjesse@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 22 Sep 2008 13:57:03 +0000 (13:57 +0000)
committersgjesse@chromium.org <sgjesse@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 22 Sep 2008 13:57:03 +0000 (13:57 +0000)
upper case. Moved it into the RelocInfo class together with the associated
is_xxx functions. Renamed is_xxx to IsXxx in the process.

Removed the exit_js_frame mode as it was no longer used.

Patch Set 2 renames RELOC_MODE_COUNT to NUMBER_OF_MODES and fixes a couple of lint errors.
Review URL: http://codereview.chromium.org/3186

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@354 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

38 files changed:
src/assembler-arm-inl.h
src/assembler-arm.cc
src/assembler-arm.h
src/assembler-ia32-inl.h
src/assembler-ia32.cc
src/assembler-ia32.h
src/assembler.cc
src/assembler.h
src/ast.h
src/builtins-arm.cc
src/builtins-ia32.cc
src/codegen-arm.cc
src/codegen-ia32.cc
src/codegen.cc
src/compiler.cc
src/debug.cc
src/debug.h
src/disassembler.cc
src/ic-arm.cc
src/ic.cc
src/ic.h
src/macro-assembler-arm.cc
src/macro-assembler-arm.h
src/macro-assembler-ia32.cc
src/macro-assembler-ia32.h
src/mark-compact.cc
src/objects-debug.cc
src/objects.cc
src/parser.cc
src/rewriter.cc
src/runtime.cc
src/scopes.cc
src/spaces.cc
src/stub-cache-arm.cc
src/stub-cache-ia32.cc
test/cctest/test-assembler-ia32.cc
test/cctest/test-debug.cc
test/cctest/test-disasm-ia32.cc

index 57f6b09..fbe37d7 100644 (file)
@@ -50,7 +50,7 @@ Condition NegateCondition(Condition cc) {
 
 
 void RelocInfo::apply(int delta) {
-  if (is_internal_reference(rmode_)) {
+  if (RelocInfo::IsInternalReference(rmode_)) {
     // absolute code pointer inside code object moves with the code object.
     int32_t* p = reinterpret_cast<int32_t*>(pc_);
     *p += delta;  // relocate entry
@@ -61,37 +61,37 @@ void RelocInfo::apply(int delta) {
 
 
 Address RelocInfo::target_address() {
-  ASSERT(is_code_target(rmode_));
+  ASSERT(IsCodeTarget(rmode_));
   return Assembler::target_address_at(pc_);
 }
 
 
 void RelocInfo::set_target_address(Address target) {
-  ASSERT(is_code_target(rmode_));
+  ASSERT(IsCodeTarget(rmode_));
   Assembler::set_target_address_at(pc_, target);
 }
 
 
 Object* RelocInfo::target_object() {
-  ASSERT(is_code_target(rmode_) || rmode_ == embedded_object);
+  ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
   return reinterpret_cast<Object*>(Assembler::target_address_at(pc_));
 }
 
 
 Object** RelocInfo::target_object_address() {
-  ASSERT(is_code_target(rmode_) || rmode_ == embedded_object);
+  ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
   return reinterpret_cast<Object**>(Assembler::target_address_address_at(pc_));
 }
 
 
 void RelocInfo::set_target_object(Object* target) {
-  ASSERT(is_code_target(rmode_) || rmode_ == embedded_object);
+  ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
   Assembler::set_target_address_at(pc_, reinterpret_cast<Address>(target));
 }
 
 
 Address* RelocInfo::target_reference_address() {
-  ASSERT(rmode_ == external_reference);
+  ASSERT(rmode_ == EXTERNAL_REFERENCE);
   return reinterpret_cast<Address*>(pc_);
 }
 
@@ -135,7 +135,7 @@ bool RelocInfo::is_call_instruction() {
 }
 
 
-Operand::Operand(int32_t immediate, RelocMode rmode)  {
+Operand::Operand(int32_t immediate, RelocInfo::Mode rmode)  {
   rm_ = no_reg;
   imm32_ = immediate;
   rmode_ = rmode;
@@ -145,35 +145,35 @@ Operand::Operand(int32_t immediate, RelocMode rmode)  {
 Operand::Operand(const char* s) {
   rm_ = no_reg;
   imm32_ = reinterpret_cast<int32_t>(s);
-  rmode_ = embedded_string;
+  rmode_ = RelocInfo::EMBEDDED_STRING;
 }
 
 
 Operand::Operand(const ExternalReference& f)  {
   rm_ = no_reg;
   imm32_ = reinterpret_cast<int32_t>(f.address());
-  rmode_ = external_reference;
+  rmode_ = RelocInfo::EXTERNAL_REFERENCE;
 }
 
 
 Operand::Operand(Object** opp) {
   rm_ = no_reg;
   imm32_ = reinterpret_cast<int32_t>(opp);
-  rmode_ = no_reloc;
+  rmode_ = RelocInfo::NONE;
 }
 
 
 Operand::Operand(Context** cpp) {
   rm_ = no_reg;
   imm32_ = reinterpret_cast<int32_t>(cpp);
-  rmode_ = no_reloc;
+  rmode_ = RelocInfo::NONE;
 }
 
 
 Operand::Operand(Smi* value) {
   rm_ = no_reg;
   imm32_ =  reinterpret_cast<intptr_t>(value);
-  rmode_ = no_reloc;
+  rmode_ = RelocInfo::NONE;
 }
 
 
index 12d110b..71894e5 100644 (file)
@@ -164,11 +164,11 @@ Operand::Operand(Handle<Object> handle) {
   ASSERT(!Heap::InNewSpace(obj));
   if (obj->IsHeapObject()) {
     imm32_ = reinterpret_cast<intptr_t>(handle.location());
-    rmode_ = embedded_object;
+    rmode_ = RelocInfo::EMBEDDED_OBJECT;
   } else {
     // no relocation needed
     imm32_ =  reinterpret_cast<intptr_t>(obj);
-    rmode_ = no_reloc;
+    rmode_ = RelocInfo::NONE;
   }
 }
 
@@ -320,7 +320,7 @@ Assembler::Assembler(void* buffer, int buffer_size) {
   no_const_pool_before_ = 0;
   last_const_pool_end_ = 0;
   last_bound_pos_ = 0;
-  last_position_ = kNoPosition;
+  last_position_ = RelocInfo::kNoPosition;
   last_position_is_statement_ = false;
 }
 
@@ -588,7 +588,8 @@ void Assembler::addrmod1(Instr instr,
     // immediate
     uint32_t rotate_imm;
     uint32_t immed_8;
-    if ((x.rmode_ != no_reloc && x.rmode_ != external_reference) ||
+    if ((x.rmode_ != RelocInfo::NONE &&
+         x.rmode_ != RelocInfo::EXTERNAL_REFERENCE) ||
         !fits_shifter(x.imm32_, &rotate_imm, &immed_8, &instr)) {
       // The immediate operand cannot be encoded as a shifter operand, so load
       // it first to register ip and change the original instruction to use ip.
@@ -1006,7 +1007,8 @@ void Assembler::msr(SRegisterFieldMask fields, const Operand& src,
     // immediate
     uint32_t rotate_imm;
     uint32_t immed_8;
-    if ((src.rmode_ != no_reloc && src.rmode_ != external_reference)||
+    if ((src.rmode_ != RelocInfo::NONE &&
+         src.rmode_ != RelocInfo::EXTERNAL_REFERENCE)||
         !fits_shifter(src.imm32_, &rotate_imm, &immed_8, NULL)) {
       // immediate operand cannot be encoded, load it first to register ip
       RecordRelocInfo(src.rmode_, src.imm32_);
@@ -1353,17 +1355,17 @@ void Assembler::lea(Register dst,
 void Assembler::RecordComment(const char* msg) {
   if (FLAG_debug_code) {
     CheckBuffer();
-    RecordRelocInfo(comment, reinterpret_cast<intptr_t>(msg));
+    RecordRelocInfo(RelocInfo::COMMENT, reinterpret_cast<intptr_t>(msg));
   }
 }
 
 
 void Assembler::RecordPosition(int pos) {
-  if (pos == kNoPosition) return;
-  ASSERT(position >= 0);
+  if (pos == RelocInfo::kNoPosition) return;
+  ASSERT(pos >= 0);
   if (pos == last_position_) return;
   CheckBuffer();
-  RecordRelocInfo(position, pos);
+  RecordRelocInfo(RelocInfo::POSITION, pos);
   last_position_ = pos;
   last_position_is_statement_ = false;
 }
@@ -1372,7 +1374,7 @@ void Assembler::RecordPosition(int pos) {
 void Assembler::RecordStatementPosition(int pos) {
   if (pos == last_position_) return;
   CheckBuffer();
-  RecordRelocInfo(statement_position, pos);
+  RecordRelocInfo(RelocInfo::STATEMENT_POSITION, pos);
   last_position_ = pos;
   last_position_is_statement_ = true;
 }
@@ -1420,17 +1422,18 @@ void Assembler::GrowBuffer() {
   // relocate pending relocation entries
   for (int i = 0; i < num_prinfo_; i++) {
     RelocInfo& rinfo = prinfo_[i];
-    ASSERT(rinfo.rmode() != comment && rinfo.rmode() != position);
+    ASSERT(rinfo.rmode() != RelocInfo::COMMENT &&
+           rinfo.rmode() != RelocInfo::POSITION);
     rinfo.set_pc(rinfo.pc() + pc_delta);
   }
 }
 
 
-void Assembler::RecordRelocInfo(RelocMode rmode, intptr_t data) {
+void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data) {
   RelocInfo rinfo(pc_, rmode, data);  // we do not try to reuse pool constants
-  if (rmode >= comment && rmode <= statement_position) {
+  if (rmode >= RelocInfo::COMMENT && rmode <= RelocInfo::STATEMENT_POSITION) {
     // adjust code for new modes
-    ASSERT(is_comment(rmode) || is_position(rmode));
+    ASSERT(RelocInfo::IsComment(rmode) || RelocInfo::IsPosition(rmode));
     // these modes do not need an entry in the constant pool
   } else {
     ASSERT(num_prinfo_ < kMaxNumPRInfo);
@@ -1439,9 +1442,9 @@ void Assembler::RecordRelocInfo(RelocMode rmode, intptr_t data) {
     // instruction for which we just recorded relocation info
     BlockConstPoolBefore(pc_offset() + kInstrSize);
   }
-  if (rinfo.rmode() != no_reloc) {
+  if (rinfo.rmode() != RelocInfo::NONE) {
     // Don't record external references unless the heap will be serialized.
-    if (rmode == external_reference &&
+    if (rmode == RelocInfo::EXTERNAL_REFERENCE &&
         !Serializer::enabled() &&
         !FLAG_debug_code) {
       return;
@@ -1520,8 +1523,9 @@ void Assembler::CheckConstPool(bool force_emit, bool require_jump) {
   // Emit constant pool entries
   for (int i = 0; i < num_prinfo_; i++) {
     RelocInfo& rinfo = prinfo_[i];
-    ASSERT(rinfo.rmode() != comment && rinfo.rmode() != position &&
-           rinfo.rmode() != statement_position);
+    ASSERT(rinfo.rmode() != RelocInfo::COMMENT &&
+           rinfo.rmode() != RelocInfo::POSITION &&
+           rinfo.rmode() != RelocInfo::STATEMENT_POSITION);
     Instr instr = instr_at(rinfo.pc());
     // Instruction to patch must be a ldr/str [pc, #offset]
     // P and U set, B and W clear, Rn == pc, offset12 still 0
index 5ae70ae..351ce3d 100644 (file)
@@ -298,7 +298,8 @@ enum LFlag {
 class Operand BASE_EMBEDDED {
  public:
   // immediate
-  INLINE(explicit Operand(int32_t immediate, RelocMode rmode = no_reloc));
+  INLINE(explicit Operand(int32_t immediate,
+         RelocInfo::Mode rmode = RelocInfo::NONE));
   INLINE(explicit Operand(const ExternalReference& f));
   INLINE(explicit Operand(const char* s));
   INLINE(explicit Operand(Object** opp));
@@ -326,7 +327,7 @@ class Operand BASE_EMBEDDED {
   ShiftOp shift_op_;
   int shift_imm_;  // valid if rm_ != no_reg && rs_ == no_reg
   int32_t imm32_;  // valid if rm_ == no_reg
-  RelocMode rmode_;
+  RelocInfo::Mode rmode_;
 
   friend class Assembler;
 };
@@ -772,7 +773,7 @@ class Assembler : public Malloced {
   void next(Label* L);
 
   // Record reloc info for current pc_
-  void RecordRelocInfo(RelocMode rmode, intptr_t data = 0);
+  void RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data = 0);
 
   // Check if is time to emit a constant pool for pending reloc info entries
   void CheckConstPool(bool force_emit, bool require_jump);
index 25b5f7d..9b3567a 100644 (file)
@@ -48,15 +48,15 @@ Condition NegateCondition(Condition cc) {
 
 // The modes possibly affected by apply must be in kApplyMask.
 void RelocInfo::apply(int delta) {
-  if (rmode_ == runtime_entry || is_code_target(rmode_)) {
+  if (rmode_ == RUNTIME_ENTRY || IsCodeTarget(rmode_)) {
     int32_t* p = reinterpret_cast<int32_t*>(pc_);
     *p -= delta;  // relocate entry
-  } else if (rmode_ == js_return && is_call_instruction()) {
+  } else if (rmode_ == JS_RETURN && is_call_instruction()) {
     // Special handling of js_return when a break point is set (call
     // instruction has been inserted).
     int32_t* p = reinterpret_cast<int32_t*>(pc_ + 1);
     *p -= delta;  // relocate entry
-  } else if (is_internal_reference(rmode_)) {
+  } else if (IsInternalReference(rmode_)) {
     // absolute code pointer inside code object moves with the code object.
     int32_t* p = reinterpret_cast<int32_t*>(pc_);
     *p += delta;  // relocate entry
@@ -65,37 +65,37 @@ void RelocInfo::apply(int delta) {
 
 
 Address RelocInfo::target_address() {
-  ASSERT(is_code_target(rmode_) || rmode_ == runtime_entry);
+  ASSERT(IsCodeTarget(rmode_) || rmode_ == RUNTIME_ENTRY);
   return Assembler::target_address_at(pc_);
 }
 
 
 void RelocInfo::set_target_address(Address target) {
-  ASSERT(is_code_target(rmode_) || rmode_ == runtime_entry);
+  ASSERT(IsCodeTarget(rmode_) || rmode_ == RUNTIME_ENTRY);
   Assembler::set_target_address_at(pc_, target);
 }
 
 
 Object* RelocInfo::target_object() {
-  ASSERT(is_code_target(rmode_) || rmode_ == embedded_object);
+  ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
   return *reinterpret_cast<Object**>(pc_);
 }
 
 
 Object** RelocInfo::target_object_address() {
-  ASSERT(is_code_target(rmode_) || rmode_ == embedded_object);
+  ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
   return reinterpret_cast<Object**>(pc_);
 }
 
 
 void RelocInfo::set_target_object(Object* target) {
-  ASSERT(is_code_target(rmode_) || rmode_ == embedded_object);
+  ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
   *reinterpret_cast<Object**>(pc_) = target;
 }
 
 
 Address* RelocInfo::target_reference_address() {
-  ASSERT(rmode_ == external_reference);
+  ASSERT(rmode_ == RelocInfo::EXTERNAL_REFERENCE);
   return reinterpret_cast<Address*>(pc_);
 }
 
@@ -137,18 +137,18 @@ bool RelocInfo::is_call_instruction() {
 
 Immediate::Immediate(int x)  {
   x_ = x;
-  rmode_ = no_reloc;
+  rmode_ = RelocInfo::NONE;
 }
 
 
 Immediate::Immediate(const ExternalReference& ext) {
   x_ = reinterpret_cast<int32_t>(ext.address());
-  rmode_ = external_reference;
+  rmode_ = RelocInfo::EXTERNAL_REFERENCE;
 }
 
 Immediate::Immediate(const char* s) {
   x_ = reinterpret_cast<int32_t>(s);
-  rmode_ = embedded_string;
+  rmode_ = RelocInfo::EMBEDDED_STRING;
 }
 
 
@@ -158,18 +158,18 @@ Immediate::Immediate(Handle<Object> handle) {
   ASSERT(!Heap::InNewSpace(obj));
   if (obj->IsHeapObject()) {
     x_ = reinterpret_cast<intptr_t>(handle.location());
-    rmode_ = embedded_object;
+    rmode_ = RelocInfo::EMBEDDED_OBJECT;
   } else {
     // no relocation needed
     x_ =  reinterpret_cast<intptr_t>(obj);
-    rmode_ = no_reloc;
+    rmode_ = RelocInfo::NONE;
   }
 }
 
 
 Immediate::Immediate(Smi* value) {
   x_ = reinterpret_cast<intptr_t>(value);
-  rmode_ = no_reloc;
+  rmode_ = RelocInfo::NONE;
 }
 
 
@@ -184,7 +184,8 @@ void Assembler::emit(Handle<Object> handle) {
   Object* obj = *handle;
   ASSERT(!Heap::InNewSpace(obj));
   if (obj->IsHeapObject()) {
-    emit(reinterpret_cast<intptr_t>(handle.location()), embedded_object);
+    emit(reinterpret_cast<intptr_t>(handle.location()),
+         RelocInfo::EMBEDDED_OBJECT);
   } else {
     // no relocation needed
     emit(reinterpret_cast<intptr_t>(obj));
@@ -192,14 +193,14 @@ void Assembler::emit(Handle<Object> handle) {
 }
 
 
-void Assembler::emit(uint32_t x, RelocMode rmode) {
-  if (rmode != no_reloc) RecordRelocInfo(rmode);
+void Assembler::emit(uint32_t x, RelocInfo::Mode rmode) {
+  if (rmode != RelocInfo::NONE) RecordRelocInfo(rmode);
   emit(x);
 }
 
 
 void Assembler::emit(const Immediate& x) {
-  if (x.rmode_ != no_reloc) RecordRelocInfo(x.rmode_);
+  if (x.rmode_ != RelocInfo::NONE) RecordRelocInfo(x.rmode_);
   emit(x.x_);
 }
 
@@ -241,7 +242,7 @@ void Operand::set_modrm(int mod,  // reg == 0
 }
 
 
-void Operand::set_dispr(int32_t disp, RelocMode rmode) {
+void Operand::set_dispr(int32_t disp, RelocInfo::Mode rmode) {
   ASSERT(len_ == 1 || len_ == 2);
   *reinterpret_cast<int32_t*>(&buf_[len_]) = disp;
   len_ += sizeof(int32_t);
@@ -254,7 +255,7 @@ Operand::Operand(Register reg) {
 }
 
 
-Operand::Operand(int32_t disp, RelocMode rmode) {
+Operand::Operand(int32_t disp, RelocInfo::Mode rmode) {
   // [disp/r]
   set_modrm(0, ebp);
   set_dispr(disp, rmode);
index 49aa25c..db2c64b 100644 (file)
@@ -151,8 +151,8 @@ void Displacement::init(Label* L, Type type) {
 
 
 const int RelocInfo::kApplyMask =
-  RelocInfo::kCodeTargetMask | 1 << runtime_entry |
-    1 << js_return | 1 << internal_reference;
+  RelocInfo::kCodeTargetMask | 1 << RelocInfo::RUNTIME_ENTRY |
+    1 << RelocInfo::JS_RETURN | 1 << RelocInfo::INTERNAL_REFERENCE;
 
 
 void RelocInfo::patch_code(byte* instructions, int instruction_count) {
@@ -171,7 +171,7 @@ void RelocInfo::patch_code_with_call(Address target, int guard_bytes) {
 
   // Patch the code.
   CodePatcher patcher(pc_, code_size);
-  patcher.masm()->call(target, no_reloc);
+  patcher.masm()->call(target, RelocInfo::NONE);
 
   // Add the requested number of int3 instructions after the call.
   for (int i = 0; i < guard_bytes; i++) {
@@ -183,13 +183,13 @@ void RelocInfo::patch_code_with_call(Address target, int guard_bytes) {
 // -----------------------------------------------------------------------------
 // Implementation of Operand
 
-Operand::Operand(Register base, int32_t disp, RelocMode rmode) {
+Operand::Operand(Register base, int32_t disp, RelocInfo::Mode rmode) {
   // [base + disp/r]
-  if (disp == 0 && rmode == no_reloc && !base.is(ebp)) {
+  if (disp == 0 && rmode == RelocInfo::NONE && !base.is(ebp)) {
     // [base]
     set_modrm(0, base);
     if (base.is(esp)) set_sib(times_1, esp, base);
-  } else if (is_int8(disp) && rmode == no_reloc) {
+  } else if (is_int8(disp) && rmode == RelocInfo::NONE) {
     // [base + disp8]
     set_modrm(1, base);
     if (base.is(esp)) set_sib(times_1, esp, base);
@@ -207,14 +207,14 @@ Operand::Operand(Register base,
                  Register index,
                  ScaleFactor scale,
                  int32_t disp,
-                 RelocMode rmode) {
+                 RelocInfo::Mode rmode) {
   ASSERT(!index.is(esp));  // illegal addressing mode
   // [base + index*scale + disp/r]
-  if (disp == 0 && rmode == no_reloc && !base.is(ebp)) {
+  if (disp == 0 && rmode == RelocInfo::NONE && !base.is(ebp)) {
     // [base + index*scale]
     set_modrm(0, esp);
     set_sib(scale, index, base);
-  } else if (is_int8(disp) && rmode == no_reloc) {
+  } else if (is_int8(disp) && rmode == RelocInfo::NONE) {
     // [base + index*scale + disp8]
     set_modrm(1, esp);
     set_sib(scale, index, base);
@@ -231,7 +231,7 @@ Operand::Operand(Register base,
 Operand::Operand(Register index,
                  ScaleFactor scale,
                  int32_t disp,
-                 RelocMode rmode) {
+                 RelocInfo::Mode rmode) {
   ASSERT(!index.is(esp));  // illegal addressing mode
   // [index*scale + disp/r]
   set_modrm(0, esp);
@@ -317,8 +317,8 @@ Assembler::Assembler(void* buffer, int buffer_size) {
 
   last_pc_ = NULL;
   last_bound_pos_ = 0;
-  last_position_ = kNoPosition;
-  last_statement_position_ = kNoPosition;
+  last_position_ = RelocInfo::kNoPosition;
+  last_statement_position_ = RelocInfo::kNoPosition;
 }
 
 
@@ -1011,7 +1011,7 @@ void Assembler::test(Register reg, const Immediate& imm) {
   last_pc_ = pc_;
   // Only use test against byte for registers that have a byte
   // variant: eax, ebx, ecx, and edx.
-  if (imm.rmode_ == no_reloc && is_uint8(imm.x_) && reg.code() < 4) {
+  if (imm.rmode_ == RelocInfo::NONE && is_uint8(imm.x_) && reg.code() < 4) {
     uint8_t imm8 = imm.x_;
     if (reg.is(eax)) {
       EMIT(0xA8);
@@ -1290,10 +1290,10 @@ void Assembler::call(Label* L) {
 }
 
 
-void Assembler::call(byte* entry, RelocMode rmode) {
+void Assembler::call(byte* entry, RelocInfo::Mode rmode) {
   EnsureSpace ensure_space(this);
   last_pc_ = pc_;
-  ASSERT(!is_code_target(rmode));
+  ASSERT(!RelocInfo::IsCodeTarget(rmode));
   EMIT(0xE8);
   emit(entry - (pc_ + sizeof(int32_t)), rmode);
 }
@@ -1307,11 +1307,11 @@ void Assembler::call(const Operand& adr) {
 }
 
 
-void Assembler::call(Handle<Code> code,  RelocMode rmode) {
+void Assembler::call(Handle<Code> code,  RelocInfo::Mode rmode) {
   WriteRecordedPositions();
   EnsureSpace ensure_space(this);
   last_pc_ = pc_;
-  ASSERT(is_code_target(rmode));
+  ASSERT(RelocInfo::IsCodeTarget(rmode));
   EMIT(0xE8);
   emit(reinterpret_cast<intptr_t>(code.location()), rmode);
 }
@@ -1352,10 +1352,10 @@ void Assembler::jmp(Label* L) {
 }
 
 
-void Assembler::jmp(byte* entry, RelocMode rmode) {
+void Assembler::jmp(byte* entry, RelocInfo::Mode rmode) {
   EnsureSpace ensure_space(this);
   last_pc_ = pc_;
-  ASSERT(!is_code_target(rmode));
+  ASSERT(!RelocInfo::IsCodeTarget(rmode));
   EMIT(0xE9);
   emit(entry - (pc_ + sizeof(int32_t)), rmode);
 }
@@ -1369,10 +1369,10 @@ void Assembler::jmp(const Operand& adr) {
 }
 
 
-void Assembler::jmp(Handle<Code> code, RelocMode rmode) {
+void Assembler::jmp(Handle<Code> code, RelocInfo::Mode rmode) {
   EnsureSpace ensure_space(this);
   last_pc_ = pc_;
-  ASSERT(is_code_target(rmode));
+  ASSERT(RelocInfo::IsCodeTarget(rmode));
   EMIT(0xE9);
   emit(reinterpret_cast<intptr_t>(code.location()), rmode);
 }
@@ -1410,7 +1410,7 @@ void Assembler::j(Condition cc, Label* L, Hint hint) {
 }
 
 
-void Assembler::j(Condition cc, byte* entry, RelocMode rmode, Hint hint) {
+void Assembler::j(Condition cc, byte* entry, RelocInfo::Mode rmode, Hint hint) {
   EnsureSpace ensure_space(this);
   last_pc_ = pc_;
   ASSERT((0 <= cc) && (cc < 16));
@@ -1429,7 +1429,7 @@ void Assembler::j(Condition cc, Handle<Code> code, Hint hint) {
   // 0000 1111 1000 tttn #32-bit disp
   EMIT(0x0F);
   EMIT(0x80 | cc);
-  emit(reinterpret_cast<intptr_t>(code.location()), code_target);
+  emit(reinterpret_cast<intptr_t>(code.location()), RelocInfo::CODE_TARGET);
 }
 
 
@@ -1849,44 +1849,44 @@ void Assembler::Print() {
 void Assembler::RecordJSReturn() {
   WriteRecordedPositions();
   EnsureSpace ensure_space(this);
-  RecordRelocInfo(js_return);
+  RecordRelocInfo(RelocInfo::JS_RETURN);
 }
 
 
 void Assembler::RecordComment(const char* msg) {
   if (FLAG_debug_code) {
     EnsureSpace ensure_space(this);
-    RecordRelocInfo(comment, reinterpret_cast<intptr_t>(msg));
+    RecordRelocInfo(RelocInfo::COMMENT, reinterpret_cast<intptr_t>(msg));
   }
 }
 
 
 void Assembler::RecordPosition(int pos) {
-  if (pos == kNoPosition) return;
+  if (pos == RelocInfo::kNoPosition) return;
   ASSERT(pos >= 0);
   last_position_ = pos;
 }
 
 
 void Assembler::RecordStatementPosition(int pos) {
-  if (pos == kNoPosition) return;
+  if (pos == RelocInfo::kNoPosition) return;
   ASSERT(pos >= 0);
   last_statement_position_ = pos;
 }
 
 
 void Assembler::WriteRecordedPositions() {
-  if (last_statement_position_ != kNoPosition) {
+  if (last_statement_position_ != RelocInfo::kNoPosition) {
     EnsureSpace ensure_space(this);
-    RecordRelocInfo(statement_position, last_statement_position_);
+    RecordRelocInfo(RelocInfo::STATEMENT_POSITION, last_statement_position_);
   }
-  if ((last_position_ != kNoPosition) &&
+  if ((last_position_ != RelocInfo::kNoPosition) &&
       (last_position_ != last_statement_position_)) {
     EnsureSpace ensure_space(this);
-    RecordRelocInfo(position, last_position_);
+    RecordRelocInfo(RelocInfo::POSITION, last_position_);
   }
-  last_statement_position_ = kNoPosition;
-  last_position_ = kNoPosition;
+  last_statement_position_ = RelocInfo::kNoPosition;
+  last_position_ = RelocInfo::kNoPosition;
 }
 
 
@@ -1943,11 +1943,11 @@ void Assembler::GrowBuffer() {
 
   // relocate runtime entries
   for (RelocIterator it(desc); !it.done(); it.next()) {
-    RelocMode rmode = it.rinfo()->rmode();
-    if (rmode == runtime_entry) {
+    RelocInfo::Mode rmode = it.rinfo()->rmode();
+    if (rmode == RelocInfo::RUNTIME_ENTRY) {
       int32_t* p = reinterpret_cast<int32_t*>(it.rinfo()->pc());
       *p -= pc_delta;  // relocate entry
-    } else if (rmode == internal_reference) {
+    } else if (rmode == RelocInfo::INTERNAL_REFERENCE) {
       int32_t* p = reinterpret_cast<int32_t*>(it.rinfo()->pc());
       if (*p != 0) {  // 0 means uninitialized.
         *p += pc_delta;
@@ -1991,7 +1991,7 @@ void Assembler::emit_operand(Register reg, const Operand& adr) {
   adr.set_reg(reg);
   memmove(pc_, adr.buf_, adr.len_);
   pc_ += adr.len_;
-  if (adr.len_ >= sizeof(int32_t) && adr.rmode_ != no_reloc) {
+  if (adr.len_ >= sizeof(int32_t) && adr.rmode_ != RelocInfo::NONE) {
     pc_ -= sizeof(int32_t);  // pc_ must be *at* disp32
     RecordRelocInfo(adr.rmode_);
     pc_ += sizeof(int32_t);
@@ -2003,7 +2003,7 @@ void Assembler::emit_operand(const Operand& adr, Register reg) {
   adr.set_reg(reg);
   memmove(pc_, adr.buf_, adr.len_);
   pc_ += adr.len_;
-  if (adr.len_ >= sizeof(int32_t) && adr.rmode_ != no_reloc) {
+  if (adr.len_ >= sizeof(int32_t) && adr.rmode_ != RelocInfo::NONE) {
     pc_ -= sizeof(int32_t);  // pc_ must be *at* disp32
     RecordRelocInfo(adr.rmode_);
     pc_ += sizeof(int32_t);
@@ -2019,16 +2019,16 @@ void Assembler::emit_farith(int b1, int b2, int i) {
 }
 
 
-void Assembler::dd(uint32_t data, RelocMode reloc_info) {
+void Assembler::dd(uint32_t data, RelocInfo::Mode reloc_info) {
   EnsureSpace ensure_space(this);
   emit(data, reloc_info);
 }
 
 
-void Assembler::RecordRelocInfo(RelocMode rmode, intptr_t data) {
-  ASSERT(rmode != no_reloc);
+void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data) {
+  ASSERT(rmode != RelocInfo::NONE);
   // Don't record external references unless the heap will be serialized.
-  if (rmode == external_reference &&
+  if (rmode == RelocInfo::EXTERNAL_REFERENCE &&
       !Serializer::enabled() &&
       !FLAG_debug_code) {
     return;
index 1c76322..7c67867 100644 (file)
@@ -183,12 +183,14 @@ class Immediate BASE_EMBEDDED {
   inline explicit Immediate(Handle<Object> handle);
   inline explicit Immediate(Smi* value);
 
-  bool is_zero() const  { return x_ == 0 && rmode_ == no_reloc; }
-  bool is_int8() const  { return -128 <= x_ && x_ < 128 && rmode_ == no_reloc; }
+  bool is_zero() const { return x_ == 0 && rmode_ == RelocInfo::NONE; }
+  bool is_int8() const {
+    return -128 <= x_ && x_ < 128 && rmode_ == RelocInfo::NONE;
+  }
 
  private:
   int x_;
-  RelocMode rmode_;
+  RelocInfo::Mode rmode_;
 
   friend class Assembler;
 };
@@ -211,35 +213,36 @@ class Operand BASE_EMBEDDED {
   INLINE(explicit Operand(Register reg));
 
   // [disp/r]
-  INLINE(explicit Operand(int32_t disp, RelocMode rmode));
+  INLINE(explicit Operand(int32_t disp, RelocInfo::Mode rmode));
   // disp only must always be relocated
 
   // [base + disp/r]
-  explicit Operand(Register base, int32_t disp, RelocMode rmode = no_reloc);
+  explicit Operand(Register base, int32_t disp,
+                   RelocInfo::Mode rmode = RelocInfo::NONE);
 
   // [base + index*scale + disp/r]
   explicit Operand(Register base,
                    Register index,
                    ScaleFactor scale,
                    int32_t disp,
-                   RelocMode rmode = no_reloc);
+                   RelocInfo::Mode rmode = RelocInfo::NONE);
 
   // [index*scale + disp/r]
   explicit Operand(Register index,
                    ScaleFactor scale,
                    int32_t disp,
-                   RelocMode rmode = no_reloc);
+                   RelocInfo::Mode rmode = RelocInfo::NONE);
 
   static Operand StaticVariable(const ExternalReference& ext) {
     return Operand(reinterpret_cast<int32_t>(ext.address()),
-                   external_reference);
+                   RelocInfo::EXTERNAL_REFERENCE);
   }
 
   static Operand StaticArray(Register index,
                              ScaleFactor scale,
                              const ExternalReference& arr) {
     return Operand(index, scale, reinterpret_cast<int32_t>(arr.address()),
-                   external_reference);
+                   RelocInfo::EXTERNAL_REFERENCE);
   }
 
   // Returns true if this Operand is a wrapper for the specified register.
@@ -251,13 +254,13 @@ class Operand BASE_EMBEDDED {
   // The number of bytes in buf_.
   unsigned int len_;
   // Only valid if len_ > 4.
-  RelocMode rmode_;
+  RelocInfo::Mode rmode_;
 
   inline void set_modrm(int mod,  // reg == 0
                         Register rm);
   inline void set_sib(ScaleFactor scale, Register index, Register base);
   inline void set_disp8(int8_t disp);
-  inline void set_dispr(int32_t disp, RelocMode rmode);
+  inline void set_dispr(int32_t disp, RelocInfo::Mode rmode);
   inline void set_reg(Register reg) const;
 
   friend class Assembler;
@@ -574,19 +577,19 @@ class Assembler : public Malloced {
 
   // Calls
   void call(Label* L);
-  void call(byte* entry, RelocMode rmode);
+  void call(byte* entry, RelocInfo::Mode rmode);
   void call(const Operand& adr);
-  void call(Handle<Code> code, RelocMode rmode);
+  void call(Handle<Code> code, RelocInfo::Mode rmode);
 
   // Jumps
   void jmp(Label* L);  // unconditional jump to L
-  void jmp(byte* entry, RelocMode rmode);
+  void jmp(byte* entry, RelocInfo::Mode rmode);
   void jmp(const Operand& adr);
-  void jmp(Handle<Code> code, RelocMode rmode);
+  void jmp(Handle<Code> code, RelocInfo::Mode rmode);
 
   // Conditional jumps
   void j(Condition cc, Label* L, Hint hint = no_hint);
-  void j(Condition cc, byte* entry, RelocMode rmode, Hint hint = no_hint);
+  void j(Condition cc, byte* entry, RelocInfo::Mode rmode, Hint hint = no_hint);
   void j(Condition cc, Handle<Code> code, Hint hint = no_hint);
 
   // Floating-point operations
@@ -678,7 +681,7 @@ class Assembler : public Malloced {
 
   // Writes a single word of data in the code stream.
   // Used for inline tables, e.g., jump-tables.
-  void dd(uint32_t data, RelocMode reloc_info);
+  void dd(uint32_t data, RelocInfo::Mode reloc_info);
 
   // Writes the absolute address of a bound label at the given position in
   // the generated code. That positions should have the relocation mode
@@ -749,7 +752,7 @@ class Assembler : public Malloced {
   void GrowBuffer();
   inline void emit(uint32_t x);
   inline void emit(Handle<Object> handle);
-  inline void emit(uint32_t x, RelocMode rmode);
+  inline void emit(uint32_t x, RelocInfo::Mode rmode);
   inline void emit(const Immediate& x);
 
   // instruction generation
@@ -777,7 +780,7 @@ class Assembler : public Malloced {
   inline void emit_disp(Label* L, Displacement::Type type);
 
   // record reloc info for current pc_
-  void RecordRelocInfo(RelocMode rmode, intptr_t data = 0);
+  void RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data = 0);
 
   friend class CodePatcher;
   friend class EnsureSpace;
index 99877f7..9e63ac5 100644 (file)
@@ -192,21 +192,21 @@ void RelocInfoWriter::Write(const RelocInfo* rinfo) {
 #endif
   Counters::reloc_info_count.Increment();
   ASSERT(rinfo->pc() - last_pc_ >= 0);
-  ASSERT(reloc_mode_count < kMaxRelocModes);
+  ASSERT(RelocInfo::NUMBER_OF_MODES < kMaxRelocModes);
   // Use unsigned delta-encoding for pc.
   uint32_t pc_delta = rinfo->pc() - last_pc_;
-  RelocMode rmode = rinfo->rmode();
+  RelocInfo::Mode rmode = rinfo->rmode();
 
   // The two most common modes are given small tags, and usually fit in a byte.
-  if (rmode == embedded_object) {
+  if (rmode == RelocInfo::EMBEDDED_OBJECT) {
     WriteTaggedPC(pc_delta, kEmbeddedObjectTag);
-  } else if (rmode == code_target) {
+  } else if (rmode == RelocInfo::CODE_TARGET) {
     WriteTaggedPC(pc_delta, kCodeTargetTag);
-  } else if (rmode == position || rmode == statement_position) {
+  } else if (RelocInfo::IsPosition(rmode)) {
     // Use signed delta-encoding for data.
     int32_t data_delta = rinfo->data() - last_data_;
-    int pos_type_tag = rmode == position ? kNonstatementPositionTag
-                                         : kStatementPositionTag;
+    int pos_type_tag = rmode == RelocInfo::POSITION ? kNonstatementPositionTag
+                                                    : kStatementPositionTag;
     // Check if data is small enough to fit in a tagged byte.
     if (is_intn(data_delta, kSmallDataBits)) {
       WriteTaggedPC(pc_delta, kPositionTag);
@@ -218,7 +218,7 @@ void RelocInfoWriter::Write(const RelocInfo* rinfo) {
       WriteExtraTaggedData(data_delta, pos_type_tag);
       last_data_ = rinfo->data();
     }
-  } else if (rmode == comment) {
+  } else if (RelocInfo::IsComment(rmode)) {
     // Comments are normally not generated, so we use the costly encoding.
     WriteExtraTaggedPC(pc_delta, kPCJumpTag);
     WriteExtraTaggedData(rinfo->data() - last_data_, kCommentTag);
@@ -297,14 +297,14 @@ inline void RelocIterator::ReadTaggedData() {
 }
 
 
-inline RelocMode RelocIterator::DebugInfoModeFromTag(int tag) {
+inline RelocInfo::Mode RelocIterator::DebugInfoModeFromTag(int tag) {
   if (tag == kStatementPositionTag) {
-    return statement_position;
+    return RelocInfo::STATEMENT_POSITION;
   } else if (tag == kNonstatementPositionTag) {
-    return position;
+    return RelocInfo::POSITION;
   } else {
     ASSERT(tag == kCommentTag);
-    return comment;
+    return RelocInfo::COMMENT;
   }
 }
 
@@ -320,14 +320,14 @@ void RelocIterator::next() {
     int tag = AdvanceGetTag();
     if (tag == kEmbeddedObjectTag) {
       ReadTaggedPC();
-      if (SetMode(embedded_object)) return;
+      if (SetMode(RelocInfo::EMBEDDED_OBJECT)) return;
     } else if (tag == kCodeTargetTag) {
       ReadTaggedPC();
       if (*(reinterpret_cast<int**>(rinfo_.pc())) ==
           reinterpret_cast<int*>(0x61)) {
         tag = 0;
       }
-      if (SetMode(code_target)) return;
+      if (SetMode(RelocInfo::CODE_TARGET)) return;
     } else if (tag == kPositionTag) {
       ReadTaggedPC();
       Advance();
@@ -362,7 +362,7 @@ void RelocIterator::next() {
         }
       } else {
         AdvanceReadPC();
-        if (SetMode(static_cast<RelocMode>(extra_tag))) return;
+        if (SetMode(static_cast<RelocInfo::Mode>(extra_tag))) return;
       }
     }
   }
@@ -401,39 +401,37 @@ RelocIterator::RelocIterator(const CodeDesc& desc, int mode_mask) {
 
 
 #ifdef ENABLE_DISASSEMBLER
-const char* RelocInfo::RelocModeName(RelocMode rmode) {
+const char* RelocInfo::RelocModeName(RelocInfo::Mode rmode) {
   switch (rmode) {
-    case no_reloc:
+    case RelocInfo::NONE:
       return "no reloc";
-    case embedded_object:
+    case RelocInfo::EMBEDDED_OBJECT:
       return "embedded object";
-    case embedded_string:
+    case RelocInfo::EMBEDDED_STRING:
       return "embedded string";
-    case js_construct_call:
+    case RelocInfo::CONSTRUCT_CALL:
       return "code target (js construct call)";
-    case exit_js_frame:
-      return "code target (exit js frame)";
-    case code_target_context:
+    case RelocInfo::CODE_TARGET_CONTEXT:
       return "code target (context)";
-    case code_target:
+    case RelocInfo::CODE_TARGET:
       return "code target";
-    case runtime_entry:
+    case RelocInfo::RUNTIME_ENTRY:
       return "runtime entry";
-    case js_return:
+    case RelocInfo::JS_RETURN:
       return "js return";
-    case comment:
+    case RelocInfo::COMMENT:
       return "comment";
-    case position:
+    case RelocInfo::POSITION:
       return "position";
-    case statement_position:
+    case RelocInfo::STATEMENT_POSITION:
       return "statement position";
-    case external_reference:
+    case RelocInfo::EXTERNAL_REFERENCE:
       return "external reference";
-    case internal_reference:
+    case RelocInfo::INTERNAL_REFERENCE:
       return "internal reference";
-    case reloc_mode_count:
+    case RelocInfo::NUMBER_OF_MODES:
       UNREACHABLE();
-      return "reloc_mode_count";
+      return "number_of_modes";
   }
   return "unknown relocation type";
 }
@@ -441,21 +439,21 @@ const char* RelocInfo::RelocModeName(RelocMode rmode) {
 
 void RelocInfo::Print() {
   PrintF("%p  %s", pc_, RelocModeName(rmode_));
-  if (rmode_ == comment) {
+  if (IsComment(rmode_)) {
     PrintF("  (%s)", data_);
-  } else if (rmode_ == embedded_object) {
+  } else if (rmode_ == EMBEDDED_OBJECT) {
     PrintF("  (");
     target_object()->ShortPrint();
     PrintF(")");
-  } else if (rmode_ == external_reference) {
+  } else if (rmode_ == EXTERNAL_REFERENCE) {
     ExternalReferenceEncoder ref_encoder;
     PrintF(" (%s)  (%p)",
            ref_encoder.NameOfAddress(*target_reference_address()),
            *target_reference_address());
-  } else if (is_code_target(rmode_)) {
+  } else if (IsCodeTarget(rmode_)) {
     Code* code = Debug::GetCodeTarget(target_address());
     PrintF(" (%s)  (%p)", Code::Kind2String(code->kind()), target_address());
-  } else if (is_position(rmode_)) {
+  } else if (IsPosition(rmode_)) {
     PrintF("  (%d)", data());
   }
 
@@ -467,13 +465,12 @@ void RelocInfo::Print() {
 #ifdef DEBUG
 void RelocInfo::Verify() {
   switch (rmode_) {
-    case embedded_object:
+    case EMBEDDED_OBJECT:
       Object::VerifyPointer(target_object());
       break;
-    case js_construct_call:
-    case exit_js_frame:
-    case code_target_context:
-    case code_target: {
+    case CONSTRUCT_CALL:
+    case CODE_TARGET_CONTEXT:
+    case CODE_TARGET: {
       // convert inline target address to code object
       Address addr = target_address();
       ASSERT(addr != NULL);
@@ -484,17 +481,17 @@ void RelocInfo::Verify() {
       ASSERT(code->address() == HeapObject::cast(found)->address());
       break;
     }
-    case embedded_string:
-    case runtime_entry:
-    case js_return:
-    case comment:
-    case position:
-    case statement_position:
-    case external_reference:
-    case internal_reference:
-    case no_reloc:
+    case RelocInfo::EMBEDDED_STRING:
+    case RUNTIME_ENTRY:
+    case JS_RETURN:
+    case COMMENT:
+    case POSITION:
+    case STATEMENT_POSITION:
+    case EXTERNAL_REFERENCE:
+    case INTERNAL_REFERENCE:
+    case NONE:
       break;
-    case reloc_mode_count:
+    case NUMBER_OF_MODES:
       UNREACHABLE();
       break;
   }
index 625cd64..e5b9f04 100644 (file)
@@ -130,100 +130,6 @@ class LabelShadow: public Label {
 // -----------------------------------------------------------------------------
 // Relocation information
 
-// The constant kNoPosition is used with the collecting of source positions
-// in the relocation information. Two types of source positions are collected
-// "position" (RelocMode position) and "statement position" (RelocMode
-// statement_position). The "position" is collected at places in the source
-// code which are of interest when making stack traces to pin-point the source
-// location of a stack frame as close as possible. The "statement position" is
-// collected at the beginning at each statement, and is used to indicate
-// possible break locations. kNoPosition is used to indicate an
-// invalid/uninitialized position value.
-static const int kNoPosition = -1;
-
-
-enum RelocMode {
-  // Please note the order is important (see is_code_target, is_gc_reloc_mode).
-  js_construct_call,   // code target that is an exit JavaScript frame stub.
-  exit_js_frame,       // code target that is an exit JavaScript frame stub.
-  code_target_context,  // code target used for contextual loads.
-  code_target,         // code target which is not any of the above.
-  embedded_object,
-  embedded_string,
-
-  // Everything after runtime_entry (inclusive) is not GC'ed.
-  runtime_entry,
-  js_return,  // Marks start of the ExitJSFrame code.
-  comment,
-  position,  // See comment for kNoPosition above.
-  statement_position,  // See comment for kNoPosition above.
-  external_reference,  // The address of an external C++ function.
-  internal_reference,  // An address inside the same function.
-
-  // add more as needed
-  // Pseudo-types
-  reloc_mode_count,  // must be no greater than 14 - see RelocInfoWriter
-  no_reloc,  // never recorded
-  last_code_enum = code_target,
-  last_gced_enum = embedded_string
-};
-
-
-inline int RelocMask(RelocMode mode) {
-  return 1 << mode;
-}
-
-
-inline bool is_js_construct_call(RelocMode mode) {
-  return mode == js_construct_call;
-}
-
-
-inline bool is_exit_js_frame(RelocMode mode) {
-  return mode == exit_js_frame;
-}
-
-
-inline bool is_code_target(RelocMode mode) {
-  return mode <= last_code_enum;
-}
-
-
-// Is the relocation mode affected by GC?
-inline bool is_gc_reloc_mode(RelocMode mode) {
-  return mode <= last_gced_enum;
-}
-
-
-inline bool is_js_return(RelocMode mode) {
-  return mode == js_return;
-}
-
-
-inline bool is_comment(RelocMode mode) {
-  return mode == comment;
-}
-
-
-inline bool is_position(RelocMode mode) {
-  return mode == position || mode == statement_position;
-}
-
-
-inline bool is_statement_position(RelocMode mode) {
-  return mode == statement_position;
-}
-
-
-inline bool is_external_reference(RelocMode mode) {
-  return mode == external_reference;
-}
-
-
-inline bool is_internal_reference(RelocMode mode) {
-  return mode == internal_reference;
-}
-
 
 // Relocation information consists of the address (pc) of the datum
 // to which the relocation information applies, the relocation mode
@@ -234,22 +140,89 @@ inline bool is_internal_reference(RelocMode mode) {
 
 class RelocInfo BASE_EMBEDDED {
  public:
+  // The constant kNoPosition is used with the collecting of source positions
+  // in the relocation information. Two types of source positions are collected
+  // "position" (RelocMode position) and "statement position" (RelocMode
+  // statement_position). The "position" is collected at places in the source
+  // code which are of interest when making stack traces to pin-point the source
+  // location of a stack frame as close as possible. The "statement position" is
+  // collected at the beginning at each statement, and is used to indicate
+  // possible break locations. kNoPosition is used to indicate an
+  // invalid/uninitialized position value.
+  static const int kNoPosition = -1;
+
+  enum Mode {
+    // Please note the order is important (see IsCodeTarget, IsGCRelocMode).
+    CONSTRUCT_CALL,  // code target that is a call to a JavaScript constructor.
+    CODE_TARGET_CONTEXT,  // code target used for contextual loads.
+    CODE_TARGET,         // code target which is not any of the above.
+    EMBEDDED_OBJECT,
+    EMBEDDED_STRING,
+
+    // Everything after runtime_entry (inclusive) is not GC'ed.
+    RUNTIME_ENTRY,
+    JS_RETURN,  // Marks start of the ExitJSFrame code.
+    COMMENT,
+    POSITION,  // See comment for kNoPosition above.
+    STATEMENT_POSITION,  // See comment for kNoPosition above.
+    EXTERNAL_REFERENCE,  // The address of an external C++ function.
+    INTERNAL_REFERENCE,  // An address inside the same function.
+
+    // add more as needed
+    // Pseudo-types
+    NUMBER_OF_MODES,  // must be no greater than 14 - see RelocInfoWriter
+    NONE,  // never recorded
+    LAST_CODE_ENUM = CODE_TARGET,
+    LAST_GCED_ENUM = EMBEDDED_STRING
+  };
+
+
   RelocInfo() {}
-  RelocInfo(byte* pc, RelocMode rmode, intptr_t data)
+  RelocInfo(byte* pc, Mode rmode, intptr_t data)
       : pc_(pc), rmode_(rmode), data_(data) {
   }
 
+  static inline bool IsConstructCall(Mode mode) {
+    return mode == CONSTRUCT_CALL;
+  }
+  static inline bool IsCodeTarget(Mode mode) {
+    return mode <= LAST_CODE_ENUM;
+  }
+  // Is the relocation mode affected by GC?
+  static inline bool IsGCRelocMode(Mode mode) {
+    return mode <= LAST_GCED_ENUM;
+  }
+  static inline bool IsJSReturn(Mode mode) {
+    return mode == JS_RETURN;
+  }
+  static inline bool IsComment(Mode mode) {
+    return mode == COMMENT;
+  }
+  static inline bool IsPosition(Mode mode) {
+    return mode == POSITION || mode == STATEMENT_POSITION;
+  }
+  static inline bool IsStatementPosition(Mode mode) {
+    return mode == STATEMENT_POSITION;
+  }
+  static inline bool IsExternalReference(Mode mode) {
+    return mode == EXTERNAL_REFERENCE;
+  }
+  static inline bool IsInternalReference(Mode mode) {
+    return mode == INTERNAL_REFERENCE;
+  }
+  static inline int ModeMask(Mode mode) { return 1 << mode; }
+
   // Accessors
   byte* pc() const  { return pc_; }
   void set_pc(byte* pc) { pc_ = pc; }
-  RelocMode rmode() const {  return rmode_; }
+  Mode rmode() const {  return rmode_; }
   intptr_t data() const  { return data_; }
 
   // Apply a relocation by delta bytes
   INLINE(void apply(int delta));
 
   // Read/modify the code target in the branch/call instruction this relocation
-  // applies to; can only be called if this->is_code_target(rmode_)
+  // applies to; can only be called if IsCodeTarget(rmode_)
   INLINE(Address target_address());
   INLINE(void set_target_address(Address target));
   INLINE(Object* target_object());
@@ -278,7 +251,7 @@ class RelocInfo BASE_EMBEDDED {
 
 #ifdef ENABLE_DISASSEMBLER
   // Printing
-  static const char* RelocModeName(RelocMode rmode);
+  static const char* RelocModeName(Mode rmode);
   void Print();
 #endif  // ENABLE_DISASSEMBLER
 #ifdef DEBUG
@@ -286,9 +259,9 @@ class RelocInfo BASE_EMBEDDED {
   void Verify();
 #endif
 
-  static const int kCodeTargetMask = (1 << (last_code_enum + 1)) - 1;
-  static const int kPositionMask = 1 << position | 1 << statement_position;
-  static const int kDebugMask = kPositionMask | 1 << comment;
+  static const int kCodeTargetMask = (1 << (LAST_CODE_ENUM + 1)) - 1;
+  static const int kPositionMask = 1 << POSITION | 1 << STATEMENT_POSITION;
+  static const int kDebugMask = kPositionMask | 1 << COMMENT;
   static const int kApplyMask;  // Modes affected by apply. Depends on arch.
 
  private:
@@ -297,7 +270,7 @@ class RelocInfo BASE_EMBEDDED {
   // referencing the constant pool entry (except when rmode_ ==
   // comment).
   byte* pc_;
-  RelocMode rmode_;
+  Mode rmode_;
   intptr_t data_;
   friend class RelocIterator;
 };
@@ -383,11 +356,11 @@ class RelocIterator: public Malloced {
   int GetPositionTypeTag();
   void ReadTaggedData();
 
-  static RelocMode DebugInfoModeFromTag(int tag);
+  static RelocInfo::Mode DebugInfoModeFromTag(int tag);
 
   // If the given mode is wanted, set it in rinfo_ and return true.
   // Else return false. Used for efficiently skipping unwanted modes.
-  bool SetMode(RelocMode mode) {
+  bool SetMode(RelocInfo::Mode mode) {
     return (mode_mask_ & 1 << mode) ? (rinfo_.rmode_ = mode, true) : false;
   }
 
index 8bece05..7cde61a 100644 (file)
--- a/src/ast.h
+++ b/src/ast.h
@@ -101,7 +101,7 @@ typedef ZoneList<Handle<String> > ZoneStringList;
 
 class Node: public ZoneObject {
  public:
-  Node(): statement_pos_(kNoPosition) { }
+  Node(): statement_pos_(RelocInfo::kNoPosition) { }
   virtual ~Node() { }
   virtual void Accept(Visitor* v) = 0;
 
@@ -1167,7 +1167,7 @@ class FunctionLiteral: public Expression {
         start_position_(start_position),
         end_position_(end_position),
         is_expression_(is_expression),
-        function_token_position_(kNoPosition) {
+        function_token_position_(RelocInfo::kNoPosition) {
   }
 
   virtual void Accept(Visitor* v);
index da177ac..c686ff7 100644 (file)
@@ -117,7 +117,6 @@ void Builtins::Generate_JSConstructCall(MacroAssembler* masm) {
   // r0: number of arguments
   // r1: constructor function
   Label return_site;
-  __ RecordPosition(position);
   ParameterCount actual(r0);
   __ InvokeFunction(r1, actual, CALL_FUNCTION);
   __ bind(&return_site);
@@ -233,7 +232,7 @@ static void Generate_JSEntryTrampolineHelper(MacroAssembler* masm,
   __ mov(r0, Operand(r3));
   if (is_construct) {
     __ Call(Handle<Code>(Builtins::builtin(Builtins::JSConstructCall)),
-            code_target);
+            RelocInfo::CODE_TARGET);
   } else {
     ParameterCount actual(r0);
     __ InvokeFunction(r1, actual, CALL_FUNCTION);
@@ -386,7 +385,8 @@ void Builtins::Generate_FunctionCall(MacroAssembler* masm) {
     __ b(ne, &invoke);
     __ mov(r2, Operand(0));  // expected arguments is 0 for CALL_NON_FUNCTION
     __ GetBuiltinEntry(r3, Builtins::CALL_NON_FUNCTION);
-    __ Jump(Handle<Code>(builtin(ArgumentsAdaptorTrampoline)), code_target);
+    __ Jump(Handle<Code>(builtin(ArgumentsAdaptorTrampoline)),
+                         RelocInfo::CODE_TARGET);
 
     __ bind(&invoke);
     __ ldr(r3, FieldMemOperand(r1, JSFunction::kSharedFunctionInfoOffset));
@@ -397,7 +397,8 @@ void Builtins::Generate_FunctionCall(MacroAssembler* masm) {
            MemOperand(r3, SharedFunctionInfo::kCodeOffset - kHeapObjectTag));
     __ add(r3, r3, Operand(Code::kHeaderSize - kHeapObjectTag));
     __ cmp(r2, r0);  // Check formal and actual parameter counts.
-    __ Jump(Handle<Code>(builtin(ArgumentsAdaptorTrampoline)), code_target, ne);
+    __ Jump(Handle<Code>(builtin(ArgumentsAdaptorTrampoline)),
+                         RelocInfo::CODE_TARGET, ne);
 
     // 7. Jump to the code in r3 without checking arguments.
     ParameterCount expected(0);
index dbf8c5c..4b307c9 100644 (file)
@@ -266,7 +266,6 @@ void Builtins::Generate_JSConstructCall(MacroAssembler* masm) {
 
   // Call the function.
   Label return_site;
-  __ RecordPosition(position);
   ParameterCount actual(eax);
   __ InvokeFunction(edi, actual, CALL_FUNCTION);
   __ bind(&return_site);
@@ -355,7 +354,7 @@ static void Generate_JSEntryTrampolineHelper(MacroAssembler* masm,
   // Invoke the code.
   if (is_construct) {
     __ call(Handle<Code>(Builtins::builtin(Builtins::JSConstructCall)),
-            code_target);
+            RelocInfo::CODE_TARGET);
   } else {
     ParameterCount actual(eax);
     __ InvokeFunction(edi, actual, CALL_FUNCTION);
@@ -490,7 +489,8 @@ void Builtins::Generate_FunctionCall(MacroAssembler* masm) {
     __ j(not_zero, &invoke, taken);
     __ xor_(ebx, Operand(ebx));
     __ GetBuiltinEntry(edx, Builtins::CALL_NON_FUNCTION);
-    __ jmp(Handle<Code>(builtin(ArgumentsAdaptorTrampoline)), code_target);
+    __ jmp(Handle<Code>(builtin(ArgumentsAdaptorTrampoline)),
+           RelocInfo::CODE_TARGET);
 
     __ bind(&invoke);
     __ mov(edx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset));
@@ -592,7 +592,7 @@ void Builtins::Generate_FunctionApply(MacroAssembler* masm) {
 
   // Use inline caching to speed up access to arguments.
   Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize));
-  __ call(ic, code_target);
+  __ call(ic, RelocInfo::CODE_TARGET);
 
   // Remove IC arguments from the stack and push the nth argument.
   __ add(Operand(esp), Immediate(2 * kPointerSize));
index 9a17746..fc66f4d 100644 (file)
@@ -826,7 +826,7 @@ void ArmCodeGenerator::LoadTypeofExpression(Expression* x) {
     Literal key(variable->name());
     // TODO(1241834): Fetch the position from the variable instead of using
     // no position.
-    Property property(&global, &key, kNoPosition);
+    Property property(&global, &key, RelocInfo::kNoPosition);
     Load(&property);
   } else {
     Load(x, CodeGenState::LOAD_TYPEOF_EXPR);
@@ -1636,7 +1636,8 @@ void CEntryStub::GenerateCore(MacroAssembler* masm,
   // r5: pointer to builtin function  (C callee-saved)
 
   if (do_gc) {
-    __ Call(FUNCTION_ADDR(Runtime::PerformGC), runtime_entry);  // passing r0
+    // Passing r0.
+    __ Call(FUNCTION_ADDR(Runtime::PerformGC), RelocInfo::RUNTIME_ENTRY);
   }
 
   // Call C built-in.
@@ -2066,9 +2067,9 @@ void ArmCodeGenerator::GetReferenceProperty(Expression* key) {
     Variable* var = ref()->expression()->AsVariableProxy()->AsVariable();
     if (var != NULL) {
       ASSERT(var->is_global());
-      __ Call(ic, code_target_context);
+      __ Call(ic, RelocInfo::CODE_TARGET_CONTEXT);
     } else {
-      __ Call(ic, code_target);
+      __ Call(ic, RelocInfo::CODE_TARGET);
     }
 
   } else {
@@ -2099,7 +2100,7 @@ void ArmCodeGenerator::SetReferenceProperty(MacroAssembler* masm,
     // Setup the name register.
     masm->mov(r2, Operand(name));
     Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize));
-    masm->Call(ic, code_target);
+    masm->Call(ic, RelocInfo::CODE_TARGET);
 
   } else {
     // Access keyed property.
@@ -3705,7 +3706,7 @@ void ArmCodeGenerator::VisitCall(Call* node) {
     // Setup the receiver register and call the IC initialization code.
     Handle<Code> stub = ComputeCallInitialize(args->length());
     __ RecordPosition(node->position());
-    __ Call(stub, code_target_context);
+    __ Call(stub, RelocInfo::CODE_TARGET_CONTEXT);
     __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
     // Remove the function from the stack.
     __ pop();
@@ -3752,7 +3753,7 @@ void ArmCodeGenerator::VisitCall(Call* node) {
       // Set the receiver register and call the IC initialization code.
       Handle<Code> stub = ComputeCallInitialize(args->length());
       __ RecordPosition(node->position());
-      __ Call(stub, code_target);
+      __ Call(stub, RelocInfo::CODE_TARGET);
       __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
 
       // Remove the function from the stack.
@@ -3819,9 +3820,9 @@ void ArmCodeGenerator::VisitCallNew(CallNew* node) {
 
   // Call the construct call builtin that handles allocation and
   // constructor invocation.
-  __ RecordPosition(position);
+  __ RecordPosition(RelocInfo::POSITION);
   __ Call(Handle<Code>(Builtins::builtin(Builtins::JSConstructCall)),
-          js_construct_call);
+          RelocInfo::CONSTRUCT_CALL);
 
   // Discard old TOS value and push r0 on the stack (same as Pop(), push(r0)).
   __ str(r0, MemOperand(sp, 0 * kPointerSize));
@@ -3996,7 +3997,7 @@ void ArmCodeGenerator::VisitCallRuntime(CallRuntime* node) {
 
     // Call the JS runtime function.
     Handle<Code> stub = ComputeCallInitialize(args->length());
-    __ Call(stub, code_target);
+    __ Call(stub, RelocInfo::CODE_TARGET);
     __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
     __ pop();
     __ push(r0);
@@ -4534,7 +4535,7 @@ void ArmCodeGenerator::VisitCompareOperation(CompareOperation* node) {
 void ArmCodeGenerator::RecordStatementPosition(Node* node) {
   if (FLAG_debug_info) {
     int statement_pos = node->statement_pos();
-    if (statement_pos == kNoPosition) return;
+    if (statement_pos == RelocInfo::kNoPosition) return;
     __ RecordStatementPosition(statement_pos);
   }
 }
index 773e9f4..9f1d30e 100644 (file)
@@ -878,7 +878,7 @@ void Ia32CodeGenerator::LoadTypeofExpression(Expression* x) {
     Literal key(variable->name());
     // TODO(1241834): Fetch the position from the variable instead of using
     // no position.
-    Property property(&global, &key, kNoPosition);
+    Property property(&global, &key, RelocInfo::kNoPosition);
     Load(&property);
   } else {
     Load(x, CodeGenState::LOAD_TYPEOF_EXPR);
@@ -1204,9 +1204,9 @@ void Ia32CodeGenerator::GetReferenceProperty(Expression* key) {
     __ Set(ecx, Immediate(name));
     if (var != NULL) {
       ASSERT(var->is_global());
-      __ call(ic, code_target_context);
+      __ call(ic, RelocInfo::CODE_TARGET_CONTEXT);
     } else {
-      __ call(ic, code_target);
+      __ call(ic, RelocInfo::CODE_TARGET);
     }
   } else {
     // Access keyed property.
@@ -1217,9 +1217,9 @@ void Ia32CodeGenerator::GetReferenceProperty(Expression* key) {
     Variable* var = ref()->expression()->AsVariableProxy()->AsVariable();
     if (var != NULL) {
       ASSERT(var->is_global());
-      __ call(ic, code_target_context);
+      __ call(ic, RelocInfo::CODE_TARGET_CONTEXT);
     } else {
-      __ call(ic, code_target);
+      __ call(ic, RelocInfo::CODE_TARGET);
     }
   }
   __ push(eax);  // IC call leaves result in eax, push it out
@@ -1243,7 +1243,7 @@ void Ia32CodeGenerator::SetReferenceProperty(MacroAssembler* masm,
     masm->pop(eax);
     // Setup the name register.
     masm->Set(ecx, Immediate(name));
-    masm->call(ic, code_target);
+    masm->call(ic, RelocInfo::CODE_TARGET);
   } else {
     // Access keyed property.
     ASSERT(type == Reference::KEYED);
@@ -1252,7 +1252,7 @@ void Ia32CodeGenerator::SetReferenceProperty(MacroAssembler* masm,
     Handle<Code> ic(Builtins::builtin(Builtins::KeyedStoreIC_Initialize));
     // TODO(1222589): Make the IC grab the values from the stack.
     masm->pop(eax);
-    masm->call(ic, code_target);
+    masm->call(ic, RelocInfo::CODE_TARGET);
   }
   masm->push(eax);  // IC call leaves result in eax, push it out
 }
@@ -2628,7 +2628,7 @@ void CallFunctionStub::Generate(MacroAssembler* masm) {
   masm->Set(ebx, Immediate(0));
   masm->GetBuiltinEntry(edx, Builtins::CALL_NON_FUNCTION);
   Handle<Code> adaptor(Builtins::builtin(Builtins::ArgumentsAdaptorTrampoline));
-  masm->jmp(adaptor, code_target);
+  masm->jmp(adaptor, RelocInfo::CODE_TARGET);
 }
 
 
@@ -2958,7 +2958,8 @@ void Ia32CodeGenerator::GenerateFastCaseSwitchJumpTable(
   __ cmp(eax, range * 2);
   __ j(greater_equal, fail_label, not_taken);
 
-  __ jmp(Operand(eax, times_2, 0x0, internal_reference));  // 0 is placeholder
+  // 0 is placeholder.
+  __ jmp(Operand(eax, times_2, 0x0, RelocInfo::INTERNAL_REFERENCE));
   // calculate address to overwrite later with actual address of table.
   int32_t jump_table_ref = __ pc_offset() - sizeof(int32_t);
 
@@ -2967,7 +2968,7 @@ void Ia32CodeGenerator::GenerateFastCaseSwitchJumpTable(
   __ WriteInternalReference(jump_table_ref, table_start);
 
   for (int i = 0; i < range; i++) {
-    __ dd(0x0, internal_reference);  // table entry, 0 is placeholder
+    __ dd(0x0, RelocInfo::INTERNAL_REFERENCE);  // table entry, 0 is placeholder
   }
 }
 
@@ -3893,7 +3894,7 @@ void Ia32CodeGenerator::VisitObjectLiteral(ObjectLiteral* node) {
           Load(property->value());
           __ pop(eax);
           __ Set(ecx, Immediate(key));
-          __ call(ic, code_target);
+          __ call(ic, RelocInfo::CODE_TARGET);
           __ add(Operand(esp), Immediate(kPointerSize));
           // Ignore result.
           break;
@@ -4094,7 +4095,7 @@ void Ia32CodeGenerator::VisitCall(Call* node) {
     // Setup the receiver register and call the IC initialization code.
     Handle<Code> stub = ComputeCallInitialize(args->length());
     __ RecordPosition(node->position());
-    __ call(stub, code_target_context);
+    __ call(stub, RelocInfo::CODE_TARGET_CONTEXT);
     __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset));
 
     // Overwrite the function on the stack with the result.
@@ -4138,7 +4139,7 @@ void Ia32CodeGenerator::VisitCall(Call* node) {
       // Call the IC initialization code.
       Handle<Code> stub = ComputeCallInitialize(args->length());
       __ RecordPosition(node->position());
-      __ call(stub, code_target);
+      __ call(stub, RelocInfo::CODE_TARGET);
       __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset));
 
       // Overwrite the function on the stack with the result.
@@ -4208,7 +4209,7 @@ void Ia32CodeGenerator::VisitCallNew(CallNew* node) {
   // constructor invocation.
   __ RecordPosition(node->position());
   __ call(Handle<Code>(Builtins::builtin(Builtins::JSConstructCall)),
-          js_construct_call);
+          RelocInfo::CONSTRUCT_CALL);
   __ mov(TOS, eax);  // discard the function and "push" the newly created object
 }
 
@@ -4503,7 +4504,7 @@ void Ia32CodeGenerator::VisitCallRuntime(CallRuntime* node) {
     // Call the JS runtime function.
     Handle<Code> stub = ComputeCallInitialize(args->length());
     __ Set(eax, Immediate(args->length()));
-    __ call(stub, code_target);
+    __ call(stub, RelocInfo::CODE_TARGET);
     __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset));
     __ mov(TOS, eax);
   }
@@ -5163,7 +5164,7 @@ void Ia32CodeGenerator::VisitCompareOperation(CompareOperation* node) {
 void Ia32CodeGenerator::RecordStatementPosition(Node* node) {
   if (FLAG_debug_info) {
     int pos = node->statement_pos();
-    if (pos != kNoPosition) {
+    if (pos != RelocInfo::kNoPosition) {
       __ RecordStatementPosition(pos);
     }
   }
@@ -5254,7 +5255,7 @@ void CEntryStub::GenerateCore(MacroAssembler* masm,
 
   if (do_gc) {
     __ mov(Operand(esp, 0 * kPointerSize), eax);  // Result.
-    __ call(FUNCTION_ADDR(Runtime::PerformGC), runtime_entry);
+    __ call(FUNCTION_ADDR(Runtime::PerformGC), RelocInfo::RUNTIME_ENTRY);
   }
 
   // Call C function.
index 7d50a69..8eb1a04 100644 (file)
@@ -51,10 +51,10 @@ void CodeGenerator::ProcessDeferred() {
     DeferredCode* code = deferred_.RemoveLast();
     MacroAssembler* masm = code->masm();
     // Record position of deferred code stub.
-    if (code->statement_position() != kNoPosition) {
+    if (code->statement_position() != RelocInfo::kNoPosition) {
       masm->RecordStatementPosition(code->statement_position());
     }
-    if (code->position() != kNoPosition) {
+    if (code->position() != RelocInfo::kNoPosition) {
       masm->RecordPosition(code->position());
     }
     // Bind labels and generate the code.
index 4a6d4a4..ab25374 100644 (file)
@@ -130,7 +130,7 @@ static Handle<JSFunction> MakeFunction(bool is_global,
                                       code);
 
   CodeGenerator::SetFunctionInfo(fun, lit->scope()->num_parameters(),
-                                 kNoPosition,
+                                 RelocInfo::kNoPosition,
                                  lit->start_position(), lit->end_position(),
                                  lit->is_expression(), true, script);
 
index d2c5424..b6925aa 100644 (file)
@@ -96,8 +96,8 @@ void BreakLocationIterator::Next() {
 
     // Whenever a statement position or (plain) position is passed update the
     // current value of these.
-    if (is_position(rmode())) {
-      if (is_statement_position(rmode())) {
+    if (RelocInfo::IsPosition(rmode())) {
+      if (RelocInfo::IsStatementPosition(rmode())) {
         statement_position_ =
             rinfo()->data() - debug_info_->shared()->start_position();
       }
@@ -111,10 +111,10 @@ void BreakLocationIterator::Next() {
     // Check for breakable code target. Look in the original code as setting
     // break points can cause the code targets in the running (debugged) code to
     // be of a different kind than in the original code.
-    if (is_code_target(rmode())) {
+    if (RelocInfo::IsCodeTarget(rmode())) {
       Address target = original_rinfo()->target_address();
       Code* code = Debug::GetCodeTarget(target);
-      if (code->is_inline_cache_stub() || is_js_construct_call(rmode())) {
+      if (code->is_inline_cache_stub() || RelocInfo::IsConstructCall(rmode())) {
         break_point_++;
         return;
       }
@@ -135,8 +135,7 @@ void BreakLocationIterator::Next() {
     }
 
     // Check for break at return.
-    // Currently is_exit_js_frame is used on ARM.
-    if (is_js_return(rmode()) || is_exit_js_frame(rmode())) {
+    if (RelocInfo::IsJSReturn(rmode())) {
       // Set the positions to the end of the function.
       if (debug_info_->shared()->HasSourceCode()) {
         position_ = debug_info_->shared()->end_position() -
@@ -285,7 +284,7 @@ void BreakLocationIterator::SetDebugBreak() {
     return;
   }
 
-  if (is_js_return(rmode())) {
+  if (RelocInfo::IsJSReturn(rmode())) {
     // This path is currently only used on IA32 as JSExitFrame on ARM uses a
     // stub.
     // Patch the JS frame exit code with a debug break call. See
@@ -310,7 +309,7 @@ void BreakLocationIterator::SetDebugBreak() {
 
 
 void BreakLocationIterator::ClearDebugBreak() {
-  if (is_js_return(rmode())) {
+  if (RelocInfo::IsJSReturn(rmode())) {
     // Restore the JS frame exit code.
     rinfo()->patch_code(original_rinfo()->pc(),
                         Debug::kIa32JSReturnSequenceLength);
@@ -341,15 +340,14 @@ void BreakLocationIterator::PrepareStepIn() {
     }
   } else {
     // Step in through constructs call requires no changes to the running code.
-    ASSERT(is_js_construct_call(rmode()));
+    ASSERT(RelocInfo::IsConstructCall(rmode()));
   }
 }
 
 
 // Check whether the break point is at a position which will exit the function.
 bool BreakLocationIterator::IsExit() const {
-  // Currently is_exit_js_frame is used on ARM.
-  return (is_js_return(rmode()) || is_exit_js_frame(rmode()));
+  return (RelocInfo::IsJSReturn(rmode()));
 }
 
 
@@ -360,7 +358,7 @@ bool BreakLocationIterator::HasBreakPoint() {
 
 // Check whether there is a debug break at the current position.
 bool BreakLocationIterator::IsDebugBreak() {
-  if (is_js_return(rmode())) {
+  if (RelocInfo::IsJSReturn(rmode())) {
     // This is IA32 specific but works as long as the ARM version
     // still uses a stub for JSExitFrame.
     //
@@ -403,7 +401,7 @@ DebugInfoListNode* Debug::debug_info_list_ = NULL;
 // Threading support.
 void Debug::ThreadInit() {
   thread_local_.last_step_action_ = StepNone;
-  thread_local_.last_statement_position_ = kNoPosition;
+  thread_local_.last_statement_position_ = RelocInfo::kNoPosition;
   thread_local_.step_count_ = 0;
   thread_local_.last_fp_ = 0;
   thread_local_.step_into_fp_ = 0;
@@ -921,7 +919,7 @@ void Debug::PrepareStep(StepAction step_action, int step_count) {
 
   // Compute whether or not the target is a call target.
   bool is_call_target = false;
-  if (is_code_target(it.rinfo()->rmode())) {
+  if (RelocInfo::IsCodeTarget(it.rinfo()->rmode())) {
     Address target = it.rinfo()->target_address();
     Code* code = Debug::GetCodeTarget(target);
     if (code->is_call_stub()) is_call_target = true;
@@ -937,7 +935,7 @@ void Debug::PrepareStep(StepAction step_action, int step_count) {
       JSFunction* function = JSFunction::cast(frames_it.frame()->function());
       FloodWithOneShot(Handle<SharedFunctionInfo>(function->shared()));
     }
-  } else if (!(is_call_target || is_js_construct_call(it.rmode())) ||
+  } else if (!(is_call_target || RelocInfo::IsConstructCall(it.rmode())) ||
              step_action == StepNext || step_action == StepMin) {
     // Step next or step min.
 
@@ -1017,9 +1015,9 @@ bool Debug::IsBreakStub(Code* code) {
 Handle<Code> Debug::FindDebugBreak(RelocInfo* rinfo) {
   // Find the builtin debug break function matching the calling convention
   // used by the call site.
-  RelocMode mode = rinfo->rmode();
+  RelocInfo::Mode mode = rinfo->rmode();
 
-  if (is_code_target(mode)) {
+  if (RelocInfo::IsCodeTarget(mode)) {
     Address target = rinfo->target_address();
     Code* code = Debug::GetCodeTarget(target);
     if (code->is_inline_cache_stub()) {
@@ -1043,15 +1041,11 @@ Handle<Code> Debug::FindDebugBreak(RelocInfo* rinfo) {
         return result;
       }
     }
-    if (is_js_construct_call(mode)) {
+    if (RelocInfo::IsConstructCall(mode)) {
       Handle<Code> result =
           Handle<Code>(Builtins::builtin(Builtins::ConstructCall_DebugBreak));
       return result;
     }
-    // Currently is_exit_js_frame is used on ARM.
-    if (is_exit_js_frame(mode)) {
-      return Handle<Code>(Builtins::builtin(Builtins::Return_DebugBreak));
-    }
     if (code->kind() == Code::STUB) {
       ASSERT(code->major_key() == CodeStub::CallFunction ||
              code->major_key() == CodeStub::StackCheck);
@@ -1132,7 +1126,7 @@ void Debug::ClearStepIn() {
 
 void Debug::ClearStepNext() {
   thread_local_.last_step_action_ = StepNone;
-  thread_local_.last_statement_position_ = kNoPosition;
+  thread_local_.last_statement_position_ = RelocInfo::kNoPosition;
   thread_local_.last_fp_ = 0;
 }
 
@@ -1222,7 +1216,7 @@ void Debug::SetAfterBreakTarget(JavaScriptFrame* frame) {
   bool at_js_exit = false;
   RelocIterator it(debug_info->code());
   while (!it.done()) {
-    if (is_js_return(it.rinfo()->rmode())) {
+    if (RelocInfo::IsJSReturn(it.rinfo()->rmode())) {
       at_js_exit = it.rinfo()->pc() == addr - 1;
     }
     it.next();
index 23b0ff2..52e8a98 100644 (file)
@@ -97,11 +97,13 @@ class BreakLocationIterator {
   inline Address pc() { return reloc_iterator_->rinfo()->pc(); }
   inline Code* code() { return debug_info_->code(); }
   inline RelocInfo* rinfo() { return reloc_iterator_->rinfo(); }
-  inline RelocMode rmode() const { return reloc_iterator_->rinfo()->rmode(); }
+  inline RelocInfo::Mode rmode() const {
+    return reloc_iterator_->rinfo()->rmode();
+  }
   inline RelocInfo* original_rinfo() {
     return reloc_iterator_original_->rinfo();
   }
-  inline RelocMode original_rmode() const {
+  inline RelocInfo::Mode original_rmode() const {
     return reloc_iterator_original_->rinfo()->rmode();
   }
 
index 81f4702..12183d5 100644 (file)
@@ -140,7 +140,7 @@ static int DecodeIt(FILE* f,
         constants = num_const;
         pc += 4;
       } else if (it != NULL && !it->done() && it->rinfo()->pc() == pc &&
-          it->rinfo()->rmode() == internal_reference) {
+          it->rinfo()->rmode() == RelocInfo::INTERNAL_REFERENCE) {
         // raw pointer embedded in code stream, e.g., jump table
         byte* ptr = *reinterpret_cast<byte**>(pc);
         OS::SNPrintF(decode_buffer,
@@ -157,11 +157,11 @@ static int DecodeIt(FILE* f,
     // Collect RelocInfo for this instruction (prev_pc .. pc-1)
     List<const char*> comments(4);
     List<byte*> pcs(1);
-    List<RelocMode> rmodes(1);
+    List<RelocInfo::Mode> rmodes(1);
     List<intptr_t> datas(1);
     if (it != NULL) {
       while (!it->done() && it->rinfo()->pc() < pc) {
-        if (is_comment(it->rinfo()->rmode())) {
+        if (RelocInfo::IsComment(it->rinfo()->rmode())) {
           // For comments just collect the text.
           comments.Add(reinterpret_cast<const char*>(it->rinfo()->data()));
         } else {
@@ -206,32 +206,32 @@ static int DecodeIt(FILE* f,
         out.AddPadding(' ', kRelocInfoPosition);
       }
 
-      RelocMode rmode = relocinfo.rmode();
-      if (is_position(rmode)) {
-        if (is_statement_position(rmode)) {
+      RelocInfo::Mode rmode = relocinfo.rmode();
+      if (RelocInfo::IsPosition(rmode)) {
+        if (RelocInfo::IsStatementPosition(rmode)) {
           out.AddFormatted("    ;; debug: statement %d", relocinfo.data());
         } else {
           out.AddFormatted("    ;; debug: position %d", relocinfo.data());
         }
-      } else if (rmode == embedded_object) {
+      } else if (rmode == RelocInfo::EMBEDDED_OBJECT) {
         HeapStringAllocator allocator;
         StringStream accumulator(&allocator);
         relocinfo.target_object()->ShortPrint(&accumulator);
         SmartPointer<char> obj_name = accumulator.ToCString();
         out.AddFormatted("    ;; object: %s", *obj_name);
-      } else if (rmode == external_reference) {
+      } else if (rmode == RelocInfo::EXTERNAL_REFERENCE) {
         const char* reference_name =
             ref_encoder.NameOfAddress(*relocinfo.target_reference_address());
         out.AddFormatted("    ;; external reference (%s)", reference_name);
-      } else if (is_code_target(rmode)) {
+      } else if (RelocInfo::IsCodeTarget(rmode)) {
         out.AddFormatted("    ;; code:");
-        if (rmode == js_construct_call) {
+        if (rmode == RelocInfo::CONSTRUCT_CALL) {
           out.AddFormatted(" constructor,");
         }
         Code* code = Debug::GetCodeTarget(relocinfo.target_address());
         Code::Kind kind = code->kind();
         if (code->is_inline_cache_stub()) {
-          if (rmode == code_target_context) {
+          if (rmode == RelocInfo::CODE_TARGET_CONTEXT) {
             out.AddFormatted(" contextual,");
           }
           InlineCacheState ic_state = code->ic_state();
index 6977e17..bece2a8 100644 (file)
@@ -151,7 +151,7 @@ void LoadIC::GenerateArrayLength(MacroAssembler* masm) {
   // Cache miss: Jump to runtime.
   __ bind(&miss);
   Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Miss));
-  __ Jump(ic, code_target);
+  __ Jump(ic, RelocInfo::CODE_TARGET);
 }
 
 
@@ -187,7 +187,7 @@ void LoadIC::GenerateShortStringLength(MacroAssembler* masm) {
   // Cache miss: Jump to runtime.
   __ bind(&miss);
   Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Miss));
-  __ Jump(ic, code_target);
+  __ Jump(ic, RelocInfo::CODE_TARGET);
 }
 
 
@@ -222,7 +222,7 @@ void LoadIC::GenerateMediumStringLength(MacroAssembler* masm) {
   // Cache miss: Jump to runtime.
   __ bind(&miss);
   Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Miss));
-  __ Jump(ic, code_target);
+  __ Jump(ic, RelocInfo::CODE_TARGET);
 }
 
 
@@ -256,7 +256,7 @@ void LoadIC::GenerateLongStringLength(MacroAssembler* masm) {
   // Cache miss: Jump to runtime.
   __ bind(&miss);
   Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Miss));
-  __ Jump(ic, code_target);
+  __ Jump(ic, RelocInfo::CODE_TARGET);
 }
 
 
@@ -271,7 +271,7 @@ void LoadIC::GenerateFunctionPrototype(MacroAssembler* masm) {
   // sub-optimal. We should port the fast case code from IA-32.
 
   Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Miss));
-  __ Jump(ic, code_target);
+  __ Jump(ic, RelocInfo::CODE_TARGET);
 }
 
 
index fa150c1..8cfca1e 100644 (file)
--- a/src/ic.cc
+++ b/src/ic.cc
@@ -174,7 +174,7 @@ IC::State IC::StateFrom(Code* target, Object* receiver) {
 }
 
 
-RelocMode IC::ComputeMode() {
+RelocInfo::Mode IC::ComputeMode() {
   Address addr = address();
   Code* code = Code::cast(Heap::FindCodeObject(addr));
   for (RelocIterator it(code, RelocInfo::kCodeTargetMask);
@@ -183,7 +183,7 @@ RelocMode IC::ComputeMode() {
     if (info->pc() == addr) return info->rmode();
   }
   UNREACHABLE();
-  return no_reloc;
+  return RelocInfo::NONE;
 }
 
 
index fa45c7b..6534da0 100644 (file)
--- a/src/ic.h
+++ b/src/ic.h
@@ -90,11 +90,13 @@ class IC {
   // Computes the reloc info for this IC. This is a fairly expensive
   // operation as it has to search through the heap to find the code
   // object that contains this IC site.
-  RelocMode ComputeMode();
+  RelocInfo::Mode ComputeMode();
 
   // Returns if this IC is for contextual (no explicit receiver)
   // access to properties.
-  bool is_contextual() { return ComputeMode() == code_target_context; }
+  bool is_contextual() {
+    return ComputeMode() == RelocInfo::CODE_TARGET_CONTEXT;
+  }
 
   // Returns the map to use for caching stubs for a given object.
   // This method should not be called with undefined or null.
index d85a1de..a03f2b4 100644 (file)
@@ -84,7 +84,8 @@ void MacroAssembler::Jump(Register target, Condition cond) {
 }
 
 
-void MacroAssembler::Jump(intptr_t target, RelocMode rmode, Condition cond) {
+void MacroAssembler::Jump(intptr_t target, RelocInfo::Mode rmode,
+                          Condition cond) {
 #if USE_BX
   mov(ip, Operand(target, rmode), LeaveCC, cond);
   bx(ip, cond);
@@ -94,14 +95,16 @@ void MacroAssembler::Jump(intptr_t target, RelocMode rmode, Condition cond) {
 }
 
 
-void MacroAssembler::Jump(byte* target, RelocMode rmode, Condition cond) {
-  ASSERT(!is_code_target(rmode));
+void MacroAssembler::Jump(byte* target, RelocInfo::Mode rmode,
+                          Condition cond) {
+  ASSERT(!RelocInfo::IsCodeTarget(rmode));
   Jump(reinterpret_cast<intptr_t>(target), rmode, cond);
 }
 
 
-void MacroAssembler::Jump(Handle<Code> code, RelocMode rmode, Condition cond) {
-  ASSERT(is_code_target(rmode));
+void MacroAssembler::Jump(Handle<Code> code, RelocInfo::Mode rmode,
+                          Condition cond) {
+  ASSERT(RelocInfo::IsCodeTarget(rmode));
   // 'code' is always generated ARM code, never THUMB code
   Jump(reinterpret_cast<intptr_t>(code.location()), rmode, cond);
 }
@@ -118,9 +121,10 @@ void MacroAssembler::Call(Register target, Condition cond) {
 }
 
 
-void MacroAssembler::Call(intptr_t target, RelocMode rmode, Condition cond) {
+void MacroAssembler::Call(intptr_t target, RelocInfo::Mode rmode,
+                          Condition cond) {
 #if !defined(__arm__)
-  if (rmode == runtime_entry) {
+  if (rmode == RelocInfo::RUNTIME_ENTRY) {
     mov(r2, Operand(target, rmode), LeaveCC, cond);
     // Set lr for return at current pc + 8.
     mov(lr, Operand(pc), LeaveCC, cond);
@@ -148,14 +152,16 @@ void MacroAssembler::Call(intptr_t target, RelocMode rmode, Condition cond) {
 }
 
 
-void MacroAssembler::Call(byte* target, RelocMode rmode, Condition cond) {
-  ASSERT(!is_code_target(rmode));
+void MacroAssembler::Call(byte* target, RelocInfo::Mode rmode,
+                          Condition cond) {
+  ASSERT(!RelocInfo::IsCodeTarget(rmode));
   Call(reinterpret_cast<intptr_t>(target), rmode, cond);
 }
 
 
-void MacroAssembler::Call(Handle<Code> code, RelocMode rmode, Condition cond) {
-  ASSERT(is_code_target(rmode));
+void MacroAssembler::Call(Handle<Code> code, RelocInfo::Mode rmode,
+                          Condition cond) {
+  ASSERT(RelocInfo::IsCodeTarget(rmode));
   // 'code' is always generated ARM code, never THUMB code
   Call(reinterpret_cast<intptr_t>(code.location()), rmode, cond);
 }
@@ -330,10 +336,10 @@ void MacroAssembler::InvokePrologue(const ParameterCount& expected,
     Handle<Code> adaptor =
         Handle<Code>(Builtins::builtin(Builtins::ArgumentsAdaptorTrampoline));
     if (flag == CALL_FUNCTION) {
-      Call(adaptor, code_target);
+      Call(adaptor, RelocInfo::CODE_TARGET);
       b(done);
     } else {
-      Jump(adaptor, code_target);
+      Jump(adaptor, RelocInfo::CODE_TARGET);
     }
     bind(&regular_invoke);
   }
@@ -363,7 +369,7 @@ void MacroAssembler::InvokeCode(Register code,
 void MacroAssembler::InvokeCode(Handle<Code> code,
                                 const ParameterCount& expected,
                                 const ParameterCount& actual,
-                                RelocMode rmode,
+                                RelocInfo::Mode rmode,
                                 InvokeFlag flag) {
   Label done;
 
@@ -603,13 +609,7 @@ void MacroAssembler::CheckAccessGlobal(Register holder_reg,
 
 void MacroAssembler::CallStub(CodeStub* stub) {
   ASSERT(allow_stub_calls());  // stub calls are not allowed in some stubs
-  Call(stub->GetCode(), code_target);
-}
-
-
-void MacroAssembler::CallJSExitStub(CodeStub* stub) {
-  ASSERT(allow_stub_calls());  // stub calls are not allowed in some stubs
-  Call(stub->GetCode(), exit_js_frame);
+  Call(stub->GetCode(), RelocInfo::CODE_TARGET);
 }
 
 
@@ -658,7 +658,7 @@ void MacroAssembler::JumpToBuiltin(const ExternalReference& builtin) {
 #endif
   mov(r1, Operand(builtin));
   CEntryStub stub;
-  Jump(stub.GetCode(), code_target);
+  Jump(stub.GetCode(), RelocInfo::CODE_TARGET);
 }
 
 
@@ -681,10 +681,10 @@ void MacroAssembler::InvokeBuiltin(Builtins::JavaScript id,
   Handle<Code> code = ResolveBuiltin(id, &resolved);
 
   if (flags == CALL_JS) {
-    Call(code, code_target);
+    Call(code, RelocInfo::CODE_TARGET);
   } else {
     ASSERT(flags == JUMP_JS);
-    Jump(code, code_target);
+    Jump(code, RelocInfo::CODE_TARGET);
   }
 
   if (!resolved) {
index 0af585d..2c40d8a 100644 (file)
@@ -77,15 +77,15 @@ class MacroAssembler: public Assembler {
 
   // Jump, Call, and Ret pseudo instructions implementing inter-working
  private:
-  void Jump(intptr_t target, RelocMode rmode, Condition cond = al);
-  void Call(intptr_t target, RelocMode rmode, Condition cond = al);
+  void Jump(intptr_t target, RelocInfo::Mode rmode, Condition cond = al);
+  void Call(intptr_t target, RelocInfo::Mode rmode, Condition cond = al);
  public:
   void Jump(Register target, Condition cond = al);
-  void Jump(byte* target, RelocMode rmode, Condition cond = al);
-  void Jump(Handle<Code> code, RelocMode rmode, Condition cond = al);
+  void Jump(byte* target, RelocInfo::Mode rmode, Condition cond = al);
+  void Jump(Handle<Code> code, RelocInfo::Mode rmode, Condition cond = al);
   void Call(Register target, Condition cond = al);
-  void Call(byte* target, RelocMode rmode, Condition cond = al);
-  void Call(Handle<Code> code, RelocMode rmode, Condition cond = al);
+  void Call(byte* target, RelocInfo::Mode rmode, Condition cond = al);
+  void Call(Handle<Code> code, RelocInfo::Mode rmode, Condition cond = al);
   void Ret();
 
   // Sets the remembered set bit for [address+offset], where address is the
@@ -114,7 +114,7 @@ class MacroAssembler: public Assembler {
   void InvokeCode(Handle<Code> code,
                   const ParameterCount& expected,
                   const ParameterCount& actual,
-                  RelocMode rmode,
+                  RelocInfo::Mode rmode,
                   InvokeFlag flag);
 
   // Invoke the JavaScript function in the given register. Changes the
index b59735a..d93cefb 100644 (file)
@@ -503,7 +503,7 @@ void MacroAssembler::NegativeZeroTest(Register result,
 
 void MacroAssembler::CallStub(CodeStub* stub) {
   ASSERT(allow_stub_calls());  // calls are not allowed in some stubs
-  call(stub->GetCode(), code_target);
+  call(stub->GetCode(), RelocInfo::CODE_TARGET);
 }
 
 
@@ -554,7 +554,7 @@ void MacroAssembler::JumpToBuiltin(const ExternalReference& ext) {
   // Set the entry point and jump to the C entry runtime stub.
   mov(Operand(ebx), Immediate(ext));
   CEntryStub ces;
-  jmp(ces.GetCode(), code_target);
+  jmp(ces.GetCode(), RelocInfo::CODE_TARGET);
 }
 
 
@@ -613,10 +613,10 @@ void MacroAssembler::InvokePrologue(const ParameterCount& expected,
     }
 
     if (flag == CALL_FUNCTION) {
-      call(adaptor, code_target);
+      call(adaptor, RelocInfo::CODE_TARGET);
       jmp(done);
     } else {
-      jmp(adaptor, code_target);
+      jmp(adaptor, RelocInfo::CODE_TARGET);
     }
     bind(&invoke);
   }
@@ -642,7 +642,7 @@ void MacroAssembler::InvokeCode(const Operand& code,
 void MacroAssembler::InvokeCode(Handle<Code> code,
                                 const ParameterCount& expected,
                                 const ParameterCount& actual,
-                                RelocMode rmode,
+                                RelocInfo::Mode rmode,
                                 InvokeFlag flag) {
   Label done;
   Operand dummy(eax);
@@ -683,7 +683,8 @@ void MacroAssembler::InvokeBuiltin(Builtins::JavaScript id, InvokeFlag flag) {
   // arguments match the expected number of arguments. Fake a
   // parameter count to avoid emitting code to do the check.
   ParameterCount expected(0);
-  InvokeCode(Handle<Code>(code), expected, expected, code_target, flag);
+  InvokeCode(Handle<Code>(code), expected, expected,
+             RelocInfo::CODE_TARGET, flag);
 
   const char* name = Builtins::GetName(id);
   int argc = Builtins::GetArgumentsCount(id);
index b3189c0..da7ce38 100644 (file)
@@ -104,7 +104,7 @@ class MacroAssembler: public Assembler {
   void InvokeCode(Handle<Code> code,
                   const ParameterCount& expected,
                   const ParameterCount& actual,
-                  RelocMode rmode,
+                  RelocInfo::Mode rmode,
                   InvokeFlag flag);
 
   // Invoke the JavaScript function in the given register. Changes the
index 9ab6ae6..e1937b8 100644 (file)
@@ -277,7 +277,7 @@ class MarkingVisitor : public ObjectVisitor {
   }
 
   void VisitCodeTarget(RelocInfo* rinfo) {
-    ASSERT(is_code_target(rinfo->rmode()));
+    ASSERT(RelocInfo::IsCodeTarget(rinfo->rmode()));
     Code* code = CodeFromDerivedPointer(rinfo->target_address());
     if (FLAG_cleanup_ics_at_gc && code->is_inline_cache_stub()) {
       IC::Clear(rinfo->pc());
@@ -294,7 +294,8 @@ class MarkingVisitor : public ObjectVisitor {
   }
 
   void VisitDebugTarget(RelocInfo* rinfo) {
-    ASSERT(is_js_return(rinfo->rmode()) && rinfo->is_call_instruction());
+    ASSERT(RelocInfo::IsJSReturn(rinfo->rmode()) &&
+           rinfo->is_call_instruction());
     HeapObject* code = CodeFromDerivedPointer(rinfo->call_address());
     MarkCompactCollector::MarkObject(code);
     // When compacting we convert the call to a real object pointer.
index dd656e0..af6ef7e 100644 (file)
@@ -607,7 +607,7 @@ void Code::CodeVerify() {
   for (RelocIterator it(this); !it.done(); it.next()) {
     it.rinfo()->Verify();
     // Ensure that GC will not iterate twice over the same pointer.
-    if (is_gc_reloc_mode(it.rinfo()->rmode())) {
+    if (RelocInfo::IsGCRelocMode(it.rinfo()->rmode())) {
       CHECK(it.rinfo()->pc() != last_gc_pc);
       last_gc_pc = it.rinfo()->pc();
     }
index fb202c2..5bc8604 100644 (file)
@@ -4004,13 +4004,13 @@ void ObjectVisitor::BeginCodeIteration(Code* code) {
 
 
 void ObjectVisitor::VisitCodeTarget(RelocInfo* rinfo) {
-  ASSERT(is_code_target(rinfo->rmode()));
+  ASSERT(RelocInfo::IsCodeTarget(rinfo->rmode()));
   VisitPointer(rinfo->target_object_address());
 }
 
 
 void ObjectVisitor::VisitDebugTarget(RelocInfo* rinfo) {
-  ASSERT(is_js_return(rinfo->rmode()) && rinfo->is_call_instruction());
+  ASSERT(RelocInfo::IsJSReturn(rinfo->rmode()) && rinfo->is_call_instruction());
   VisitPointer(rinfo->call_object_address());
 }
 
@@ -4031,7 +4031,9 @@ void Code::ConvertICTargetsFromAddressToObject() {
   }
 
   if (Debug::has_break_points()) {
-    for (RelocIterator it(this, RelocMask(js_return)); !it.done(); it.next()) {
+    for (RelocIterator it(this, RelocInfo::ModeMask(RelocInfo::JS_RETURN));
+         !it.done();
+         it.next()) {
       if (it.rinfo()->is_call_instruction()) {
         Address addr = it.rinfo()->call_address();
         ASSERT(addr != NULL);
@@ -4049,23 +4051,24 @@ void Code::CodeIterateBody(ObjectVisitor* v) {
   v->BeginCodeIteration(this);
 
   int mode_mask = RelocInfo::kCodeTargetMask |
-                  RelocMask(embedded_object) |
-                  RelocMask(external_reference) |
-                  RelocMask(js_return) |
-                  RelocMask(runtime_entry);
+                  RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT) |
+                  RelocInfo::ModeMask(RelocInfo::EXTERNAL_REFERENCE) |
+                  RelocInfo::ModeMask(RelocInfo::JS_RETURN) |
+                  RelocInfo::ModeMask(RelocInfo::RUNTIME_ENTRY);
 
   for (RelocIterator it(this, mode_mask); !it.done(); it.next()) {
-    RelocMode rmode = it.rinfo()->rmode();
-    if (rmode == embedded_object) {
+    RelocInfo::Mode rmode = it.rinfo()->rmode();
+    if (rmode == RelocInfo::EMBEDDED_OBJECT) {
       v->VisitPointer(it.rinfo()->target_object_address());
-    } else if (is_code_target(rmode)) {
+    } else if (RelocInfo::IsCodeTarget(rmode)) {
       v->VisitCodeTarget(it.rinfo());
-    } else if (rmode == external_reference) {
+    } else if (rmode == RelocInfo::EXTERNAL_REFERENCE) {
       v->VisitExternalReference(it.rinfo()->target_reference_address());
     } else if (Debug::has_break_points() &&
-               is_js_return(rmode) && it.rinfo()->is_call_instruction()) {
+               RelocInfo::IsJSReturn(rmode) &&
+               it.rinfo()->is_call_instruction()) {
       v->VisitDebugTarget(it.rinfo());
-    } else if (rmode == runtime_entry) {
+    } else if (rmode == RelocInfo::RUNTIME_ENTRY) {
       v->VisitRuntimeEntry(it.rinfo());
     }
   }
@@ -4090,7 +4093,9 @@ void Code::ConvertICTargetsFromObjectToAddress() {
   }
 
   if (Debug::has_break_points()) {
-    for (RelocIterator it(this, RelocMask(js_return)); !it.done(); it.next()) {
+    for (RelocIterator it(this, RelocInfo::ModeMask(RelocInfo::JS_RETURN));
+         !it.done();
+         it.next()) {
       if (it.rinfo()->is_call_instruction()) {
         Code* code = reinterpret_cast<Code*>(it.rinfo()->call_object());
         ASSERT((code != NULL) && code->IsHeapObject());
@@ -4130,14 +4135,14 @@ void Code::CopyFrom(const CodeDesc& desc) {
   // unbox handles and relocate
   int delta = instruction_start() - desc.buffer;
   int mode_mask = RelocInfo::kCodeTargetMask |
-                  RelocMask(embedded_object) |
+                  RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT) |
                   RelocInfo::kApplyMask;
   for (RelocIterator it(this, mode_mask); !it.done(); it.next()) {
-    RelocMode mode = it.rinfo()->rmode();
-    if (mode == embedded_object) {
+    RelocInfo::Mode mode = it.rinfo()->rmode();
+    if (mode == RelocInfo::EMBEDDED_OBJECT) {
       Object** p = reinterpret_cast<Object**>(it.rinfo()->target_object());
       it.rinfo()->set_target_object(*p);
-    } else if (is_code_target(mode)) {
+    } else if (RelocInfo::IsCodeTarget(mode)) {
       // rewrite code handles in inline cache targets to direct
       // pointers to the first instruction in the code object
       Object** p = reinterpret_cast<Object**>(it.rinfo()->target_object());
@@ -4157,7 +4162,7 @@ void Code::CopyFrom(const CodeDesc& desc) {
 // source for this function is found.
 int Code::SourcePosition(Address pc) {
   int distance = kMaxInt;
-  int position = kNoPosition;  // Initially no position found.
+  int position = RelocInfo::kNoPosition;  // Initially no position found.
   // Run through all the relocation info to find the best matching source
   // position. All the code needs to be considered as the sequence of the
   // instructions in the code does not necessarily follow the same order as the
@@ -4194,7 +4199,7 @@ int Code::SourceStatementPosition(Address pc) {
   int statement_position = 0;
   RelocIterator it(this, RelocInfo::kPositionMask);
   while (!it.done()) {
-    if (is_statement_position(it.rinfo()->rmode())) {
+    if (RelocInfo::IsStatementPosition(it.rinfo()->rmode())) {
       int p = it.rinfo()->data();
       if (statement_position < p && p <= position) {
         statement_position = p;
index b385f16..20f075d 100644 (file)
@@ -811,7 +811,7 @@ FunctionLiteral* Parser::ParseLazy(Handle<String> source,
 
     FunctionLiteralType type = is_expression ? EXPRESSION : DECLARATION;
     bool ok = true;
-    result = ParseFunctionLiteral(name, kNoPosition, type, &ok);
+    result = ParseFunctionLiteral(name, RelocInfo::kNoPosition, type, &ok);
     // Make sure the results agree.
     ASSERT(ok == (result != NULL));
     // The only errors should be stack overflows.
@@ -1148,7 +1148,7 @@ Statement* Parser::ParseNativeDeclaration(bool* ok) {
       NEW(FunctionBoilerplateLiteral(boilerplate));
   VariableProxy* var = Declare(name, Variable::VAR, NULL, true, CHECK_OK);
   return NEW(ExpressionStatement(
-                 new Assignment(Token::INIT_VAR, var, lit, kNoPosition)));
+      new Assignment(Token::INIT_VAR, var, lit, RelocInfo::kNoPosition)));
 }
 
 
@@ -2689,7 +2689,8 @@ Expression* Parser::ParseObjectLiteral(bool* ok) {
           if (peek() == Token::IDENTIFIER) {
             Handle<String> name = ParseIdentifier(CHECK_OK);
             FunctionLiteral* value =
-                ParseFunctionLiteral(name, kNoPosition, DECLARATION, CHECK_OK);
+                ParseFunctionLiteral(name, RelocInfo::kNoPosition,
+                                     DECLARATION, CHECK_OK);
             ObjectLiteral::Property* property =
                 NEW(ObjectLiteral::Property(is_getter, value));
             if (IsBoilerplateProperty(property))
@@ -2885,7 +2886,8 @@ FunctionLiteral* Parser::ParseFunctionLiteral(Handle<String> var_name,
       fproxy->BindTo(fvar);
       body.Add(new ExpressionStatement(
                    new Assignment(Token::INIT_VAR, fproxy,
-                                  NEW(ThisFunction()), kNoPosition)));
+                                  NEW(ThisFunction()),
+                                  RelocInfo::kNoPosition)));
     }
 
     // Determine if the function will be lazily compiled. The mode can
index 6954b23..ebbc383 100644 (file)
@@ -64,7 +64,8 @@ class Processor: public Visitor {
 
   Expression* SetResult(Expression* value) {
     result_assigned_ = true;
-    return new Assignment(Token::ASSIGN, result_, value, kNoPosition);
+    return new Assignment(Token::ASSIGN, result_, value,
+                          RelocInfo::kNoPosition);
   }
 
   // Node visitors.
index 44bfb3b..4179bc4 100644 (file)
@@ -3999,7 +3999,7 @@ static Object* Runtime_GetFrameDetails(Arguments args) {
                Smi::FromInt(info.NumberOfLocals()));
 
   // Add the source position.
-  if (position != kNoPosition) {
+  if (position != RelocInfo::kNoPosition) {
     details->set(kFrameDetailsSourcePositionIndex, Smi::FromInt(position));
   } else {
     details->set(kFrameDetailsSourcePositionIndex, Heap::undefined_value());
@@ -4146,7 +4146,7 @@ static Object* FindSharedFunctionInfoInScript(Handle<Script> script,
   // these functions.
   bool done = false;
   // The current candidate for the source position:
-  int target_start_position = kNoPosition;
+  int target_start_position = RelocInfo::kNoPosition;
   Handle<SharedFunctionInfo> target;
   // The current candidate for the last function in script:
   Handle<SharedFunctionInfo> last;
@@ -4161,7 +4161,7 @@ static Object* FindSharedFunctionInfoInScript(Handle<Script> script,
           // If the SharedFunctionInfo found has the requested script data and
           // contains the source position it is a candidate.
           int start_position = shared->function_token_position();
-          if (start_position == kNoPosition) {
+          if (start_position == RelocInfo::kNoPosition) {
             start_position = shared->start_position();
           }
           if (start_position <= position &&
index 88a6820..4f84bbb 100644 (file)
@@ -772,7 +772,7 @@ void Scope::AllocateParameterLocals() {
         var->rewrite_ =
           new Property(arguments_shadow_,
                        new Literal(Handle<Object>(Smi::FromInt(i))),
-                       kNoPosition);
+                       RelocInfo::kNoPosition);
         arguments_shadow->var_uses()->RecordUses(var->var_uses());
       }
     }
index e8f460c..d1aaceb 100644 (file)
@@ -1706,7 +1706,7 @@ static void EnterComment(const char* comment, int delta) {
 // with ']'.  RelocIterator 'it' must point to a comment reloc info.
 static void CollectCommentStatistics(RelocIterator* it) {
   ASSERT(!it->done());
-  ASSERT(it->rinfo()->rmode() == comment);
+  ASSERT(it->rinfo()->rmode() == RelocInfo::COMMENT);
   const char* tmp = reinterpret_cast<const char*>(it->rinfo()->data());
   if (tmp[0] != '[') {
     // Not a nested comment; skip
@@ -1723,7 +1723,7 @@ static void CollectCommentStatistics(RelocIterator* it) {
     // All nested comments must be terminated properly, and therefore exit
     // from loop.
     ASSERT(!it->done());
-    if (it->rinfo()->rmode() == comment) {
+    if (it->rinfo()->rmode() == RelocInfo::COMMENT) {
       const char* const txt =
           reinterpret_cast<const char*>(it->rinfo()->data());
       flat_delta += it->rinfo()->pc() - prev_pc;
@@ -1753,7 +1753,7 @@ void PagedSpace::CollectCodeStatistics() {
       int delta = 0;
       const byte* prev_pc = code->instruction_start();
       while (!it.done()) {
-        if (it.rinfo()->rmode() == comment) {
+        if (it.rinfo()->rmode() == RelocInfo::COMMENT) {
           delta += it.rinfo()->pc() - prev_pc;
           CollectCommentStatistics(&it);
           prev_pc = it.rinfo()->pc();
index a31ff2f..51cee7f 100644 (file)
@@ -232,7 +232,7 @@ Object* CallStubCompiler::CompileCallField(Object* object,
   // Handle call cache miss.
   __ bind(&miss);
   Handle<Code> ic = ComputeCallMiss(arguments().immediate());
-  __ Jump(ic, code_target);
+  __ Jump(ic, RelocInfo::CODE_TARGET);
 
   // Return the generated code.
   return GetCode(FIELD);
@@ -341,12 +341,13 @@ Object* CallStubCompiler::CompileCallConstant(Object* object,
   // Jump to the cached code (tail call).
   Handle<Code> code(function->code());
   ParameterCount expected(function->shared()->formal_parameter_count());
-  __ InvokeCode(code, expected, arguments(), code_target, JUMP_FUNCTION);
+  __ InvokeCode(code, expected, arguments(),
+                RelocInfo::CODE_TARGET, JUMP_FUNCTION);
 
   // Handle call cache miss.
   __ bind(&miss);
   Handle<Code> ic = ComputeCallMiss(arguments().immediate());
-  __ Jump(ic, code_target);
+  __ Jump(ic, RelocInfo::CODE_TARGET);
 
   // Return the generated code.
   return GetCode(CONSTANT_FUNCTION);
@@ -368,7 +369,7 @@ Object* CallStubCompiler::CompileCallInterceptor(Object* object,
   // Handle call cache miss.
   __ bind(&miss);
   Handle<Code> ic = ComputeCallMiss(arguments().immediate());
-  __ Jump(ic, code_target);
+  __ Jump(ic, RelocInfo::CODE_TARGET);
 
   // Return the generated code.
   return GetCode(INTERCEPTOR);
@@ -441,7 +442,7 @@ Object* StoreStubCompiler::CompileStoreField(JSObject* object,
   __ bind(&miss);
   __ mov(r2, Operand(Handle<String>(name)));  // restore name
   Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss));
-  __ Jump(ic, code_target);
+  __ Jump(ic, RelocInfo::CODE_TARGET);
 
   // Return the generated code.
   return GetCode(transition == NULL ? FIELD : MAP_TRANSITION);
@@ -498,7 +499,7 @@ Object* StoreStubCompiler::CompileStoreCallback(JSObject* object,
   __ bind(&miss);
   __ mov(r2, Operand(Handle<String>(name)));  // restore name
   Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss));
-  __ Jump(ic, code_target);
+  __ Jump(ic, RelocInfo::CODE_TARGET);
 
   // Return the generated code.
   return GetCode(CALLBACKS);
@@ -552,7 +553,7 @@ Object* StoreStubCompiler::CompileStoreInterceptor(JSObject* receiver,
   __ bind(&miss);
   __ mov(r2, Operand(Handle<String>(name)));  // restore name
   Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss));
-  __ Jump(ic, code_target);
+  __ Jump(ic, RelocInfo::CODE_TARGET);
 
   // Return the generated code.
   return GetCode(INTERCEPTOR);
@@ -592,7 +593,7 @@ Object* LoadStubCompiler::CompileLoadField(JSObject* object,
   __ bind(&miss);
   __ ldr(r0, MemOperand(sp));  // restore receiver
   Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Miss));
-  __ Jump(ic, code_target);
+  __ Jump(ic, RelocInfo::CODE_TARGET);
 
   // Return the generated code.
   return GetCode(FIELD);
@@ -634,7 +635,7 @@ Object* LoadStubCompiler::CompileLoadCallback(JSObject* object,
   // Handle load cache miss.
   __ bind(&miss);
   Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Miss));
-  __ Jump(ic, code_target);
+  __ Jump(ic, RelocInfo::CODE_TARGET);
 
   // Return the generated code.
   return GetCode(CALLBACKS);
@@ -668,7 +669,7 @@ Object* LoadStubCompiler::CompileLoadConstant(JSObject* object,
   // Handle load cache miss.
   __ bind(&miss);
   Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Miss));
-  __ Jump(ic, code_target);
+  __ Jump(ic, RelocInfo::CODE_TARGET);
 
   // Return the generated code.
   return GetCode(CONSTANT_FUNCTION);
@@ -708,7 +709,7 @@ Object* LoadStubCompiler::CompileLoadInterceptor(JSObject* object,
   // Handle load cache miss.
   __ bind(&miss);
   Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Miss));
-  __ Jump(ic, code_target);
+  __ Jump(ic, RelocInfo::CODE_TARGET);
 
   // Return the generated code.
   return GetCode(INTERCEPTOR);
index fb2ff11..e5301ba 100644 (file)
@@ -401,7 +401,7 @@ void StubCompiler::GenerateLoadMiss(MacroAssembler* masm, Code::Kind kind) {
   }
 
   Handle<Code> ic(code);
-  __ jmp(ic, code_target);
+  __ jmp(ic, RelocInfo::CODE_TARGET);
 }
 
 
@@ -526,7 +526,7 @@ Object* CallStubCompiler::CompileCallField(Object* object,
   // Handle call cache miss.
   __ bind(&miss);
   Handle<Code> ic = ComputeCallMiss(arguments().immediate());
-  __ jmp(ic, code_target);
+  __ jmp(ic, RelocInfo::CODE_TARGET);
 
   // Return the generated code.
   return GetCode(FIELD);
@@ -631,12 +631,13 @@ Object* CallStubCompiler::CompileCallConstant(Object* object,
   // Jump to the cached code (tail call).
   Handle<Code> code(function->code());
   ParameterCount expected(function->shared()->formal_parameter_count());
-  __ InvokeCode(code, expected, arguments(), code_target, JUMP_FUNCTION);
+  __ InvokeCode(code, expected, arguments(),
+                RelocInfo::CODE_TARGET, JUMP_FUNCTION);
 
   // Handle call cache miss.
   __ bind(&miss);
   Handle<Code> ic = ComputeCallMiss(arguments().immediate());
-  __ jmp(ic, code_target);
+  __ jmp(ic, RelocInfo::CODE_TARGET);
 
   // Return the generated code.
   return GetCode(CONSTANT_FUNCTION);
@@ -703,7 +704,7 @@ Object* CallStubCompiler::CompileCallInterceptor(Object* object,
   // Handle load cache miss.
   __ bind(&miss);
   Handle<Code> ic = ComputeCallMiss(argc);
-  __ jmp(ic, code_target);
+  __ jmp(ic, RelocInfo::CODE_TARGET);
 
   // Return the generated code.
   return GetCode(INTERCEPTOR);
@@ -734,7 +735,7 @@ Object* StoreStubCompiler::CompileStoreField(JSObject* object,
   __ bind(&miss);
   __ mov(Operand(ecx), Immediate(Handle<String>(name)));  // restore name
   Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss));
-  __ jmp(ic, code_target);
+  __ jmp(ic, RelocInfo::CODE_TARGET);
 
   // Return the generated code.
   return GetCode(transition == NULL ? FIELD : MAP_TRANSITION);
@@ -791,7 +792,7 @@ Object* StoreStubCompiler::CompileStoreCallback(JSObject* object,
   __ bind(&miss);
   __ mov(Operand(ecx), Immediate(Handle<String>(name)));  // restore name
   Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss));
-  __ jmp(ic, code_target);
+  __ jmp(ic, RelocInfo::CODE_TARGET);
 
   // Return the generated code.
   return GetCode(CALLBACKS);
@@ -846,7 +847,7 @@ Object* StoreStubCompiler::CompileStoreInterceptor(JSObject* receiver,
   __ bind(&miss);
   __ mov(Operand(ecx), Immediate(Handle<String>(name)));  // restore name
   Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss));
-  __ jmp(ic, code_target);
+  __ jmp(ic, RelocInfo::CODE_TARGET);
 
   // Return the generated code.
   return GetCode(INTERCEPTOR);
@@ -884,7 +885,7 @@ Object* KeyedStoreStubCompiler::CompileStoreField(JSObject* object,
   __ bind(&miss);
   __ DecrementCounter(&Counters::keyed_store_field, 1);
   Handle<Code> ic(Builtins::builtin(Builtins::KeyedStoreIC_Miss));
-  __ jmp(ic, code_target);
+  __ jmp(ic, RelocInfo::CODE_TARGET);
 
   // Return the generated code.
   return GetCode(transition == NULL ? FIELD : MAP_TRANSITION);
index 7097c64..2b68300 100644 (file)
@@ -139,7 +139,7 @@ TEST(AssemblerIa322) {
 
   // some relocated stuff here, not executed
   __ mov(eax, Factory::true_value());
-  __ jmp(NULL, runtime_entry);
+  __ jmp(NULL, RelocInfo::RUNTIME_ENTRY);
 
   CodeDesc desc;
   assm.GetCode(&desc);
@@ -228,7 +228,7 @@ TEST(AssemblerIa325) {
   v8::internal::byte buffer[256];
   Assembler assm(buffer, sizeof buffer);
 
-  __ mov(eax, Operand(reinterpret_cast<intptr_t>(&baz), no_reloc));
+  __ mov(eax, Operand(reinterpret_cast<intptr_t>(&baz), RelocInfo::NONE));
   __ ret(0);
 
   CodeDesc desc;
index 2720aa8..3b217db 100644 (file)
@@ -376,7 +376,7 @@ class TestBreakLocationIterator: public v8::internal::BreakLocationIterator {
 // location in the code is the expected debug_break function.
 void CheckDebugBreakFunction(DebugLocalContext* env,
                              const char* source, const char* name,
-                             int position, v8::internal::RelocMode mode,
+                             int position, v8::internal::RelocInfo::Mode mode,
                              Code* debug_break) {
   // Create function and set the break point.
   Handle<v8::internal::JSFunction> fun = v8::Utils::OpenHandle(
@@ -389,7 +389,7 @@ void CheckDebugBreakFunction(DebugLocalContext* env,
   TestBreakLocationIterator it1(Debug::GetDebugInfo(shared));
   it1.FindBreakLocationFromPosition(position);
   CHECK_EQ(mode, it1.it()->rinfo()->rmode());
-  if (mode != v8::internal::js_return) {
+  if (mode != v8::internal::RelocInfo::JS_RETURN) {
     CHECK_EQ(debug_break,
              Debug::GetCodeTarget(it1.it()->rinfo()->target_address()));
   } else {
@@ -406,7 +406,7 @@ void CheckDebugBreakFunction(DebugLocalContext* env,
   TestBreakLocationIterator it2(Debug::GetDebugInfo(shared));
   it2.FindBreakLocationFromPosition(position);
   CHECK_EQ(mode, it2.it()->rinfo()->rmode());
-  if (mode == v8::internal::js_return) {
+  if (mode == v8::internal::RelocInfo::JS_RETURN) {
     // TODO(1240753): Make the test architecture independent or split
     // parts of the debugger into architecture dependent files.
     CHECK_NE(0xE8, *(it2.rinfo()->pc()));
@@ -667,28 +667,25 @@ TEST(DebugStub) {
   v8::HandleScope scope;
   DebugLocalContext env;
 
-  // TODO(1240753): Make the test architecture independent or split
-  // parts of the debugger into architecture dependent files. This
-  // part currently disabled as it is not portable between IA32/ARM.
-  // Ia32 uses js_return ARM uses exit_js_frame.
-#if !defined (__arm__) && !defined(__thumb__)
   CheckDebugBreakFunction(&env,
                           "function f1(){}", "f1",
                           0,
-                          v8::internal::js_return,
+                          v8::internal::RelocInfo::JS_RETURN,
                           NULL);
-#endif
   CheckDebugBreakFunction(&env,
                           "function f2(){x=1;}", "f2",
                           0,
-                          v8::internal::code_target,
+                          v8::internal::RelocInfo::CODE_TARGET,
                           Builtins::builtin(Builtins::StoreIC_DebugBreak));
   CheckDebugBreakFunction(&env,
                           "function f3(){var a=x;}", "f3",
                           0,
-                          v8::internal::code_target_context,
+                          v8::internal::RelocInfo::CODE_TARGET_CONTEXT,
                           Builtins::builtin(Builtins::LoadIC_DebugBreak));
 
+// TODO(1240753): Make the test architecture independent or split
+// parts of the debugger into architecture dependent files. This
+// part currently disabled as it is not portable between IA32/ARM.
 // Currently on ICs for keyed store/load on ARM.
 #if !defined (__arm__) && !defined(__thumb__)
   CheckDebugBreakFunction(
@@ -696,14 +693,14 @@ TEST(DebugStub) {
       "function f4(){var index='propertyName'; var a={}; a[index] = 'x';}",
       "f4",
       0,
-      v8::internal::code_target,
+      v8::internal::RelocInfo::CODE_TARGET,
       Builtins::builtin(Builtins::KeyedStoreIC_DebugBreak));
   CheckDebugBreakFunction(
       &env,
       "function f5(){var index='propertyName'; var a={}; return a[index];}",
       "f5",
       0,
-      v8::internal::code_target,
+      v8::internal::RelocInfo::CODE_TARGET,
       Builtins::builtin(Builtins::KeyedLoadIC_DebugBreak));
 #endif
 
@@ -716,19 +713,19 @@ TEST(DebugStub) {
   CheckDebugBreakFunction(&env,
                           "function f4_0(){x();}", "f4_0",
                           0,
-                          v8::internal::code_target_context,
+                          v8::internal::RelocInfo::CODE_TARGET_CONTEXT,
                           *debug_break_0);
 
   CheckDebugBreakFunction(&env,
                           "function f4_1(){x(1);}", "f4_1",
                           0,
-                          v8::internal::code_target_context,
+                          v8::internal::RelocInfo::CODE_TARGET_CONTEXT,
                           *debug_break_1);
 
   CheckDebugBreakFunction(&env,
                           "function f4_4(){x(1,2,3,4);}", "f4_4",
                           0,
-                          v8::internal::code_target_context,
+                          v8::internal::RelocInfo::CODE_TARGET_CONTEXT,
                           *debug_break_4);
 }
 
index dee4dae..35a39b3 100644 (file)
@@ -78,7 +78,7 @@ TEST(DisasmIa320) {
 
   // ---- All instructions that I can think of
   __ add(edx, Operand(ebx));
-  __ add(edx, Operand(12, no_reloc));
+  __ add(edx, Operand(12, RelocInfo::NONE));
   __ add(edx, Operand(ebx, 0));
   __ add(edx, Operand(ebx, 16));
   __ add(edx, Operand(ebx, 1999));
@@ -259,9 +259,9 @@ TEST(DisasmIa320) {
   __ call(Operand(ebx, ecx, times_4, 10000));
   __ nop();
   Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Initialize));
-  __ call(ic, code_target);
+  __ call(ic, RelocInfo::CODE_TARGET);
   __ nop();
-  __ call(FUNCTION_ADDR(DummyStaticFunction), runtime_entry);
+  __ call(FUNCTION_ADDR(DummyStaticFunction), RelocInfo::RUNTIME_ENTRY);
   __ nop();
 
   __ jmp(&L1);
@@ -269,7 +269,7 @@ TEST(DisasmIa320) {
   ExternalReference after_break_target =
       ExternalReference(Debug_Address::AfterBreakTarget());
   __ jmp(Operand::StaticVariable(after_break_target));
-  __ jmp(ic, code_target);
+  __ jmp(ic, RelocInfo::CODE_TARGET);
   __ nop();