Index: src/ic/mips64/handler-compiler-mips64.cc |
diff --git a/src/ic/mips64/handler-compiler-mips64.cc b/src/ic/mips64/handler-compiler-mips64.cc |
index a4abca2f08d94d6ece87eb93287519db7f8f2562..1f8635cf4cb37bff9e6dbc4f46631c4e61e9a5ac 100644 |
--- a/src/ic/mips64/handler-compiler-mips64.cc |
+++ b/src/ic/mips64/handler-compiler-mips64.cc |
@@ -167,7 +167,11 @@ |
void NamedLoadHandlerCompiler::GenerateDirectLoadGlobalFunctionPrototype( |
MacroAssembler* masm, int index, Register result, Label* miss) { |
- __ LoadNativeContextSlot(index, result); |
+ // Check we're still in the same context. |
+ const int offset = Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX); |
+ __ ld(result, MemOperand(cp, offset)); |
+ __ ld(result, FieldMemOperand(result, JSGlobalObject::kNativeContextOffset)); |
+ __ ld(result, MemOperand(result, Context::SlotOffset(index))); |
// Load its initial map. The global functions all have initial maps. |
__ ld(result, |
FieldMemOperand(result, JSFunction::kPrototypeOrInitialMapOffset)); |