OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 __ lw(prototype, FieldMemOperand(prototype, Map::kPrototypeOffset)); | 280 __ lw(prototype, FieldMemOperand(prototype, Map::kPrototypeOffset)); |
281 } | 281 } |
282 | 282 |
283 | 283 |
284 void StubCompiler::GenerateDirectLoadGlobalFunctionPrototype( | 284 void StubCompiler::GenerateDirectLoadGlobalFunctionPrototype( |
285 MacroAssembler* masm, | 285 MacroAssembler* masm, |
286 int index, | 286 int index, |
287 Register prototype, | 287 Register prototype, |
288 Label* miss) { | 288 Label* miss) { |
289 Isolate* isolate = masm->isolate(); | 289 Isolate* isolate = masm->isolate(); |
290 // Check we're still in the same context. | |
291 __ lw(prototype, | |
292 MemOperand(cp, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); | |
293 ASSERT(!prototype.is(at)); | |
294 __ li(at, isolate->global_object()); | |
295 __ Branch(miss, ne, prototype, Operand(at)); | |
296 // Get the global function with the given index. | 290 // Get the global function with the given index. |
297 Handle<JSFunction> function( | 291 Handle<JSFunction> function( |
298 JSFunction::cast(isolate->native_context()->get(index))); | 292 JSFunction::cast(isolate->native_context()->get(index))); |
| 293 |
| 294 // Check we're still in the same context. |
| 295 Register scratch = prototype; |
| 296 const int offset = Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX); |
| 297 __ lw(scratch, MemOperand(cp, offset)); |
| 298 __ lw(scratch, FieldMemOperand(scratch, GlobalObject::kNativeContextOffset)); |
| 299 __ lw(scratch, MemOperand(scratch, Context::SlotOffset(index))); |
| 300 __ li(at, function); |
| 301 __ Branch(miss, ne, at, Operand(scratch)); |
| 302 |
299 // Load its initial map. The global functions all have initial maps. | 303 // Load its initial map. The global functions all have initial maps. |
300 __ li(prototype, Handle<Map>(function->initial_map())); | 304 __ li(prototype, Handle<Map>(function->initial_map())); |
301 // Load the prototype from the initial map. | 305 // Load the prototype from the initial map. |
302 __ lw(prototype, FieldMemOperand(prototype, Map::kPrototypeOffset)); | 306 __ lw(prototype, FieldMemOperand(prototype, Map::kPrototypeOffset)); |
303 } | 307 } |
304 | 308 |
305 | 309 |
306 void StubCompiler::GenerateFastPropertyLoad(MacroAssembler* masm, | 310 void StubCompiler::GenerateFastPropertyLoad(MacroAssembler* masm, |
307 Register dst, | 311 Register dst, |
308 Register src, | 312 Register src, |
(...skipping 1642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1951 // ----------------------------------- | 1955 // ----------------------------------- |
1952 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); | 1956 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); |
1953 } | 1957 } |
1954 | 1958 |
1955 | 1959 |
1956 #undef __ | 1960 #undef __ |
1957 | 1961 |
1958 } } // namespace v8::internal | 1962 } } // namespace v8::internal |
1959 | 1963 |
1960 #endif // V8_TARGET_ARCH_MIPS | 1964 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |