OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_ARM64 | 7 #if V8_TARGET_ARCH_ARM64 |
8 | 8 |
9 #include "src/ic/call-optimization.h" | 9 #include "src/ic/call-optimization.h" |
10 #include "src/ic/handler-compiler.h" | 10 #include "src/ic/handler-compiler.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 __ JumpIfNotRoot(map, Heap::kHashTableMapRootIndex, miss_label); | 50 __ JumpIfNotRoot(map, Heap::kHashTableMapRootIndex, miss_label); |
51 | 51 |
52 NameDictionaryLookupStub::GenerateNegativeLookup( | 52 NameDictionaryLookupStub::GenerateNegativeLookup( |
53 masm, miss_label, &done, receiver, properties, name, scratch1); | 53 masm, miss_label, &done, receiver, properties, name, scratch1); |
54 __ Bind(&done); | 54 __ Bind(&done); |
55 __ DecrementCounter(counters->negative_lookups_miss(), 1, scratch0, scratch1); | 55 __ DecrementCounter(counters->negative_lookups_miss(), 1, scratch0, scratch1); |
56 } | 56 } |
57 | 57 |
58 | 58 |
59 void NamedLoadHandlerCompiler::GenerateDirectLoadGlobalFunctionPrototype( | 59 void NamedLoadHandlerCompiler::GenerateDirectLoadGlobalFunctionPrototype( |
60 MacroAssembler* masm, int index, Register prototype, Label* miss) { | 60 MacroAssembler* masm, int index, Register result, Label* miss) { |
61 Isolate* isolate = masm->isolate(); | 61 __ Ldr(result, GlobalObjectMemOperand()); |
62 // Get the global function with the given index. | 62 __ Ldr(result, FieldMemOperand(result, GlobalObject::kNativeContextOffset)); |
63 Handle<JSFunction> function( | 63 __ Ldr(result, ContextMemOperand(result, index)); |
64 JSFunction::cast(isolate->native_context()->get(index))); | |
65 | |
66 // Check we're still in the same context. | |
67 Register scratch = prototype; | |
68 __ Ldr(scratch, GlobalObjectMemOperand()); | |
69 __ Ldr(scratch, FieldMemOperand(scratch, GlobalObject::kNativeContextOffset)); | |
70 __ Ldr(scratch, ContextMemOperand(scratch, index)); | |
71 __ Cmp(scratch, Operand(function)); | |
72 __ B(ne, miss); | |
73 | |
74 // Load its initial map. The global functions all have initial maps. | 64 // Load its initial map. The global functions all have initial maps. |
75 __ Mov(prototype, Operand(Handle<Map>(function->initial_map()))); | 65 __ Ldr(result, |
| 66 FieldMemOperand(result, JSFunction::kPrototypeOrInitialMapOffset)); |
76 // Load the prototype from the initial map. | 67 // Load the prototype from the initial map. |
77 __ Ldr(prototype, FieldMemOperand(prototype, Map::kPrototypeOffset)); | 68 __ Ldr(result, FieldMemOperand(result, Map::kPrototypeOffset)); |
78 } | 69 } |
79 | 70 |
80 | 71 |
81 void NamedLoadHandlerCompiler::GenerateLoadFunctionPrototype( | 72 void NamedLoadHandlerCompiler::GenerateLoadFunctionPrototype( |
82 MacroAssembler* masm, Register receiver, Register scratch1, | 73 MacroAssembler* masm, Register receiver, Register scratch1, |
83 Register scratch2, Label* miss_label) { | 74 Register scratch2, Label* miss_label) { |
84 __ TryGetFunctionPrototype(receiver, scratch1, scratch2, miss_label); | 75 __ TryGetFunctionPrototype(receiver, scratch1, scratch2, miss_label); |
85 // TryGetFunctionPrototype can't put the result directly in x0 because the | 76 // TryGetFunctionPrototype can't put the result directly in x0 because the |
86 // 3 inputs registers can't alias and we call this function from | 77 // 3 inputs registers can't alias and we call this function from |
87 // LoadIC::GenerateFunctionPrototype, where receiver is x0. So we explicitly | 78 // LoadIC::GenerateFunctionPrototype, where receiver is x0. So we explicitly |
(...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
698 // Return the generated code. | 689 // Return the generated code. |
699 return GetCode(kind(), Code::FAST, name); | 690 return GetCode(kind(), Code::FAST, name); |
700 } | 691 } |
701 | 692 |
702 | 693 |
703 #undef __ | 694 #undef __ |
704 } | 695 } |
705 } // namespace v8::internal | 696 } // namespace v8::internal |
706 | 697 |
707 #endif // V8_TARGET_ARCH_IA32 | 698 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |