Index: src/arm/stub-cache-arm.cc |
=================================================================== |
--- src/arm/stub-cache-arm.cc (revision 5484) |
+++ src/arm/stub-cache-arm.cc (working copy) |
@@ -266,7 +266,12 @@ |
void StubCompiler::GenerateDirectLoadGlobalFunctionPrototype( |
- MacroAssembler* masm, int index, Register prototype) { |
+ MacroAssembler* masm, int index, Register prototype, Label* miss) { |
+ // Check we're still in the same context. |
+ __ ldr(prototype, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_INDEX))); |
+ __ Move(ip, Top::global()); |
+ __ cmp(prototype, ip); |
+ __ b(ne, miss); |
// Get the global function with the given index. |
JSFunction* function = JSFunction::cast(Top::global_context()->get(index)); |
// Load its initial map. The global functions all have initial maps. |
@@ -1494,7 +1499,7 @@ |
__ b(hs, &miss); |
// Check that the maps starting from the prototype haven't changed. |
GenerateDirectLoadGlobalFunctionPrototype( |
- masm(), Context::STRING_FUNCTION_INDEX, r0); |
+ masm(), Context::STRING_FUNCTION_INDEX, r0, &miss); |
CheckPrototypes(JSObject::cast(object->GetPrototype()), r0, holder, r3, |
r1, r4, name, &miss); |
} |
@@ -1514,7 +1519,7 @@ |
__ bind(&fast); |
// Check that the maps starting from the prototype haven't changed. |
GenerateDirectLoadGlobalFunctionPrototype( |
- masm(), Context::NUMBER_FUNCTION_INDEX, r0); |
+ masm(), Context::NUMBER_FUNCTION_INDEX, r0, &miss); |
CheckPrototypes(JSObject::cast(object->GetPrototype()), r0, holder, r3, |
r1, r4, name, &miss); |
} |
@@ -1537,7 +1542,7 @@ |
__ bind(&fast); |
// Check that the maps starting from the prototype haven't changed. |
GenerateDirectLoadGlobalFunctionPrototype( |
- masm(), Context::BOOLEAN_FUNCTION_INDEX, r0); |
+ masm(), Context::BOOLEAN_FUNCTION_INDEX, r0, &miss); |
CheckPrototypes(JSObject::cast(object->GetPrototype()), r0, holder, r3, |
r1, r4, name, &miss); |
} |