Index: src/ic/mips/handler-compiler-mips.cc |
diff --git a/src/ic/mips/handler-compiler-mips.cc b/src/ic/mips/handler-compiler-mips.cc |
index 8a7b6aa8229ae38bdd851ee828d8b02ba2ce10bf..1e61ade0c062a8974acf95698e0de9212a6d5dbd 100644 |
--- a/src/ic/mips/handler-compiler-mips.cc |
+++ b/src/ic/mips/handler-compiler-mips.cc |
@@ -138,25 +138,16 @@ void PropertyHandlerCompiler::GenerateDictionaryNegativeLookup( |
void NamedLoadHandlerCompiler::GenerateDirectLoadGlobalFunctionPrototype( |
- MacroAssembler* masm, int index, Register prototype, Label* miss) { |
- Isolate* isolate = masm->isolate(); |
- // Get the global function with the given index. |
- Handle<JSFunction> function( |
- JSFunction::cast(isolate->native_context()->get(index))); |
- |
- // Check we're still in the same context. |
- Register scratch = prototype; |
+ MacroAssembler* masm, int index, Register result, Label* miss) { |
const int offset = Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX); |
- __ lw(scratch, MemOperand(cp, offset)); |
- __ lw(scratch, FieldMemOperand(scratch, GlobalObject::kNativeContextOffset)); |
- __ lw(scratch, MemOperand(scratch, Context::SlotOffset(index))); |
- __ li(at, function); |
- __ Branch(miss, ne, at, Operand(scratch)); |
- |
+ __ lw(result, MemOperand(cp, offset)); |
+ __ lw(result, FieldMemOperand(result, GlobalObject::kNativeContextOffset)); |
+ __ lw(result, MemOperand(result, Context::SlotOffset(index))); |
// Load its initial map. The global functions all have initial maps. |
- __ li(prototype, Handle<Map>(function->initial_map())); |
+ __ lw(result, |
+ FieldMemOperand(result, JSFunction::kPrototypeOrInitialMapOffset)); |
// Load the prototype from the initial map. |
- __ lw(prototype, FieldMemOperand(prototype, Map::kPrototypeOffset)); |
+ __ lw(result, FieldMemOperand(result, Map::kPrototypeOffset)); |
} |