Index: src/arm/fast-codegen-arm.cc |
=================================================================== |
--- src/arm/fast-codegen-arm.cc (revision 3445) |
+++ src/arm/fast-codegen-arm.cc (working copy) |
@@ -556,18 +556,24 @@ |
void FastCodeGenerator::VisitVariableProxy(VariableProxy* expr) { |
Comment cmnt(masm_, "[ VariableProxy"); |
- Expression* rewrite = expr->var()->rewrite(); |
+ EmitVariableLoad(expr->var(), expr->context()); |
+} |
+ |
+ |
+void FastCodeGenerator::EmitVariableLoad(Variable* var, |
+ Expression::Context context) { |
+ Expression* rewrite = var->rewrite(); |
if (rewrite == NULL) { |
- ASSERT(expr->var()->is_global()); |
+ ASSERT(var->is_global()); |
Comment cmnt(masm_, "Global variable"); |
// Use inline caching. Variable name is passed in r2 and the global |
// object on the stack. |
__ ldr(ip, CodeGenerator::GlobalObject()); |
__ push(ip); |
- __ mov(r2, Operand(expr->name())); |
+ __ mov(r2, Operand(var->name())); |
Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Initialize)); |
__ Call(ic, RelocInfo::CODE_TARGET_CONTEXT); |
- DropAndMove(expr->context(), r0); |
+ DropAndMove(context, r0); |
} else if (rewrite->AsSlot() != NULL) { |
Slot* slot = rewrite->AsSlot(); |
if (FLAG_debug_code) { |
@@ -588,7 +594,7 @@ |
UNREACHABLE(); |
} |
} |
- Move(expr->context(), slot, r0); |
+ Move(context, slot, r0); |
} else { |
// A variable has been rewritten into an explicit access to |
// an object property. |
@@ -623,7 +629,7 @@ |
__ Call(ic, RelocInfo::CODE_TARGET); |
// Drop key and object left on the stack by IC, and push the result. |
- DropAndMove(expr->context(), r0, 2); |
+ DropAndMove(context, r0, 2); |
} |
} |
@@ -846,6 +852,34 @@ |
} |
+void FastCodeGenerator::EmitNamedPropertyLoad(Property* prop, |
+ Expression::Context context) { |
+ Literal* key = prop->key()->AsLiteral(); |
+ __ mov(r2, Operand(key->handle())); |
+ Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Initialize)); |
+ __ Call(ic, RelocInfo::CODE_TARGET); |
+ Move(context, r0); |
+} |
+ |
+ |
+void FastCodeGenerator::EmitKeyedPropertyLoad(Expression::Context context) { |
+ Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize)); |
+ __ Call(ic, RelocInfo::CODE_TARGET); |
+ Move(context, r0); |
+} |
+ |
+ |
+void FastCodeGenerator::EmitCompoundAssignmentOp(Token::Value op, |
+ Expression::Context context) { |
+ __ pop(r0); |
+ __ pop(r1); |
+ GenericBinaryOpStub stub(op, |
+ NO_OVERWRITE); |
+ __ CallStub(&stub); |
+ Move(context, r0); |
+} |
+ |
+ |
void FastCodeGenerator::EmitVariableAssignment(Assignment* expr) { |
Variable* var = expr->target()->AsVariableProxy()->AsVariable(); |
ASSERT(var != NULL); |