| 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 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 __ IncrementCounter(counters->megamorphic_stub_cache_misses(), 1, | 277 __ IncrementCounter(counters->megamorphic_stub_cache_misses(), 1, |
| 278 extra2, extra3); | 278 extra2, extra3); |
| 279 } | 279 } |
| 280 | 280 |
| 281 | 281 |
| 282 void StubCompiler::GenerateLoadGlobalFunctionPrototype(MacroAssembler* masm, | 282 void StubCompiler::GenerateLoadGlobalFunctionPrototype(MacroAssembler* masm, |
| 283 int index, | 283 int index, |
| 284 Register prototype) { | 284 Register prototype) { |
| 285 // Load the global or builtins object from the current context. | 285 // Load the global or builtins object from the current context. |
| 286 __ ldr(prototype, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_INDEX))); | 286 __ ldr(prototype, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_INDEX))); |
| 287 // Load the global context from the global or builtins object. | 287 // Load the native context from the global or builtins object. |
| 288 __ ldr(prototype, | 288 __ ldr(prototype, |
| 289 FieldMemOperand(prototype, GlobalObject::kGlobalContextOffset)); | 289 FieldMemOperand(prototype, GlobalObject::kNativeContextOffset)); |
| 290 // Load the function from the global context. | 290 // Load the function from the native context. |
| 291 __ ldr(prototype, MemOperand(prototype, Context::SlotOffset(index))); | 291 __ ldr(prototype, MemOperand(prototype, Context::SlotOffset(index))); |
| 292 // Load the initial map. The global functions all have initial maps. | 292 // Load the initial map. The global functions all have initial maps. |
| 293 __ ldr(prototype, | 293 __ ldr(prototype, |
| 294 FieldMemOperand(prototype, JSFunction::kPrototypeOrInitialMapOffset)); | 294 FieldMemOperand(prototype, JSFunction::kPrototypeOrInitialMapOffset)); |
| 295 // Load the prototype from the initial map. | 295 // Load the prototype from the initial map. |
| 296 __ ldr(prototype, FieldMemOperand(prototype, Map::kPrototypeOffset)); | 296 __ ldr(prototype, FieldMemOperand(prototype, Map::kPrototypeOffset)); |
| 297 } | 297 } |
| 298 | 298 |
| 299 | 299 |
| 300 void StubCompiler::GenerateDirectLoadGlobalFunctionPrototype( | 300 void StubCompiler::GenerateDirectLoadGlobalFunctionPrototype( |
| 301 MacroAssembler* masm, | 301 MacroAssembler* masm, |
| 302 int index, | 302 int index, |
| 303 Register prototype, | 303 Register prototype, |
| 304 Label* miss) { | 304 Label* miss) { |
| 305 Isolate* isolate = masm->isolate(); | 305 Isolate* isolate = masm->isolate(); |
| 306 // Check we're still in the same context. | 306 // Check we're still in the same context. |
| 307 __ ldr(prototype, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_INDEX))); | 307 __ ldr(prototype, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_INDEX))); |
| 308 __ Move(ip, isolate->global()); | 308 __ Move(ip, isolate->global()); |
| 309 __ cmp(prototype, ip); | 309 __ cmp(prototype, ip); |
| 310 __ b(ne, miss); | 310 __ b(ne, miss); |
| 311 // Get the global function with the given index. | 311 // Get the global function with the given index. |
| 312 Handle<JSFunction> function( | 312 Handle<JSFunction> function( |
| 313 JSFunction::cast(isolate->global_context()->get(index))); | 313 JSFunction::cast(isolate->native_context()->get(index))); |
| 314 // Load its initial map. The global functions all have initial maps. | 314 // Load its initial map. The global functions all have initial maps. |
| 315 __ Move(prototype, Handle<Map>(function->initial_map())); | 315 __ Move(prototype, Handle<Map>(function->initial_map())); |
| 316 // Load the prototype from the initial map. | 316 // Load the prototype from the initial map. |
| 317 __ ldr(prototype, FieldMemOperand(prototype, Map::kPrototypeOffset)); | 317 __ ldr(prototype, FieldMemOperand(prototype, Map::kPrototypeOffset)); |
| 318 } | 318 } |
| 319 | 319 |
| 320 | 320 |
| 321 // Load a fast property out of a holder object (src). In-object properties | 321 // Load a fast property out of a holder object (src). In-object properties |
| 322 // are loaded directly otherwise the property is loaded from the properties | 322 // are loaded directly otherwise the property is loaded from the properties |
| 323 // fixed array. | 323 // fixed array. |
| (...skipping 4401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4725 __ Jump(ic_slow, RelocInfo::CODE_TARGET); | 4725 __ Jump(ic_slow, RelocInfo::CODE_TARGET); |
| 4726 } | 4726 } |
| 4727 } | 4727 } |
| 4728 | 4728 |
| 4729 | 4729 |
| 4730 #undef __ | 4730 #undef __ |
| 4731 | 4731 |
| 4732 } } // namespace v8::internal | 4732 } } // namespace v8::internal |
| 4733 | 4733 |
| 4734 #endif // V8_TARGET_ARCH_ARM | 4734 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |