Commit d9195153 authored by palfia@homejinni.com's avatar palfia@homejinni.com

MIPS: Track heap objects.

Port r14625 (bfb25ed8)

BUG=

Review URL: https://codereview.chromium.org/15102002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14628 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 4e1acaa6
...@@ -3911,6 +3911,12 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { ...@@ -3911,6 +3911,12 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) {
if (!instr->hydrogen()->value()->range()->IsInSmiRange()) { if (!instr->hydrogen()->value()->range()->IsInSmiRange()) {
DeoptimizeIf(lt, instr->environment(), scratch, Operand(zero_reg)); DeoptimizeIf(lt, instr->environment(), scratch, Operand(zero_reg));
} }
} else if (FLAG_track_heap_object_fields && representation.IsHeapObject()) {
Register value = ToRegister(instr->value());
if (!instr->hydrogen()->value()->type().IsHeapObject()) {
__ And(scratch, value, Operand(kSmiTagMask));
DeoptimizeIf(eq, instr->environment(), scratch, Operand(zero_reg));
}
} else if (FLAG_track_double_fields && representation.IsDouble()) { } else if (FLAG_track_double_fields && representation.IsDouble()) {
ASSERT(transition.is_null()); ASSERT(transition.is_null());
ASSERT(instr->is_in_object()); ASSERT(instr->is_in_object());
......
...@@ -2209,7 +2209,9 @@ LInstruction* LChunkBuilder::DoStoreNamedField(HStoreNamedField* instr) { ...@@ -2209,7 +2209,9 @@ LInstruction* LChunkBuilder::DoStoreNamedField(HStoreNamedField* instr) {
LOperand* temp = needs_write_barrier_for_map ? TempRegister() : NULL; LOperand* temp = needs_write_barrier_for_map ? TempRegister() : NULL;
LStoreNamedField* result = new(zone()) LStoreNamedField(obj, val, temp); LStoreNamedField* result = new(zone()) LStoreNamedField(obj, val, temp);
if (FLAG_track_fields && instr->field_representation().IsSmi()) { if ((FLAG_track_fields && instr->field_representation().IsSmi()) ||
(FLAG_track_heap_object_fields &&
instr->field_representation().IsHeapObject())) {
return AssignEnvironment(result); return AssignEnvironment(result);
} }
return result; return result;
......
...@@ -507,6 +507,8 @@ void StubCompiler::GenerateStoreTransition(MacroAssembler* masm, ...@@ -507,6 +507,8 @@ void StubCompiler::GenerateStoreTransition(MacroAssembler* masm,
if (FLAG_track_fields && representation.IsSmi()) { if (FLAG_track_fields && representation.IsSmi()) {
__ JumpIfNotSmi(value_reg, miss_restore_name); __ JumpIfNotSmi(value_reg, miss_restore_name);
} else if (FLAG_track_heap_object_fields && representation.IsHeapObject()) {
__ JumpIfSmi(value_reg, miss_restore_name);
} else if (FLAG_track_double_fields && representation.IsDouble()) { } else if (FLAG_track_double_fields && representation.IsDouble()) {
Label do_store, heap_number; Label do_store, heap_number;
__ LoadRoot(scratch3, Heap::kHeapNumberMapRootIndex); __ LoadRoot(scratch3, Heap::kHeapNumberMapRootIndex);
...@@ -677,6 +679,8 @@ void StubCompiler::GenerateStoreField(MacroAssembler* masm, ...@@ -677,6 +679,8 @@ void StubCompiler::GenerateStoreField(MacroAssembler* masm,
ASSERT(!representation.IsNone()); ASSERT(!representation.IsNone());
if (FLAG_track_fields && representation.IsSmi()) { if (FLAG_track_fields && representation.IsSmi()) {
__ JumpIfNotSmi(value_reg, miss_label); __ JumpIfNotSmi(value_reg, miss_label);
} else if (FLAG_track_heap_object_fields && representation.IsHeapObject()) {
__ JumpIfSmi(value_reg, miss_label);
} else if (FLAG_track_double_fields && representation.IsDouble()) { } else if (FLAG_track_double_fields && representation.IsDouble()) {
// Load the double storage. // Load the double storage.
if (index < 0) { if (index < 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment