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 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 VectorStoreICDescriptor::SlotRegister(), | 312 VectorStoreICDescriptor::SlotRegister(), |
313 VectorStoreICDescriptor::VectorRegister()); | 313 VectorStoreICDescriptor::VectorRegister()); |
314 } | 314 } |
315 | 315 |
316 | 316 |
317 void NamedStoreHandlerCompiler::GenerateSlow(MacroAssembler* masm) { | 317 void NamedStoreHandlerCompiler::GenerateSlow(MacroAssembler* masm) { |
318 StoreIC_PushArgs(masm); | 318 StoreIC_PushArgs(masm); |
319 | 319 |
320 // The slow case calls into the runtime to complete the store without causing | 320 // 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. | 321 // an IC miss that would otherwise cause a transition to the generic stub. |
322 __ TailCallRuntime(Runtime::kStoreIC_Slow, 5, 1); | 322 __ TailCallRuntime(Runtime::kStoreIC_Slow, 5); |
323 } | 323 } |
324 | 324 |
325 | 325 |
326 void ElementHandlerCompiler::GenerateStoreSlow(MacroAssembler* masm) { | 326 void ElementHandlerCompiler::GenerateStoreSlow(MacroAssembler* masm) { |
327 ASM_LOCATION("ElementHandlerCompiler::GenerateStoreSlow"); | 327 ASM_LOCATION("ElementHandlerCompiler::GenerateStoreSlow"); |
328 StoreIC_PushArgs(masm); | 328 StoreIC_PushArgs(masm); |
329 | 329 |
330 // The slow case calls into the runtime to complete the store without causing | 330 // 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. | 331 // an IC miss that would otherwise cause a transition to the generic stub. |
332 __ TailCallRuntime(Runtime::kKeyedStoreIC_Slow, 5, 1); | 332 __ TailCallRuntime(Runtime::kKeyedStoreIC_Slow, 5); |
333 } | 333 } |
334 | 334 |
335 | 335 |
336 #undef __ | 336 #undef __ |
337 #define __ ACCESS_MASM(masm()) | 337 #define __ ACCESS_MASM(masm()) |
338 | 338 |
339 | 339 |
340 Handle<Code> NamedLoadHandlerCompiler::CompileLoadGlobal( | 340 Handle<Code> NamedLoadHandlerCompiler::CompileLoadGlobal( |
341 Handle<PropertyCell> cell, Handle<Name> name, bool is_configurable) { | 341 Handle<PropertyCell> cell, Handle<Name> name, bool is_configurable) { |
342 Label miss; | 342 Label miss; |
(...skipping 29 matching lines...) Expand all Loading... |
372 | 372 |
373 Handle<Code> NamedStoreHandlerCompiler::CompileStoreInterceptor( | 373 Handle<Code> NamedStoreHandlerCompiler::CompileStoreInterceptor( |
374 Handle<Name> name) { | 374 Handle<Name> name) { |
375 Label miss; | 375 Label miss; |
376 | 376 |
377 ASM_LOCATION("NamedStoreHandlerCompiler::CompileStoreInterceptor"); | 377 ASM_LOCATION("NamedStoreHandlerCompiler::CompileStoreInterceptor"); |
378 | 378 |
379 __ Push(receiver(), this->name(), value()); | 379 __ Push(receiver(), this->name(), value()); |
380 | 380 |
381 // Do tail-call to the runtime system. | 381 // Do tail-call to the runtime system. |
382 __ TailCallRuntime(Runtime::kStorePropertyWithInterceptor, 3, 1); | 382 __ TailCallRuntime(Runtime::kStorePropertyWithInterceptor, 3); |
383 | 383 |
384 // Return the generated code. | 384 // Return the generated code. |
385 return GetCode(kind(), Code::FAST, name); | 385 return GetCode(kind(), Code::FAST, name); |
386 } | 386 } |
387 | 387 |
388 | 388 |
389 Register NamedStoreHandlerCompiler::value() { | 389 Register NamedStoreHandlerCompiler::value() { |
390 return StoreDescriptor::ValueRegister(); | 390 return StoreDescriptor::ValueRegister(); |
391 } | 391 } |
392 | 392 |
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
762 | 762 |
763 | 763 |
764 void NamedLoadHandlerCompiler::GenerateLoadInterceptor(Register holder_reg) { | 764 void NamedLoadHandlerCompiler::GenerateLoadInterceptor(Register holder_reg) { |
765 // Call the runtime system to load the interceptor. | 765 // Call the runtime system to load the interceptor. |
766 DCHECK(holder()->HasNamedInterceptor()); | 766 DCHECK(holder()->HasNamedInterceptor()); |
767 DCHECK(!holder()->GetNamedInterceptor()->getter()->IsUndefined()); | 767 DCHECK(!holder()->GetNamedInterceptor()->getter()->IsUndefined()); |
768 PushInterceptorArguments(masm(), receiver(), holder_reg, this->name(), | 768 PushInterceptorArguments(masm(), receiver(), holder_reg, this->name(), |
769 holder()); | 769 holder()); |
770 | 770 |
771 __ TailCallRuntime(Runtime::kLoadPropertyWithInterceptor, | 771 __ TailCallRuntime(Runtime::kLoadPropertyWithInterceptor, |
772 NamedLoadHandlerCompiler::kInterceptorArgsLength, 1); | 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, 1); | 800 __ TailCallRuntime(Runtime::kStoreCallbackProperty, 5); |
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 |