Index: src/arm/fast-codegen-arm.cc |
=================================================================== |
--- src/arm/fast-codegen-arm.cc (revision 3095) |
+++ src/arm/fast-codegen-arm.cc (working copy) |
@@ -139,11 +139,27 @@ |
void FastCodeGenerator::VisitVariableProxy(VariableProxy* expr) { |
Comment cmnt(masm_, "[ VariableProxy"); |
Expression* rewrite = expr->var()->rewrite(); |
- ASSERT(rewrite != NULL); |
+ if (rewrite == NULL) { |
fschneider
2009/10/20 14:16:17
Insert a comment here:
Comment cmnt(masm_, "[Load
|
+ // Reference to a 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())); |
+ Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Initialize)); |
+ __ Call(ic, RelocInfo::CODE_TARGET_CONTEXT); |
+ if (expr->location().is_temporary()) { |
+ // Replace the global object with the result. |
+ __ str(r0, MemOperand(sp)); |
+ } else { |
+ ASSERT(expr->location().is_nowhere()); |
+ __ pop(); |
+ } |
- Slot* slot = rewrite->AsSlot(); |
- ASSERT(slot != NULL); |
- { Comment cmnt(masm_, "[ Slot"); |
+ } else { |
+ // Reference to a local or parameter slot. |
+ Comment cmnt(masm_, "[ Slot"); |
+ Slot* slot = rewrite->AsSlot(); |
+ ASSERT(slot != NULL); |
if (expr->location().is_temporary()) { |
__ ldr(ip, MemOperand(fp, SlotOffset(slot))); |
__ push(ip); |