Index: src/ia32/full-codegen-ia32.cc |
diff --git a/src/ia32/full-codegen-ia32.cc b/src/ia32/full-codegen-ia32.cc |
index 75cc4b8608deb679284b68e3a86ece92b3f012a4..c0d7e7c6d1492ca683f85e8ca7e0a5e6c5586898 100644 |
--- a/src/ia32/full-codegen-ia32.cc |
+++ b/src/ia32/full-codegen-ia32.cc |
@@ -744,7 +744,7 @@ void FullCodeGenerator::EmitDeclaration(Variable* variable, |
// IDs for bailouts from optimized code. |
ASSERT(prop->obj()->AsVariableProxy() != NULL); |
{ AccumulatorValueContext for_object(this); |
- EmitVariableLoad(prop->obj()->AsVariableProxy()->var()); |
+ EmitVariableLoad(prop->obj()->AsVariableProxy()); |
} |
__ push(eax); |
@@ -1064,7 +1064,7 @@ void FullCodeGenerator::EmitNewClosure(Handle<SharedFunctionInfo> info, |
void FullCodeGenerator::VisitVariableProxy(VariableProxy* expr) { |
Comment cmnt(masm_, "[ VariableProxy"); |
- EmitVariableLoad(expr->var()); |
+ EmitVariableLoad(expr); |
} |
@@ -1214,7 +1214,11 @@ void FullCodeGenerator::EmitDynamicLoadFromSlotFastCase( |
} |
-void FullCodeGenerator::EmitVariableLoad(Variable* var) { |
+void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy) { |
+ // Record position before possible IC call. |
+ SetSourcePosition(proxy->position()); |
+ Variable* var = proxy->var(); |
+ |
// Three cases: non-this global variables, lookup slots, and all other |
// types of slots. |
Slot* slot = var->AsSlot(); |
@@ -1540,7 +1544,7 @@ void FullCodeGenerator::VisitAssignment(Assignment* expr) { |
{ AccumulatorValueContext context(this); |
switch (assign_type) { |
case VARIABLE: |
- EmitVariableLoad(expr->target()->AsVariableProxy()->var()); |
+ EmitVariableLoad(expr->target()->AsVariableProxy()); |
PrepareForBailout(expr->target(), TOS_REG); |
break; |
case NAMED_PROPERTY: |
@@ -1769,7 +1773,7 @@ void FullCodeGenerator::EmitAssignment(Expression* expr, int bailout_ast_id) { |
ASSERT(prop->obj()->AsVariableProxy() != NULL); |
ASSERT(prop->key()->AsLiteral() != NULL); |
{ AccumulatorValueContext for_object(this); |
- EmitVariableLoad(prop->obj()->AsVariableProxy()->var()); |
+ EmitVariableLoad(prop->obj()->AsVariableProxy()); |
} |
__ mov(edx, eax); |
__ SafeSet(ecx, Immediate(prop->key()->AsLiteral()->handle())); |
@@ -3768,7 +3772,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { |
if (assign_type == VARIABLE) { |
ASSERT(expr->expression()->AsVariableProxy()->var() != NULL); |
AccumulatorValueContext context(this); |
- EmitVariableLoad(expr->expression()->AsVariableProxy()->var()); |
+ EmitVariableLoad(expr->expression()->AsVariableProxy()); |
} else { |
// Reserve space for result of postfix operation. |
if (expr->is_postfix() && !context()->IsEffect()) { |