| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 #include "src/bootstrapper.h" | 7 #include "src/bootstrapper.h" |
| 8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
| 9 #include "src/cpu-profiler.h" | 9 #include "src/cpu-profiler.h" |
| 10 #include "src/factory.h" | 10 #include "src/factory.h" |
| (...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 637 | 637 |
| 638 | 638 |
| 639 void KeyedStringLengthStub::InitializeInterfaceDescriptor( | 639 void KeyedStringLengthStub::InitializeInterfaceDescriptor( |
| 640 CodeStubInterfaceDescriptor* descriptor) { | 640 CodeStubInterfaceDescriptor* descriptor) { |
| 641 Register registers[] = { LoadIC::ReceiverRegister(), | 641 Register registers[] = { LoadIC::ReceiverRegister(), |
| 642 LoadIC::NameRegister() }; | 642 LoadIC::NameRegister() }; |
| 643 descriptor->Initialize(ARRAY_SIZE(registers), registers); | 643 descriptor->Initialize(ARRAY_SIZE(registers), registers); |
| 644 } | 644 } |
| 645 | 645 |
| 646 | 646 |
| 647 void GrowArrayElementsStub::InitializeInterfaceDescriptor( |
| 648 CodeStubInterfaceDescriptor* descriptor) { |
| 649 Register registers[] = { ObjectRegister(), |
| 650 KeyRegister(), |
| 651 CapacityRegister() }; |
| 652 Address deopt_handler = Runtime::FunctionForId( |
| 653 Runtime::kGrowArrayElements)->entry; |
| 654 descriptor->Initialize(ARRAY_SIZE(registers), registers, deopt_handler); |
| 655 } |
| 656 |
| 657 |
| 647 void KeyedLoadDictionaryElementPlatformStub::Generate( | 658 void KeyedLoadDictionaryElementPlatformStub::Generate( |
| 648 MacroAssembler* masm) { | 659 MacroAssembler* masm) { |
| 649 KeyedLoadStubCompiler::GenerateLoadDictionaryElement(masm); | 660 KeyedLoadStubCompiler::GenerateLoadDictionaryElement(masm); |
| 650 } | 661 } |
| 651 | 662 |
| 652 | 663 |
| 653 void CreateAllocationSiteStub::GenerateAheadOfTime(Isolate* isolate) { | 664 void CreateAllocationSiteStub::GenerateAheadOfTime(Isolate* isolate) { |
| 654 CreateAllocationSiteStub stub(isolate); | 665 CreateAllocationSiteStub stub(isolate); |
| 655 stub.GetCode(); | 666 stub.GetCode(); |
| 656 } | 667 } |
| 657 | 668 |
| 658 | 669 |
| 670 void GrowArrayElementsStub::GenerateAheadOfTime(Isolate* isolate) { |
| 671 // Generate for all elements kinds |
| 672 int last_index = GetSequenceIndexFromFastElementsKind( |
| 673 TERMINAL_FAST_ELEMENTS_KIND); |
| 674 for (int i = 0; i <= last_index; ++i) { |
| 675 ElementsKind kind = GetFastElementsKindFromSequenceIndex(i); |
| 676 GrowArrayElementsStub stub1(isolate, true, kind); |
| 677 stub1.GetCode(); |
| 678 GrowArrayElementsStub stub2(isolate, false, kind); |
| 679 stub2.GetCode(); |
| 680 } |
| 681 } |
| 682 |
| 683 |
| 659 void KeyedStoreElementStub::Generate(MacroAssembler* masm) { | 684 void KeyedStoreElementStub::Generate(MacroAssembler* masm) { |
| 660 switch (elements_kind_) { | 685 switch (elements_kind_) { |
| 661 case FAST_ELEMENTS: | 686 case FAST_ELEMENTS: |
| 662 case FAST_HOLEY_ELEMENTS: | 687 case FAST_HOLEY_ELEMENTS: |
| 663 case FAST_SMI_ELEMENTS: | 688 case FAST_SMI_ELEMENTS: |
| 664 case FAST_HOLEY_SMI_ELEMENTS: | 689 case FAST_HOLEY_SMI_ELEMENTS: |
| 665 case FAST_DOUBLE_ELEMENTS: | 690 case FAST_DOUBLE_ELEMENTS: |
| 666 case FAST_HOLEY_DOUBLE_ELEMENTS: | 691 case FAST_HOLEY_DOUBLE_ELEMENTS: |
| 667 #define TYPED_ARRAY_CASE(Type, type, TYPE, ctype, size) \ | 692 #define TYPED_ARRAY_CASE(Type, type, TYPE, ctype, size) \ |
| 668 case EXTERNAL_##TYPE##_ELEMENTS: \ | 693 case EXTERNAL_##TYPE##_ELEMENTS: \ |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 934 InstallDescriptor(isolate, &stub3); | 959 InstallDescriptor(isolate, &stub3); |
| 935 } | 960 } |
| 936 | 961 |
| 937 InternalArrayConstructorStub::InternalArrayConstructorStub( | 962 InternalArrayConstructorStub::InternalArrayConstructorStub( |
| 938 Isolate* isolate) : PlatformCodeStub(isolate) { | 963 Isolate* isolate) : PlatformCodeStub(isolate) { |
| 939 InternalArrayConstructorStubBase::GenerateStubsAheadOfTime(isolate); | 964 InternalArrayConstructorStubBase::GenerateStubsAheadOfTime(isolate); |
| 940 } | 965 } |
| 941 | 966 |
| 942 | 967 |
| 943 } } // namespace v8::internal | 968 } } // namespace v8::internal |
| OLD | NEW |