| 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 #if V8_TARGET_ARCH_ARM64 | 5 #if V8_TARGET_ARCH_ARM64 |
| 6 | 6 |
| 7 #include "src/ic/handler-compiler.h" | 7 #include "src/ic/handler-compiler.h" |
| 8 | 8 |
| 9 #include "src/api-arguments.h" | 9 #include "src/api-arguments.h" |
| 10 #include "src/field-type.h" | 10 #include "src/field-type.h" |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 Handle<PropertyCell> cell = JSGlobalObject::EnsureEmptyPropertyCell( | 105 Handle<PropertyCell> cell = JSGlobalObject::EnsureEmptyPropertyCell( |
| 106 global, name, PropertyCellType::kInvalidated); | 106 global, name, PropertyCellType::kInvalidated); |
| 107 Isolate* isolate = masm->isolate(); | 107 Isolate* isolate = masm->isolate(); |
| 108 DCHECK(cell->value()->IsTheHole(isolate)); | 108 DCHECK(cell->value()->IsTheHole(isolate)); |
| 109 Handle<WeakCell> weak_cell = isolate->factory()->NewWeakCell(cell); | 109 Handle<WeakCell> weak_cell = isolate->factory()->NewWeakCell(cell); |
| 110 __ LoadWeakValue(scratch, weak_cell, miss); | 110 __ LoadWeakValue(scratch, weak_cell, miss); |
| 111 __ Ldr(scratch, FieldMemOperand(scratch, PropertyCell::kValueOffset)); | 111 __ Ldr(scratch, FieldMemOperand(scratch, PropertyCell::kValueOffset)); |
| 112 __ JumpIfNotRoot(scratch, Heap::kTheHoleValueRootIndex, miss); | 112 __ JumpIfNotRoot(scratch, Heap::kTheHoleValueRootIndex, miss); |
| 113 } | 113 } |
| 114 | 114 |
| 115 | |
| 116 static void PushInterceptorArguments(MacroAssembler* masm, Register receiver, | |
| 117 Register holder, Register name, | |
| 118 Handle<JSObject> holder_obj) { | |
| 119 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsNameIndex == 0); | |
| 120 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsThisIndex == 1); | |
| 121 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsHolderIndex == 2); | |
| 122 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsLength == 3); | |
| 123 | |
| 124 __ Push(name, receiver, holder); | |
| 125 } | |
| 126 | |
| 127 | |
| 128 static void CompileCallLoadPropertyWithInterceptor( | 115 static void CompileCallLoadPropertyWithInterceptor( |
| 129 MacroAssembler* masm, Register receiver, Register holder, Register name, | 116 MacroAssembler* masm, Register receiver, Register holder, Register name, |
| 130 Handle<JSObject> holder_obj, Runtime::FunctionId id) { | 117 Handle<JSObject> holder_obj, Runtime::FunctionId id) { |
| 131 DCHECK(NamedLoadHandlerCompiler::kInterceptorArgsLength == | 118 DCHECK(NamedLoadHandlerCompiler::kInterceptorArgsLength == |
| 132 Runtime::FunctionForId(id)->nargs); | 119 Runtime::FunctionForId(id)->nargs); |
| 133 PushInterceptorArguments(masm, receiver, holder, name, holder_obj); | 120 |
| 121 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsNameIndex == 0); |
| 122 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsThisIndex == 1); |
| 123 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsHolderIndex == 2); |
| 124 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsLength == 3); |
| 125 __ Push(name, receiver, holder); |
| 126 |
| 134 __ CallRuntime(id); | 127 __ CallRuntime(id); |
| 135 } | 128 } |
| 136 | 129 |
| 137 | 130 |
| 138 // Generate call to api function. | 131 // Generate call to api function. |
| 139 void PropertyHandlerCompiler::GenerateApiAccessorCall( | 132 void PropertyHandlerCompiler::GenerateApiAccessorCall( |
| 140 MacroAssembler* masm, const CallOptimization& optimization, | 133 MacroAssembler* masm, const CallOptimization& optimization, |
| 141 Handle<Map> receiver_map, Register receiver, Register scratch, | 134 Handle<Map> receiver_map, Register receiver, Register scratch, |
| 142 bool is_store, Register store_parameter, Register accessor_holder, | 135 bool is_store, Register store_parameter, Register accessor_holder, |
| 143 int accessor_index) { | 136 int accessor_index) { |
| (...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 559 } | 552 } |
| 560 | 553 |
| 561 GenerateLoadPostInterceptor(it, holder_reg); | 554 GenerateLoadPostInterceptor(it, holder_reg); |
| 562 } | 555 } |
| 563 | 556 |
| 564 | 557 |
| 565 void NamedLoadHandlerCompiler::GenerateLoadInterceptor(Register holder_reg) { | 558 void NamedLoadHandlerCompiler::GenerateLoadInterceptor(Register holder_reg) { |
| 566 // Call the runtime system to load the interceptor. | 559 // Call the runtime system to load the interceptor. |
| 567 DCHECK(holder()->HasNamedInterceptor()); | 560 DCHECK(holder()->HasNamedInterceptor()); |
| 568 DCHECK(!holder()->GetNamedInterceptor()->getter()->IsUndefined(isolate())); | 561 DCHECK(!holder()->GetNamedInterceptor()->getter()->IsUndefined(isolate())); |
| 569 PushInterceptorArguments(masm(), receiver(), holder_reg, this->name(), | 562 |
| 570 holder()); | 563 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsNameIndex == 0); |
| 564 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsThisIndex == 1); |
| 565 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsHolderIndex == 2); |
| 566 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsLength == 3); |
| 567 __ Push(name(), receiver(), holder_reg); |
| 568 // See NamedLoadHandlerCompiler::InterceptorVectorSlotPop() for details. |
| 569 if (holder_reg.is(receiver())) { |
| 570 __ Push(slot(), vector()); |
| 571 } else { |
| 572 __ Push(scratch3(), scratch2()); // slot, vector |
| 573 } |
| 571 | 574 |
| 572 __ TailCallRuntime(Runtime::kLoadPropertyWithInterceptor); | 575 __ TailCallRuntime(Runtime::kLoadPropertyWithInterceptor); |
| 573 } | 576 } |
| 574 | 577 |
| 575 void NamedStoreHandlerCompiler::ZapStackArgumentsRegisterAliases() { | 578 void NamedStoreHandlerCompiler::ZapStackArgumentsRegisterAliases() { |
| 576 STATIC_ASSERT(!StoreWithVectorDescriptor::kPassLastArgsOnStack); | 579 STATIC_ASSERT(!StoreWithVectorDescriptor::kPassLastArgsOnStack); |
| 577 } | 580 } |
| 578 | 581 |
| 579 Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback( | 582 Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback( |
| 580 Handle<JSObject> object, Handle<Name> name, Handle<AccessorInfo> callback, | 583 Handle<JSObject> object, Handle<Name> name, Handle<AccessorInfo> callback, |
| (...skipping 25 matching lines...) Expand all Loading... |
| 606 // Return the generated code. | 609 // Return the generated code. |
| 607 return GetCode(kind(), name); | 610 return GetCode(kind(), name); |
| 608 } | 611 } |
| 609 | 612 |
| 610 | 613 |
| 611 #undef __ | 614 #undef __ |
| 612 } // namespace internal | 615 } // namespace internal |
| 613 } // namespace v8 | 616 } // namespace v8 |
| 614 | 617 |
| 615 #endif // V8_TARGET_ARCH_IA32 | 618 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |