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

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

Issue 426233002: Land the Fan (disabled) (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review feedback, rebase and "git cl format" Created 6 years, 4 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
« no previous file with comments | « src/code-stubs.h ('k') | src/compiler.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 // If there is a context register, the representation must be tagged. 56 // If there is a context register, the representation must be tagged.
57 ASSERT(i != 0 || register_param_representations[i].Equals( 57 ASSERT(i != 0 || register_param_representations[i].Equals(
58 Representation::Tagged())); 58 Representation::Tagged()));
59 register_param_representations_[i] = register_param_representations[i]; 59 register_param_representations_[i] = register_param_representations[i];
60 } 60 }
61 } 61 }
62 } 62 }
63 63
64 64
65 void CodeStubInterfaceDescriptor::Initialize( 65 void CodeStubInterfaceDescriptor::Initialize(
66 int register_parameter_count, 66 CodeStub::Major major, int register_parameter_count, Register* registers,
67 Register* registers,
68 Address deoptimization_handler, 67 Address deoptimization_handler,
69 Representation* register_param_representations, 68 Representation* register_param_representations,
70 int hint_stack_parameter_count, 69 int hint_stack_parameter_count, StubFunctionMode function_mode) {
71 StubFunctionMode function_mode) {
72 InterfaceDescriptor::Initialize(register_parameter_count, registers, 70 InterfaceDescriptor::Initialize(register_parameter_count, registers,
73 register_param_representations); 71 register_param_representations);
74 72
75 deoptimization_handler_ = deoptimization_handler; 73 deoptimization_handler_ = deoptimization_handler;
76 74
77 hint_stack_parameter_count_ = hint_stack_parameter_count; 75 hint_stack_parameter_count_ = hint_stack_parameter_count;
78 function_mode_ = function_mode; 76 function_mode_ = function_mode;
77 major_ = major;
79 } 78 }
80 79
81 80
82 void CodeStubInterfaceDescriptor::Initialize( 81 void CodeStubInterfaceDescriptor::Initialize(
83 int register_parameter_count, 82 CodeStub::Major major, int register_parameter_count, Register* registers,
84 Register* registers, 83 Register stack_parameter_count, Address deoptimization_handler,
85 Register stack_parameter_count,
86 Address deoptimization_handler,
87 Representation* register_param_representations, 84 Representation* register_param_representations,
88 int hint_stack_parameter_count, 85 int hint_stack_parameter_count, StubFunctionMode function_mode,
89 StubFunctionMode function_mode,
90 HandlerArgumentsMode handler_mode) { 86 HandlerArgumentsMode handler_mode) {
91 Initialize(register_parameter_count, registers, 87 Initialize(major, register_parameter_count, registers, deoptimization_handler,
92 deoptimization_handler, 88 register_param_representations, hint_stack_parameter_count,
93 register_param_representations,
94 hint_stack_parameter_count,
95 function_mode); 89 function_mode);
96 stack_parameter_count_ = stack_parameter_count; 90 stack_parameter_count_ = stack_parameter_count;
97 handler_arguments_mode_ = handler_mode; 91 handler_arguments_mode_ = handler_mode;
98 } 92 }
99 93
100 94
101 void CallInterfaceDescriptor::Initialize( 95 void CallInterfaceDescriptor::Initialize(
102 int register_parameter_count, 96 int register_parameter_count,
103 Register* registers, 97 Register* registers,
104 Representation* param_representations, 98 Representation* param_representations,
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after
584 code->set_handler_table(*handler_table); 578 code->set_handler_table(*handler_table);
585 } 579 }
586 580
587 581
588 void LoadFastElementStub::InitializeInterfaceDescriptor( 582 void LoadFastElementStub::InitializeInterfaceDescriptor(
589 CodeStubInterfaceDescriptor* descriptor) { 583 CodeStubInterfaceDescriptor* descriptor) {
590 Register registers[] = { InterfaceDescriptor::ContextRegister(), 584 Register registers[] = { InterfaceDescriptor::ContextRegister(),
591 LoadIC::ReceiverRegister(), 585 LoadIC::ReceiverRegister(),
592 LoadIC::NameRegister() }; 586 LoadIC::NameRegister() };
593 STATIC_ASSERT(LoadIC::kParameterCount == 2); 587 STATIC_ASSERT(LoadIC::kParameterCount == 2);
594 descriptor->Initialize(ARRAY_SIZE(registers), registers, 588 descriptor->Initialize(MajorKey(), ARRAY_SIZE(registers), registers,
595 FUNCTION_ADDR(KeyedLoadIC_MissFromStubFailure)); 589 FUNCTION_ADDR(KeyedLoadIC_MissFromStubFailure));
596 } 590 }
597 591
598 592
599 void LoadDictionaryElementStub::InitializeInterfaceDescriptor( 593 void LoadDictionaryElementStub::InitializeInterfaceDescriptor(
600 CodeStubInterfaceDescriptor* descriptor) { 594 CodeStubInterfaceDescriptor* descriptor) {
601 Register registers[] = { InterfaceDescriptor::ContextRegister(), 595 Register registers[] = { InterfaceDescriptor::ContextRegister(),
602 LoadIC::ReceiverRegister(), 596 LoadIC::ReceiverRegister(),
603 LoadIC::NameRegister() }; 597 LoadIC::NameRegister() };
604 STATIC_ASSERT(LoadIC::kParameterCount == 2); 598 STATIC_ASSERT(LoadIC::kParameterCount == 2);
605 descriptor->Initialize(ARRAY_SIZE(registers), registers, 599 descriptor->Initialize(MajorKey(), ARRAY_SIZE(registers), registers,
606 FUNCTION_ADDR(KeyedLoadIC_MissFromStubFailure)); 600 FUNCTION_ADDR(KeyedLoadIC_MissFromStubFailure));
607 } 601 }
608 602
609 603
610 void KeyedLoadGenericStub::InitializeInterfaceDescriptor( 604 void KeyedLoadGenericStub::InitializeInterfaceDescriptor(
611 CodeStubInterfaceDescriptor* descriptor) { 605 CodeStubInterfaceDescriptor* descriptor) {
612 Register registers[] = { InterfaceDescriptor::ContextRegister(), 606 Register registers[] = { InterfaceDescriptor::ContextRegister(),
613 LoadIC::ReceiverRegister(), 607 LoadIC::ReceiverRegister(),
614 LoadIC::NameRegister() }; 608 LoadIC::NameRegister() };
615 STATIC_ASSERT(LoadIC::kParameterCount == 2); 609 STATIC_ASSERT(LoadIC::kParameterCount == 2);
616 descriptor->Initialize( 610 descriptor->Initialize(
617 ARRAY_SIZE(registers), registers, 611 MajorKey(), ARRAY_SIZE(registers), registers,
618 Runtime::FunctionForId(Runtime::kKeyedGetProperty)->entry); 612 Runtime::FunctionForId(Runtime::kKeyedGetProperty)->entry);
619 } 613 }
620 614
621 615
622 void LoadFieldStub::InitializeInterfaceDescriptor( 616 void LoadFieldStub::InitializeInterfaceDescriptor(
623 CodeStubInterfaceDescriptor* descriptor) { 617 CodeStubInterfaceDescriptor* descriptor) {
624 Register registers[] = { InterfaceDescriptor::ContextRegister(), 618 Register registers[] = { InterfaceDescriptor::ContextRegister(),
625 LoadIC::ReceiverRegister() }; 619 LoadIC::ReceiverRegister() };
626 descriptor->Initialize(ARRAY_SIZE(registers), registers); 620 descriptor->Initialize(MajorKey(), ARRAY_SIZE(registers), registers);
627 } 621 }
628 622
629 623
630 void StringLengthStub::InitializeInterfaceDescriptor( 624 void StringLengthStub::InitializeInterfaceDescriptor(
631 CodeStubInterfaceDescriptor* descriptor) { 625 CodeStubInterfaceDescriptor* descriptor) {
632 Register registers[] = { InterfaceDescriptor::ContextRegister(), 626 Register registers[] = { InterfaceDescriptor::ContextRegister(),
633 LoadIC::ReceiverRegister(), 627 LoadIC::ReceiverRegister(),
634 LoadIC::NameRegister() }; 628 LoadIC::NameRegister() };
635 descriptor->Initialize(ARRAY_SIZE(registers), registers); 629 descriptor->Initialize(MajorKey(), ARRAY_SIZE(registers), registers);
636 } 630 }
637 631
638 632
639 void StoreFastElementStub::InitializeInterfaceDescriptor( 633 void StoreFastElementStub::InitializeInterfaceDescriptor(
640 CodeStubInterfaceDescriptor* descriptor) { 634 CodeStubInterfaceDescriptor* descriptor) {
641 Register registers[] = { InterfaceDescriptor::ContextRegister(), 635 Register registers[] = { InterfaceDescriptor::ContextRegister(),
642 KeyedStoreIC::ReceiverRegister(), 636 KeyedStoreIC::ReceiverRegister(),
643 KeyedStoreIC::NameRegister(), 637 KeyedStoreIC::NameRegister(),
644 KeyedStoreIC::ValueRegister() }; 638 KeyedStoreIC::ValueRegister() };
645 descriptor->Initialize( 639 descriptor->Initialize(MajorKey(), ARRAY_SIZE(registers), registers,
646 ARRAY_SIZE(registers), registers, 640 FUNCTION_ADDR(KeyedStoreIC_MissFromStubFailure));
647 FUNCTION_ADDR(KeyedStoreIC_MissFromStubFailure));
648 } 641 }
649 642
650 643
651 void ElementsTransitionAndStoreStub::InitializeInterfaceDescriptor( 644 void ElementsTransitionAndStoreStub::InitializeInterfaceDescriptor(
652 CodeStubInterfaceDescriptor* descriptor) { 645 CodeStubInterfaceDescriptor* descriptor) {
653 Register registers[] = { InterfaceDescriptor::ContextRegister(), 646 Register registers[] = { InterfaceDescriptor::ContextRegister(),
654 ValueRegister(), 647 ValueRegister(),
655 MapRegister(), 648 MapRegister(),
656 KeyRegister(), 649 KeyRegister(),
657 ObjectRegister() }; 650 ObjectRegister() };
658 descriptor->Initialize(ARRAY_SIZE(registers), registers, 651 descriptor->Initialize(MajorKey(), ARRAY_SIZE(registers), registers,
659 FUNCTION_ADDR(ElementsTransitionAndStoreIC_Miss)); 652 FUNCTION_ADDR(ElementsTransitionAndStoreIC_Miss));
660 } 653 }
661 654
662 655
663 void StoreGlobalStub::InitializeInterfaceDescriptor( 656 void StoreGlobalStub::InitializeInterfaceDescriptor(
664 CodeStubInterfaceDescriptor* descriptor) { 657 CodeStubInterfaceDescriptor* descriptor) {
665 Register registers[] = { InterfaceDescriptor::ContextRegister(), 658 Register registers[] = { InterfaceDescriptor::ContextRegister(),
666 StoreIC::ReceiverRegister(), 659 StoreIC::ReceiverRegister(),
667 StoreIC::NameRegister(), 660 StoreIC::NameRegister(),
668 StoreIC::ValueRegister() }; 661 StoreIC::ValueRegister() };
669 descriptor->Initialize(ARRAY_SIZE(registers), registers, 662 descriptor->Initialize(MajorKey(), ARRAY_SIZE(registers), registers,
670 FUNCTION_ADDR(StoreIC_MissFromStubFailure)); 663 FUNCTION_ADDR(StoreIC_MissFromStubFailure));
671 } 664 }
672 665
673 666
674 void LoadDictionaryElementPlatformStub::Generate(MacroAssembler* masm) { 667 void LoadDictionaryElementPlatformStub::Generate(MacroAssembler* masm) {
675 ElementHandlerCompiler::GenerateLoadDictionaryElement(masm); 668 ElementHandlerCompiler::GenerateLoadDictionaryElement(masm);
676 } 669 }
677 670
678 671
679 void CreateAllocationSiteStub::GenerateAheadOfTime(Isolate* isolate) { 672 void CreateAllocationSiteStub::GenerateAheadOfTime(Isolate* isolate) {
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
977 InstallDescriptor(isolate, &stub3); 970 InstallDescriptor(isolate, &stub3);
978 } 971 }
979 972
980 InternalArrayConstructorStub::InternalArrayConstructorStub( 973 InternalArrayConstructorStub::InternalArrayConstructorStub(
981 Isolate* isolate) : PlatformCodeStub(isolate) { 974 Isolate* isolate) : PlatformCodeStub(isolate) {
982 InternalArrayConstructorStubBase::GenerateStubsAheadOfTime(isolate); 975 InternalArrayConstructorStubBase::GenerateStubsAheadOfTime(isolate);
983 } 976 }
984 977
985 978
986 } } // namespace v8::internal 979 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/code-stubs.h ('k') | src/compiler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698