| 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 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 __ IncrementCounter(counters->megamorphic_stub_cache_misses(), 1, | 264 __ IncrementCounter(counters->megamorphic_stub_cache_misses(), 1, |
| 265 extra2, extra3); | 265 extra2, extra3); |
| 266 } | 266 } |
| 267 | 267 |
| 268 | 268 |
| 269 void StubCompiler::GenerateLoadGlobalFunctionPrototype(MacroAssembler* masm, | 269 void StubCompiler::GenerateLoadGlobalFunctionPrototype(MacroAssembler* masm, |
| 270 int index, | 270 int index, |
| 271 Register prototype) { | 271 Register prototype) { |
| 272 // Load the global or builtins object from the current context. | 272 // Load the global or builtins object from the current context. |
| 273 __ lw(prototype, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_INDEX))); | 273 __ lw(prototype, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_INDEX))); |
| 274 // Load the global context from the global or builtins object. | 274 // Load the native context from the global or builtins object. |
| 275 __ lw(prototype, | 275 __ lw(prototype, |
| 276 FieldMemOperand(prototype, GlobalObject::kGlobalContextOffset)); | 276 FieldMemOperand(prototype, GlobalObject::kNativeContextOffset)); |
| 277 // Load the function from the global context. | 277 // Load the function from the native context. |
| 278 __ lw(prototype, MemOperand(prototype, Context::SlotOffset(index))); | 278 __ lw(prototype, MemOperand(prototype, Context::SlotOffset(index))); |
| 279 // Load the initial map. The global functions all have initial maps. | 279 // Load the initial map. The global functions all have initial maps. |
| 280 __ lw(prototype, | 280 __ lw(prototype, |
| 281 FieldMemOperand(prototype, JSFunction::kPrototypeOrInitialMapOffset)); | 281 FieldMemOperand(prototype, JSFunction::kPrototypeOrInitialMapOffset)); |
| 282 // Load the prototype from the initial map. | 282 // Load the prototype from the initial map. |
| 283 __ lw(prototype, FieldMemOperand(prototype, Map::kPrototypeOffset)); | 283 __ lw(prototype, FieldMemOperand(prototype, Map::kPrototypeOffset)); |
| 284 } | 284 } |
| 285 | 285 |
| 286 | 286 |
| 287 void StubCompiler::GenerateDirectLoadGlobalFunctionPrototype( | 287 void StubCompiler::GenerateDirectLoadGlobalFunctionPrototype( |
| 288 MacroAssembler* masm, | 288 MacroAssembler* masm, |
| 289 int index, | 289 int index, |
| 290 Register prototype, | 290 Register prototype, |
| 291 Label* miss) { | 291 Label* miss) { |
| 292 Isolate* isolate = masm->isolate(); | 292 Isolate* isolate = masm->isolate(); |
| 293 // Check we're still in the same context. | 293 // Check we're still in the same context. |
| 294 __ lw(prototype, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_INDEX))); | 294 __ lw(prototype, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_INDEX))); |
| 295 ASSERT(!prototype.is(at)); | 295 ASSERT(!prototype.is(at)); |
| 296 __ li(at, isolate->global()); | 296 __ li(at, isolate->global()); |
| 297 __ Branch(miss, ne, prototype, Operand(at)); | 297 __ Branch(miss, ne, prototype, Operand(at)); |
| 298 // Get the global function with the given index. | 298 // Get the global function with the given index. |
| 299 Handle<JSFunction> function( | 299 Handle<JSFunction> function( |
| 300 JSFunction::cast(isolate->global_context()->get(index))); | 300 JSFunction::cast(isolate->native_context()->get(index))); |
| 301 // Load its initial map. The global functions all have initial maps. | 301 // Load its initial map. The global functions all have initial maps. |
| 302 __ li(prototype, Handle<Map>(function->initial_map())); | 302 __ li(prototype, Handle<Map>(function->initial_map())); |
| 303 // Load the prototype from the initial map. | 303 // Load the prototype from the initial map. |
| 304 __ lw(prototype, FieldMemOperand(prototype, Map::kPrototypeOffset)); | 304 __ lw(prototype, FieldMemOperand(prototype, Map::kPrototypeOffset)); |
| 305 } | 305 } |
| 306 | 306 |
| 307 | 307 |
| 308 // Load a fast property out of a holder object (src). In-object properties | 308 // Load a fast property out of a holder object (src). In-object properties |
| 309 // are loaded directly otherwise the property is loaded from the properties | 309 // are loaded directly otherwise the property is loaded from the properties |
| 310 // fixed array. | 310 // fixed array. |
| (...skipping 4475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4786 __ Jump(ic_slow, RelocInfo::CODE_TARGET); | 4786 __ Jump(ic_slow, RelocInfo::CODE_TARGET); |
| 4787 } | 4787 } |
| 4788 } | 4788 } |
| 4789 | 4789 |
| 4790 | 4790 |
| 4791 #undef __ | 4791 #undef __ |
| 4792 | 4792 |
| 4793 } } // namespace v8::internal | 4793 } } // namespace v8::internal |
| 4794 | 4794 |
| 4795 #endif // V8_TARGET_ARCH_MIPS | 4795 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |