Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(354)

Side by Side Diff: src/code-stubs.cc

Issue 368263003: Use a stub in crankshaft for grow store arrays. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed remaining issues. Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 665 matching lines...) Expand 10 before | Expand all | Expand 10 after
676 CodeStubInterfaceDescriptor* descriptor) { 676 CodeStubInterfaceDescriptor* descriptor) {
677 Register registers[] = { InterfaceDescriptor::ContextRegister(), 677 Register registers[] = { InterfaceDescriptor::ContextRegister(),
678 StoreIC::ReceiverRegister(), 678 StoreIC::ReceiverRegister(),
679 StoreIC::NameRegister(), 679 StoreIC::NameRegister(),
680 StoreIC::ValueRegister() }; 680 StoreIC::ValueRegister() };
681 descriptor->Initialize(ARRAY_SIZE(registers), registers, 681 descriptor->Initialize(ARRAY_SIZE(registers), registers,
682 FUNCTION_ADDR(StoreIC_MissFromStubFailure)); 682 FUNCTION_ADDR(StoreIC_MissFromStubFailure));
683 } 683 }
684 684
685 685
686 void GrowArrayElementsStub::InitializeInterfaceDescriptor(
687 CodeStubInterfaceDescriptor* descriptor) {
688 Register registers[] = { InterfaceDescriptor::ContextRegister(),
689 ObjectRegister(),
690 KeyRegister(),
691 CapacityRegister() };
692 Address deopt_handler = Runtime::FunctionForId(
693 Runtime::kGrowArrayElements)->entry;
694 descriptor->Initialize(ARRAY_SIZE(registers), registers, deopt_handler);
695 }
696
697
686 void KeyedLoadDictionaryElementPlatformStub::Generate( 698 void KeyedLoadDictionaryElementPlatformStub::Generate(
687 MacroAssembler* masm) { 699 MacroAssembler* masm) {
688 KeyedLoadStubCompiler::GenerateLoadDictionaryElement(masm); 700 KeyedLoadStubCompiler::GenerateLoadDictionaryElement(masm);
689 } 701 }
690 702
691 703
692 void CreateAllocationSiteStub::GenerateAheadOfTime(Isolate* isolate) { 704 void CreateAllocationSiteStub::GenerateAheadOfTime(Isolate* isolate) {
693 CreateAllocationSiteStub stub(isolate); 705 CreateAllocationSiteStub stub(isolate);
694 stub.GetCode(); 706 stub.GetCode();
695 } 707 }
696 708
697 709
710 void GrowArrayElementsStub::GenerateAheadOfTime(Isolate* isolate) {
711 // Generate for all elements kinds
712 int last_index = GetSequenceIndexFromFastElementsKind(
713 TERMINAL_FAST_ELEMENTS_KIND);
714 for (int i = 0; i <= last_index; ++i) {
715 ElementsKind kind = GetFastElementsKindFromSequenceIndex(i);
716 GrowArrayElementsStub stub1(isolate, true, kind);
717 stub1.GetCode();
718 GrowArrayElementsStub stub2(isolate, false, kind);
719 stub2.GetCode();
720 }
721 }
722
723
698 void KeyedStoreElementStub::Generate(MacroAssembler* masm) { 724 void KeyedStoreElementStub::Generate(MacroAssembler* masm) {
699 switch (elements_kind_) { 725 switch (elements_kind_) {
700 case FAST_ELEMENTS: 726 case FAST_ELEMENTS:
701 case FAST_HOLEY_ELEMENTS: 727 case FAST_HOLEY_ELEMENTS:
702 case FAST_SMI_ELEMENTS: 728 case FAST_SMI_ELEMENTS:
703 case FAST_HOLEY_SMI_ELEMENTS: 729 case FAST_HOLEY_SMI_ELEMENTS:
704 case FAST_DOUBLE_ELEMENTS: 730 case FAST_DOUBLE_ELEMENTS:
705 case FAST_HOLEY_DOUBLE_ELEMENTS: 731 case FAST_HOLEY_DOUBLE_ELEMENTS:
706 #define TYPED_ARRAY_CASE(Type, type, TYPE, ctype, size) \ 732 #define TYPED_ARRAY_CASE(Type, type, TYPE, ctype, size) \
707 case EXTERNAL_##TYPE##_ELEMENTS: \ 733 case EXTERNAL_##TYPE##_ELEMENTS: \
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
990 InstallDescriptor(isolate, &stub3); 1016 InstallDescriptor(isolate, &stub3);
991 } 1017 }
992 1018
993 InternalArrayConstructorStub::InternalArrayConstructorStub( 1019 InternalArrayConstructorStub::InternalArrayConstructorStub(
994 Isolate* isolate) : PlatformCodeStub(isolate) { 1020 Isolate* isolate) : PlatformCodeStub(isolate) {
995 InternalArrayConstructorStubBase::GenerateStubsAheadOfTime(isolate); 1021 InternalArrayConstructorStubBase::GenerateStubsAheadOfTime(isolate);
996 } 1022 }
997 1023
998 1024
999 } } // namespace v8::internal 1025 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/code-stubs.h ('k') | src/code-stubs-hydrogen.cc » ('j') | src/runtime.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698