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

Side by Side Diff: src/compiler/code-stub-assembler.cc

Issue 1674633002: Move FastAccessorAssembler from RawMachineAssembler to CodeStubAssembler. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address (most) feedback. Created 4 years, 10 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
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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/compiler/code-stub-assembler.h" 5 #include "src/compiler/code-stub-assembler.h"
6 6
7 #include <ostream> 7 #include <ostream>
8 8
9 #include "src/code-factory.h" 9 #include "src/code-factory.h"
10 #include "src/compiler/graph.h" 10 #include "src/compiler/graph.h"
(...skipping 10 matching lines...) Expand all
21 #include "src/zone.h" 21 #include "src/zone.h"
22 22
23 namespace v8 { 23 namespace v8 {
24 namespace internal { 24 namespace internal {
25 namespace compiler { 25 namespace compiler {
26 26
27 CodeStubAssembler::CodeStubAssembler(Isolate* isolate, Zone* zone, 27 CodeStubAssembler::CodeStubAssembler(Isolate* isolate, Zone* zone,
28 const CallInterfaceDescriptor& descriptor, 28 const CallInterfaceDescriptor& descriptor,
29 Code::Flags flags, const char* name, 29 Code::Flags flags, const char* name,
30 size_t result_size) 30 size_t result_size)
31 : raw_assembler_(new RawMachineAssembler( 31 : CodeStubAssembler(
32 isolate, new (zone) Graph(zone), 32 isolate, zone,
33 Linkage::GetStubCallDescriptor( 33 Linkage::GetStubCallDescriptor(
34 isolate, zone, descriptor, descriptor.GetStackParameterCount(), 34 isolate, zone, descriptor, descriptor.GetStackParameterCount(),
35 CallDescriptor::kNoFlags, Operator::kNoProperties, 35 CallDescriptor::kNoFlags, Operator::kNoProperties,
36 MachineType::AnyTagged(), result_size))), 36 MachineType::AnyTagged(), result_size),
37 flags, name) {}
38
39 CodeStubAssembler::CodeStubAssembler(Isolate* isolate, Zone* zone,
40 int parameter_count, Code::Flags flags,
41 const char* name)
42 : CodeStubAssembler(isolate, zone, Linkage::GetJSCallDescriptor(
43 zone, false, parameter_count,
44 CallDescriptor::kNoFlags),
45 flags, name) {}
46
47 CodeStubAssembler::CodeStubAssembler(Isolate* isolate, Zone* zone,
48 CallDescriptor* call_descriptor,
49 Code::Flags flags, const char* name)
50 : raw_assembler_(new RawMachineAssembler(isolate, new (zone) Graph(zone),
51 call_descriptor)),
37 flags_(flags), 52 flags_(flags),
38 name_(name), 53 name_(name),
39 code_generated_(false), 54 code_generated_(false),
40 variables_(zone) {} 55 variables_(zone) {}
41 56
42 CodeStubAssembler::~CodeStubAssembler() {} 57 CodeStubAssembler::~CodeStubAssembler() {}
43 58
44 void CodeStubAssembler::CallPrologue() {} 59 void CodeStubAssembler::CallPrologue() {}
45 60
46 void CodeStubAssembler::CallEpilogue() {} 61 void CodeStubAssembler::CallEpilogue() {}
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 94
80 95
81 Node* CodeStubAssembler::BooleanConstant(bool value) { 96 Node* CodeStubAssembler::BooleanConstant(bool value) {
82 return raw_assembler_->BooleanConstant(value); 97 return raw_assembler_->BooleanConstant(value);
83 } 98 }
84 99
85 Node* CodeStubAssembler::ExternalConstant(ExternalReference address) { 100 Node* CodeStubAssembler::ExternalConstant(ExternalReference address) {
86 return raw_assembler_->ExternalConstant(address); 101 return raw_assembler_->ExternalConstant(address);
87 } 102 }
88 103
104 Node* CodeStubAssembler::NullConstant() {
105 return LoadRoot(Heap::kNullValueRootIndex);
106 }
107
108 Node* CodeStubAssembler::UndefinedConstant() {
109 return LoadRoot(Heap::kUndefinedValueRootIndex);
110 }
111
89 Node* CodeStubAssembler::Parameter(int value) { 112 Node* CodeStubAssembler::Parameter(int value) {
90 return raw_assembler_->Parameter(value); 113 return raw_assembler_->Parameter(value);
91 } 114 }
92 115
93 116
94 void CodeStubAssembler::Return(Node* value) { 117 void CodeStubAssembler::Return(Node* value) {
95 return raw_assembler_->Return(value); 118 return raw_assembler_->Return(value);
96 } 119 }
97 120
98 void CodeStubAssembler::Bind(CodeStubAssembler::Label* label) { 121 void CodeStubAssembler::Bind(CodeStubAssembler::Label* label) {
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 161
139 Node* CodeStubAssembler::WordShl(Node* value, int shift) { 162 Node* CodeStubAssembler::WordShl(Node* value, int shift) {
140 return raw_assembler_->WordShl(value, Int32Constant(shift)); 163 return raw_assembler_->WordShl(value, Int32Constant(shift));
141 } 164 }
142 165
143 Node* CodeStubAssembler::WordIsSmi(Node* a) { 166 Node* CodeStubAssembler::WordIsSmi(Node* a) {
144 return WordEqual(raw_assembler_->WordAnd(a, Int32Constant(kSmiTagMask)), 167 return WordEqual(raw_assembler_->WordAnd(a, Int32Constant(kSmiTagMask)),
145 Int32Constant(0)); 168 Int32Constant(0));
146 } 169 }
147 170
148 Node* CodeStubAssembler::LoadBufferObject(Node* buffer, int offset) { 171 Node* CodeStubAssembler::LoadBufferObject(Node* buffer, int offset,
149 return raw_assembler_->Load(MachineType::AnyTagged(), buffer, 172 MachineType rep) {
150 IntPtrConstant(offset)); 173 return raw_assembler_->Load(rep, buffer, IntPtrConstant(offset));
151 } 174 }
152 175
153 Node* CodeStubAssembler::LoadObjectField(Node* object, int offset) { 176 Node* CodeStubAssembler::LoadObjectField(Node* object, int offset,
154 return raw_assembler_->Load(MachineType::AnyTagged(), object, 177 MachineType rep) {
178 return raw_assembler_->Load(rep, object,
155 IntPtrConstant(offset - kHeapObjectTag)); 179 IntPtrConstant(offset - kHeapObjectTag));
156 } 180 }
157 181
158 Node* CodeStubAssembler::LoadFixedArrayElementSmiIndex(Node* object, 182 Node* CodeStubAssembler::LoadFixedArrayElementSmiIndex(Node* object,
159 Node* smi_index, 183 Node* smi_index,
160 int additional_offset) { 184 int additional_offset) {
161 Node* header_size = raw_assembler_->Int32Constant( 185 Node* header_size = raw_assembler_->Int32Constant(
162 additional_offset + FixedArray::kHeaderSize - kHeapObjectTag); 186 additional_offset + FixedArray::kHeaderSize - kHeapObjectTag);
163 Node* scaled_index = 187 Node* scaled_index =
164 (kSmiShiftSize == 0) 188 (kSmiShiftSize == 0)
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after
606 } 630 }
607 } 631 }
608 } 632 }
609 633
610 bound_ = true; 634 bound_ = true;
611 } 635 }
612 636
613 } // namespace compiler 637 } // namespace compiler
614 } // namespace internal 638 } // namespace internal
615 } // namespace v8 639 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698