Chromium Code Reviews| 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/call-optimization.h" | 7 #include "src/ic/call-optimization.h" |
| 8 #include "src/ic/handler-compiler.h" | 8 #include "src/ic/handler-compiler.h" |
| 9 #include "src/ic/ic.h" | 9 #include "src/ic/ic.h" |
| 10 #include "src/isolate-inl.h" | 10 #include "src/isolate-inl.h" |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 123 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsHolderIndex == 2); | 123 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsHolderIndex == 2); |
| 124 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsLength == 3); | 124 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsLength == 3); |
| 125 | 125 |
| 126 __ Push(name, receiver, holder); | 126 __ Push(name, receiver, holder); |
| 127 } | 127 } |
| 128 | 128 |
| 129 | 129 |
| 130 static void CompileCallLoadPropertyWithInterceptor( | 130 static void CompileCallLoadPropertyWithInterceptor( |
| 131 MacroAssembler* masm, Register receiver, Register holder, Register name, | 131 MacroAssembler* masm, Register receiver, Register holder, Register name, |
| 132 Handle<JSObject> holder_obj, Runtime::FunctionId id) { | 132 Handle<JSObject> holder_obj, Runtime::FunctionId id) { |
| 133 DCHECK(NamedLoadHandlerCompiler::kInterceptorArgsLength == | |
|
Igor Sheludko
2015/12/30 14:48:17
Ditto.
| |
| 134 Runtime::FunctionForId(id)->nargs); | |
| 133 PushInterceptorArguments(masm, receiver, holder, name, holder_obj); | 135 PushInterceptorArguments(masm, receiver, holder, name, holder_obj); |
| 134 | 136 __ CallRuntime(id); |
| 135 __ CallRuntime(id, NamedLoadHandlerCompiler::kInterceptorArgsLength); | |
| 136 } | 137 } |
| 137 | 138 |
| 138 | 139 |
| 139 // Generate call to api function. | 140 // Generate call to api function. |
| 140 void PropertyHandlerCompiler::GenerateApiAccessorCall( | 141 void PropertyHandlerCompiler::GenerateApiAccessorCall( |
| 141 MacroAssembler* masm, const CallOptimization& optimization, | 142 MacroAssembler* masm, const CallOptimization& optimization, |
| 142 Handle<Map> receiver_map, Register receiver, Register scratch, | 143 Handle<Map> receiver_map, Register receiver, Register scratch, |
| 143 bool is_store, Register store_parameter, Register accessor_holder, | 144 bool is_store, Register store_parameter, Register accessor_holder, |
| 144 int accessor_index) { | 145 int accessor_index) { |
| 145 DCHECK(!AreAliased(accessor_holder, scratch)); | 146 DCHECK(!AreAliased(accessor_holder, scratch)); |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 312 VectorStoreICDescriptor::SlotRegister(), | 313 VectorStoreICDescriptor::SlotRegister(), |
| 313 VectorStoreICDescriptor::VectorRegister()); | 314 VectorStoreICDescriptor::VectorRegister()); |
| 314 } | 315 } |
| 315 | 316 |
| 316 | 317 |
| 317 void NamedStoreHandlerCompiler::GenerateSlow(MacroAssembler* masm) { | 318 void NamedStoreHandlerCompiler::GenerateSlow(MacroAssembler* masm) { |
| 318 StoreIC_PushArgs(masm); | 319 StoreIC_PushArgs(masm); |
| 319 | 320 |
| 320 // The slow case calls into the runtime to complete the store without causing | 321 // The slow case calls into the runtime to complete the store without causing |
| 321 // an IC miss that would otherwise cause a transition to the generic stub. | 322 // an IC miss that would otherwise cause a transition to the generic stub. |
| 322 __ TailCallRuntime(Runtime::kStoreIC_Slow, 5); | 323 __ TailCallRuntime(Runtime::kStoreIC_Slow); |
| 323 } | 324 } |
| 324 | 325 |
| 325 | 326 |
| 326 void ElementHandlerCompiler::GenerateStoreSlow(MacroAssembler* masm) { | 327 void ElementHandlerCompiler::GenerateStoreSlow(MacroAssembler* masm) { |
| 327 ASM_LOCATION("ElementHandlerCompiler::GenerateStoreSlow"); | 328 ASM_LOCATION("ElementHandlerCompiler::GenerateStoreSlow"); |
| 328 StoreIC_PushArgs(masm); | 329 StoreIC_PushArgs(masm); |
| 329 | 330 |
| 330 // The slow case calls into the runtime to complete the store without causing | 331 // The slow case calls into the runtime to complete the store without causing |
| 331 // an IC miss that would otherwise cause a transition to the generic stub. | 332 // an IC miss that would otherwise cause a transition to the generic stub. |
| 332 __ TailCallRuntime(Runtime::kKeyedStoreIC_Slow, 5); | 333 __ TailCallRuntime(Runtime::kKeyedStoreIC_Slow); |
| 333 } | 334 } |
| 334 | 335 |
| 335 | 336 |
| 336 #undef __ | 337 #undef __ |
| 337 #define __ ACCESS_MASM(masm()) | 338 #define __ ACCESS_MASM(masm()) |
| 338 | 339 |
| 339 | 340 |
| 340 Handle<Code> NamedLoadHandlerCompiler::CompileLoadGlobal( | 341 Handle<Code> NamedLoadHandlerCompiler::CompileLoadGlobal( |
| 341 Handle<PropertyCell> cell, Handle<Name> name, bool is_configurable) { | 342 Handle<PropertyCell> cell, Handle<Name> name, bool is_configurable) { |
| 342 Label miss; | 343 Label miss; |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 372 | 373 |
| 373 Handle<Code> NamedStoreHandlerCompiler::CompileStoreInterceptor( | 374 Handle<Code> NamedStoreHandlerCompiler::CompileStoreInterceptor( |
| 374 Handle<Name> name) { | 375 Handle<Name> name) { |
| 375 Label miss; | 376 Label miss; |
| 376 | 377 |
| 377 ASM_LOCATION("NamedStoreHandlerCompiler::CompileStoreInterceptor"); | 378 ASM_LOCATION("NamedStoreHandlerCompiler::CompileStoreInterceptor"); |
| 378 | 379 |
| 379 __ Push(receiver(), this->name(), value()); | 380 __ Push(receiver(), this->name(), value()); |
| 380 | 381 |
| 381 // Do tail-call to the runtime system. | 382 // Do tail-call to the runtime system. |
| 382 __ TailCallRuntime(Runtime::kStorePropertyWithInterceptor, 3); | 383 __ TailCallRuntime(Runtime::kStorePropertyWithInterceptor); |
| 383 | 384 |
| 384 // Return the generated code. | 385 // Return the generated code. |
| 385 return GetCode(kind(), Code::FAST, name); | 386 return GetCode(kind(), Code::FAST, name); |
| 386 } | 387 } |
| 387 | 388 |
| 388 | 389 |
| 389 Register NamedStoreHandlerCompiler::value() { | 390 Register NamedStoreHandlerCompiler::value() { |
| 390 return StoreDescriptor::ValueRegister(); | 391 return StoreDescriptor::ValueRegister(); |
| 391 } | 392 } |
| 392 | 393 |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 761 } | 762 } |
| 762 | 763 |
| 763 | 764 |
| 764 void NamedLoadHandlerCompiler::GenerateLoadInterceptor(Register holder_reg) { | 765 void NamedLoadHandlerCompiler::GenerateLoadInterceptor(Register holder_reg) { |
| 765 // Call the runtime system to load the interceptor. | 766 // Call the runtime system to load the interceptor. |
| 766 DCHECK(holder()->HasNamedInterceptor()); | 767 DCHECK(holder()->HasNamedInterceptor()); |
| 767 DCHECK(!holder()->GetNamedInterceptor()->getter()->IsUndefined()); | 768 DCHECK(!holder()->GetNamedInterceptor()->getter()->IsUndefined()); |
| 768 PushInterceptorArguments(masm(), receiver(), holder_reg, this->name(), | 769 PushInterceptorArguments(masm(), receiver(), holder_reg, this->name(), |
| 769 holder()); | 770 holder()); |
| 770 | 771 |
| 771 __ TailCallRuntime(Runtime::kLoadPropertyWithInterceptor, | 772 __ TailCallRuntime(Runtime::kLoadPropertyWithInterceptor); |
| 772 NamedLoadHandlerCompiler::kInterceptorArgsLength); | |
| 773 } | 773 } |
| 774 | 774 |
| 775 | 775 |
| 776 Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback( | 776 Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback( |
| 777 Handle<JSObject> object, Handle<Name> name, | 777 Handle<JSObject> object, Handle<Name> name, |
| 778 Handle<ExecutableAccessorInfo> callback) { | 778 Handle<ExecutableAccessorInfo> callback) { |
| 779 ASM_LOCATION("NamedStoreHandlerCompiler::CompileStoreCallback"); | 779 ASM_LOCATION("NamedStoreHandlerCompiler::CompileStoreCallback"); |
| 780 Register holder_reg = Frontend(name); | 780 Register holder_reg = Frontend(name); |
| 781 | 781 |
| 782 // Stub never generated for non-global objects that require access checks. | 782 // Stub never generated for non-global objects that require access checks. |
| 783 DCHECK(holder()->IsJSGlobalProxy() || !holder()->IsAccessCheckNeeded()); | 783 DCHECK(holder()->IsJSGlobalProxy() || !holder()->IsAccessCheckNeeded()); |
| 784 | 784 |
| 785 // receiver() and holder_reg can alias. | 785 // receiver() and holder_reg can alias. |
| 786 DCHECK(!AreAliased(receiver(), scratch1(), scratch2(), value())); | 786 DCHECK(!AreAliased(receiver(), scratch1(), scratch2(), value())); |
| 787 DCHECK(!AreAliased(holder_reg, scratch1(), scratch2(), value())); | 787 DCHECK(!AreAliased(holder_reg, scratch1(), scratch2(), value())); |
| 788 // If the callback cannot leak, then push the callback directly, | 788 // If the callback cannot leak, then push the callback directly, |
| 789 // otherwise wrap it in a weak cell. | 789 // otherwise wrap it in a weak cell. |
| 790 if (callback->data()->IsUndefined() || callback->data()->IsSmi()) { | 790 if (callback->data()->IsUndefined() || callback->data()->IsSmi()) { |
| 791 __ Mov(scratch1(), Operand(callback)); | 791 __ Mov(scratch1(), Operand(callback)); |
| 792 } else { | 792 } else { |
| 793 Handle<WeakCell> cell = isolate()->factory()->NewWeakCell(callback); | 793 Handle<WeakCell> cell = isolate()->factory()->NewWeakCell(callback); |
| 794 __ Mov(scratch1(), Operand(cell)); | 794 __ Mov(scratch1(), Operand(cell)); |
| 795 } | 795 } |
| 796 __ Mov(scratch2(), Operand(name)); | 796 __ Mov(scratch2(), Operand(name)); |
| 797 __ Push(receiver(), holder_reg, scratch1(), scratch2(), value()); | 797 __ Push(receiver(), holder_reg, scratch1(), scratch2(), value()); |
| 798 | 798 |
| 799 // Do tail-call to the runtime system. | 799 // Do tail-call to the runtime system. |
| 800 __ TailCallRuntime(Runtime::kStoreCallbackProperty, 5); | 800 __ TailCallRuntime(Runtime::kStoreCallbackProperty); |
| 801 | 801 |
| 802 // Return the generated code. | 802 // Return the generated code. |
| 803 return GetCode(kind(), Code::FAST, name); | 803 return GetCode(kind(), Code::FAST, name); |
| 804 } | 804 } |
| 805 | 805 |
| 806 | 806 |
| 807 #undef __ | 807 #undef __ |
| 808 } // namespace internal | 808 } // namespace internal |
| 809 } // namespace v8 | 809 } // namespace v8 |
| 810 | 810 |
| 811 #endif // V8_TARGET_ARCH_IA32 | 811 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |