| 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_ARM | 5 #if V8_TARGET_ARCH_ARM |
| 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 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 VectorStoreICDescriptor::SlotRegister(), | 318 VectorStoreICDescriptor::SlotRegister(), |
| 319 VectorStoreICDescriptor::VectorRegister()); | 319 VectorStoreICDescriptor::VectorRegister()); |
| 320 } | 320 } |
| 321 | 321 |
| 322 | 322 |
| 323 void NamedStoreHandlerCompiler::GenerateSlow(MacroAssembler* masm) { | 323 void NamedStoreHandlerCompiler::GenerateSlow(MacroAssembler* masm) { |
| 324 StoreIC_PushArgs(masm); | 324 StoreIC_PushArgs(masm); |
| 325 | 325 |
| 326 // The slow case calls into the runtime to complete the store without causing | 326 // The slow case calls into the runtime to complete the store without causing |
| 327 // an IC miss that would otherwise cause a transition to the generic stub. | 327 // an IC miss that would otherwise cause a transition to the generic stub. |
| 328 __ TailCallRuntime(Runtime::kStoreIC_Slow, 5, 1); | 328 __ TailCallRuntime(Runtime::kStoreIC_Slow, 5); |
| 329 } | 329 } |
| 330 | 330 |
| 331 | 331 |
| 332 void ElementHandlerCompiler::GenerateStoreSlow(MacroAssembler* masm) { | 332 void ElementHandlerCompiler::GenerateStoreSlow(MacroAssembler* masm) { |
| 333 StoreIC_PushArgs(masm); | 333 StoreIC_PushArgs(masm); |
| 334 | 334 |
| 335 // The slow case calls into the runtime to complete the store without causing | 335 // The slow case calls into the runtime to complete the store without causing |
| 336 // an IC miss that would otherwise cause a transition to the generic stub. | 336 // an IC miss that would otherwise cause a transition to the generic stub. |
| 337 __ TailCallRuntime(Runtime::kKeyedStoreIC_Slow, 5, 1); | 337 __ TailCallRuntime(Runtime::kKeyedStoreIC_Slow, 5); |
| 338 } | 338 } |
| 339 | 339 |
| 340 | 340 |
| 341 #undef __ | 341 #undef __ |
| 342 #define __ ACCESS_MASM(masm()) | 342 #define __ ACCESS_MASM(masm()) |
| 343 | 343 |
| 344 | 344 |
| 345 void NamedStoreHandlerCompiler::GenerateRestoreName(Label* label, | 345 void NamedStoreHandlerCompiler::GenerateRestoreName(Label* label, |
| 346 Handle<Name> name) { | 346 Handle<Name> name) { |
| 347 if (!label->is_unused()) { | 347 if (!label->is_unused()) { |
| (...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 701 | 701 |
| 702 | 702 |
| 703 void NamedLoadHandlerCompiler::GenerateLoadInterceptor(Register holder_reg) { | 703 void NamedLoadHandlerCompiler::GenerateLoadInterceptor(Register holder_reg) { |
| 704 // Call the runtime system to load the interceptor. | 704 // Call the runtime system to load the interceptor. |
| 705 DCHECK(holder()->HasNamedInterceptor()); | 705 DCHECK(holder()->HasNamedInterceptor()); |
| 706 DCHECK(!holder()->GetNamedInterceptor()->getter()->IsUndefined()); | 706 DCHECK(!holder()->GetNamedInterceptor()->getter()->IsUndefined()); |
| 707 PushInterceptorArguments(masm(), receiver(), holder_reg, this->name(), | 707 PushInterceptorArguments(masm(), receiver(), holder_reg, this->name(), |
| 708 holder()); | 708 holder()); |
| 709 | 709 |
| 710 __ TailCallRuntime(Runtime::kLoadPropertyWithInterceptor, | 710 __ TailCallRuntime(Runtime::kLoadPropertyWithInterceptor, |
| 711 NamedLoadHandlerCompiler::kInterceptorArgsLength, 1); | 711 NamedLoadHandlerCompiler::kInterceptorArgsLength); |
| 712 } | 712 } |
| 713 | 713 |
| 714 | 714 |
| 715 Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback( | 715 Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback( |
| 716 Handle<JSObject> object, Handle<Name> name, | 716 Handle<JSObject> object, Handle<Name> name, |
| 717 Handle<ExecutableAccessorInfo> callback) { | 717 Handle<ExecutableAccessorInfo> callback) { |
| 718 Register holder_reg = Frontend(name); | 718 Register holder_reg = Frontend(name); |
| 719 | 719 |
| 720 __ push(receiver()); // receiver | 720 __ push(receiver()); // receiver |
| 721 __ push(holder_reg); | 721 __ push(holder_reg); |
| 722 | 722 |
| 723 // If the callback cannot leak, then push the callback directly, | 723 // If the callback cannot leak, then push the callback directly, |
| 724 // otherwise wrap it in a weak cell. | 724 // otherwise wrap it in a weak cell. |
| 725 if (callback->data()->IsUndefined() || callback->data()->IsSmi()) { | 725 if (callback->data()->IsUndefined() || callback->data()->IsSmi()) { |
| 726 __ mov(ip, Operand(callback)); | 726 __ mov(ip, Operand(callback)); |
| 727 } else { | 727 } else { |
| 728 Handle<WeakCell> cell = isolate()->factory()->NewWeakCell(callback); | 728 Handle<WeakCell> cell = isolate()->factory()->NewWeakCell(callback); |
| 729 __ mov(ip, Operand(cell)); | 729 __ mov(ip, Operand(cell)); |
| 730 } | 730 } |
| 731 __ push(ip); | 731 __ push(ip); |
| 732 __ mov(ip, Operand(name)); | 732 __ mov(ip, Operand(name)); |
| 733 __ Push(ip, value()); | 733 __ Push(ip, value()); |
| 734 | 734 |
| 735 // Do tail-call to the runtime system. | 735 // Do tail-call to the runtime system. |
| 736 __ TailCallRuntime(Runtime::kStoreCallbackProperty, 5, 1); | 736 __ TailCallRuntime(Runtime::kStoreCallbackProperty, 5); |
| 737 | 737 |
| 738 // Return the generated code. | 738 // Return the generated code. |
| 739 return GetCode(kind(), Code::FAST, name); | 739 return GetCode(kind(), Code::FAST, name); |
| 740 } | 740 } |
| 741 | 741 |
| 742 | 742 |
| 743 Handle<Code> NamedStoreHandlerCompiler::CompileStoreInterceptor( | 743 Handle<Code> NamedStoreHandlerCompiler::CompileStoreInterceptor( |
| 744 Handle<Name> name) { | 744 Handle<Name> name) { |
| 745 __ Push(receiver(), this->name(), value()); | 745 __ Push(receiver(), this->name(), value()); |
| 746 | 746 |
| 747 // Do tail-call to the runtime system. | 747 // Do tail-call to the runtime system. |
| 748 __ TailCallRuntime(Runtime::kStorePropertyWithInterceptor, 3, 1); | 748 __ TailCallRuntime(Runtime::kStorePropertyWithInterceptor, 3); |
| 749 | 749 |
| 750 // Return the generated code. | 750 // Return the generated code. |
| 751 return GetCode(kind(), Code::FAST, name); | 751 return GetCode(kind(), Code::FAST, name); |
| 752 } | 752 } |
| 753 | 753 |
| 754 | 754 |
| 755 Register NamedStoreHandlerCompiler::value() { | 755 Register NamedStoreHandlerCompiler::value() { |
| 756 return StoreDescriptor::ValueRegister(); | 756 return StoreDescriptor::ValueRegister(); |
| 757 } | 757 } |
| 758 | 758 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 790 // Return the generated code. | 790 // Return the generated code. |
| 791 return GetCode(kind(), Code::NORMAL, name); | 791 return GetCode(kind(), Code::NORMAL, name); |
| 792 } | 792 } |
| 793 | 793 |
| 794 | 794 |
| 795 #undef __ | 795 #undef __ |
| 796 } // namespace internal | 796 } // namespace internal |
| 797 } // namespace v8 | 797 } // namespace v8 |
| 798 | 798 |
| 799 #endif // V8_TARGET_ARCH_ARM | 799 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |