Index: src/ia32/lithium-codegen-ia32.cc |
diff --git a/src/ia32/lithium-codegen-ia32.cc b/src/ia32/lithium-codegen-ia32.cc |
index 4b0a7b2e4e460e8f72a3cb30f376893c52964e7d..c231fe1151a912f5f17af597009ef918adbf7f20 100644 |
--- a/src/ia32/lithium-codegen-ia32.cc |
+++ b/src/ia32/lithium-codegen-ia32.cc |
@@ -447,8 +447,9 @@ bool LCodeGen::GenerateDeferredCode() { |
X87Stack copy(code->x87_stack()); |
x87_stack_ = copy; |
- int pos = instructions_->at(code->instruction_index())->position(); |
- RecordAndUpdatePosition(pos); |
+ HValue* value = |
+ instructions_->at(code->instruction_index())->hydrogen_value(); |
+ RecordAndWritePosition(value->position()); |
Comment(";;; <@%d,#%d> " |
"-------------------- Deferred %s --------------------", |
@@ -935,8 +936,6 @@ void LCodeGen::CallCodeGeneric(Handle<Code> code, |
LInstruction* instr, |
SafepointMode safepoint_mode) { |
ASSERT(instr != NULL); |
- LPointerMap* pointers = instr->pointer_map(); |
- RecordPosition(pointers->position()); |
__ call(code, mode); |
RecordSafepointWithLazyDeopt(instr, safepoint_mode); |
@@ -962,8 +961,6 @@ void LCodeGen::CallRuntime(const Runtime::Function* fun, |
SaveFPRegsMode save_doubles) { |
ASSERT(instr != NULL); |
ASSERT(instr->HasPointerMap()); |
- LPointerMap* pointers = instr->pointer_map(); |
- RecordPosition(pointers->position()); |
__ CallRuntime(fun, argc, save_doubles); |
@@ -1256,7 +1253,7 @@ void LCodeGen::RecordSafepoint(LPointerMap* pointers, |
void LCodeGen::RecordSafepoint(Safepoint::DeoptMode mode) { |
- LPointerMap empty_pointers(RelocInfo::kNoPosition, zone()); |
+ LPointerMap empty_pointers(zone()); |
RecordSafepoint(&empty_pointers, mode); |
} |
@@ -1268,17 +1265,10 @@ void LCodeGen::RecordSafepointWithRegisters(LPointerMap* pointers, |
} |
-void LCodeGen::RecordPosition(int position) { |
+void LCodeGen::RecordAndWritePosition(int position) { |
if (position == RelocInfo::kNoPosition) return; |
masm()->positions_recorder()->RecordPosition(position); |
-} |
- |
- |
-void LCodeGen::RecordAndUpdatePosition(int position) { |
- if (position >= 0 && position != old_position_) { |
- masm()->positions_recorder()->RecordPosition(position); |
- old_position_ = position; |
- } |
+ masm()->positions_recorder()->WriteRecordedPositions(); |
} |
@@ -3689,7 +3679,6 @@ void LCodeGen::DoApplyArguments(LApplyArguments* instr) { |
__ bind(&invoke); |
ASSERT(instr->HasPointerMap()); |
LPointerMap* pointers = instr->pointer_map(); |
- RecordPosition(pointers->position()); |
SafepointGenerator safepoint_generator( |
this, pointers, Safepoint::kLazyDeopt); |
ParameterCount actual(eax); |
@@ -3774,9 +3763,6 @@ void LCodeGen::CallKnownFunction(Handle<JSFunction> function, |
bool can_invoke_directly = |
dont_adapt_arguments || formal_parameter_count == arity; |
- LPointerMap* pointers = instr->pointer_map(); |
- RecordPosition(pointers->position()); |
- |
if (can_invoke_directly) { |
if (edi_state == EDI_UNINITIALIZED) { |
__ LoadHeapObject(edi, function); |
@@ -3801,6 +3787,7 @@ void LCodeGen::CallKnownFunction(Handle<JSFunction> function, |
RecordSafepointWithLazyDeopt(instr, RECORD_SIMPLE_SAFEPOINT); |
} else { |
// We need to adapt arguments. |
+ LPointerMap* pointers = instr->pointer_map(); |
SafepointGenerator generator( |
this, pointers, Safepoint::kLazyDeopt); |
ParameterCount count(arity); |
@@ -4269,7 +4256,6 @@ void LCodeGen::DoInvokeFunction(LInvokeFunction* instr) { |
Handle<JSFunction> known_function = instr->hydrogen()->known_function(); |
if (known_function.is_null()) { |
LPointerMap* pointers = instr->pointer_map(); |
- RecordPosition(pointers->position()); |
SafepointGenerator generator( |
this, pointers, Safepoint::kLazyDeopt); |
ParameterCount count(instr->arity()); |