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 #include "src/code-factory.h" | 5 #include "src/code-factory.h" |
6 #include "src/code-stubs.h" | 6 #include "src/code-stubs.h" |
7 #include "src/compiler/common-operator.h" | 7 #include "src/compiler/common-operator.h" |
8 #include "src/compiler/js-generic-lowering.h" | 8 #include "src/compiler/js-generic-lowering.h" |
9 #include "src/compiler/js-graph.h" | 9 #include "src/compiler/js-graph.h" |
10 #include "src/compiler/machine-operator.h" | 10 #include "src/compiler/machine-operator.h" |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 REPLACE_STUB_CALL(Equal) | 80 REPLACE_STUB_CALL(Equal) |
81 REPLACE_STUB_CALL(NotEqual) | 81 REPLACE_STUB_CALL(NotEqual) |
82 REPLACE_STUB_CALL(ToInteger) | 82 REPLACE_STUB_CALL(ToInteger) |
83 REPLACE_STUB_CALL(ToLength) | 83 REPLACE_STUB_CALL(ToLength) |
84 REPLACE_STUB_CALL(ToNumber) | 84 REPLACE_STUB_CALL(ToNumber) |
85 REPLACE_STUB_CALL(ToName) | 85 REPLACE_STUB_CALL(ToName) |
86 REPLACE_STUB_CALL(ToObject) | 86 REPLACE_STUB_CALL(ToObject) |
87 REPLACE_STUB_CALL(ToString) | 87 REPLACE_STUB_CALL(ToString) |
88 #undef REPLACE_STUB_CALL | 88 #undef REPLACE_STUB_CALL |
89 | 89 |
90 void JSGenericLowering::ReplaceWithStubCall(Node* node, Callable callable, | 90 void JSGenericLowering::ReplaceWithStubCall(Node* node, |
| 91 const Callable& callable, |
91 CallDescriptor::Flags flags) { | 92 CallDescriptor::Flags flags) { |
92 ReplaceWithStubCall(node, callable, flags, node->op()->properties()); | 93 ReplaceWithStubCall(node, callable, flags, node->op()->properties()); |
93 } | 94 } |
94 | 95 |
95 void JSGenericLowering::ReplaceWithStubCall(Node* node, Callable callable, | 96 void JSGenericLowering::ReplaceWithStubCall(Node* node, |
| 97 const Callable& callable, |
96 CallDescriptor::Flags flags, | 98 CallDescriptor::Flags flags, |
97 Operator::Properties properties) { | 99 Operator::Properties properties) { |
98 CallDescriptor* desc = Linkage::GetStubCallDescriptor( | 100 CallDescriptor* desc = Linkage::GetStubCallDescriptor( |
99 isolate(), zone(), callable.descriptor(), 0, flags, properties); | 101 isolate(), zone(), callable.descriptor(), 0, flags, properties); |
100 Node* stub_code = jsgraph()->HeapConstant(callable.code()); | 102 Node* stub_code = jsgraph()->HeapConstant(callable.code()); |
101 node->InsertInput(zone(), 0, stub_code); | 103 node->InsertInput(zone(), 0, stub_code); |
102 NodeProperties::ChangeOp(node, common()->Call(desc)); | 104 NodeProperties::ChangeOp(node, common()->Call(desc)); |
103 } | 105 } |
104 | 106 |
105 | 107 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 | 145 |
144 void JSGenericLowering::LowerJSTypeOf(Node* node) { | 146 void JSGenericLowering::LowerJSTypeOf(Node* node) { |
145 Callable callable = CodeFactory::Typeof(isolate()); | 147 Callable callable = CodeFactory::Typeof(isolate()); |
146 node->AppendInput(zone(), graph()->start()); | 148 node->AppendInput(zone(), graph()->start()); |
147 ReplaceWithStubCall(node, callable, CallDescriptor::kNoAllocate, | 149 ReplaceWithStubCall(node, callable, CallDescriptor::kNoAllocate, |
148 Operator::kEliminatable); | 150 Operator::kEliminatable); |
149 } | 151 } |
150 | 152 |
151 | 153 |
152 void JSGenericLowering::LowerJSLoadProperty(Node* node) { | 154 void JSGenericLowering::LowerJSLoadProperty(Node* node) { |
| 155 Node* receiver = NodeProperties::GetValueInput(node, 0); |
| 156 Node* key = NodeProperties::GetValueInput(node, 1); |
153 Node* closure = NodeProperties::GetValueInput(node, 2); | 157 Node* closure = NodeProperties::GetValueInput(node, 2); |
154 Node* effect = NodeProperties::GetEffectInput(node); | 158 Node* effect = NodeProperties::GetEffectInput(node); |
155 Node* control = NodeProperties::GetControlInput(node); | 159 Node* control = NodeProperties::GetControlInput(node); |
156 CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); | 160 CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); |
157 const PropertyAccess& p = PropertyAccessOf(node->op()); | 161 const PropertyAccess& p = PropertyAccessOf(node->op()); |
158 Callable callable = CodeFactory::KeyedLoadICInOptimizedCode(isolate()); | 162 auto callable = CodeFactory::KeyedLoadICInOptimizedCode(isolate()); |
159 // Load the type feedback vector from the closure. | 163 // Load the type feedback vector from the closure. |
160 Node* literals = effect = graph()->NewNode( | 164 Node* literals = effect = graph()->NewNode( |
161 machine()->Load(MachineType::AnyTagged()), closure, | 165 machine()->Load(MachineType::AnyTagged()), closure, |
162 jsgraph()->IntPtrConstant(JSFunction::kLiteralsOffset - kHeapObjectTag), | 166 jsgraph()->IntPtrConstant(JSFunction::kLiteralsOffset - kHeapObjectTag), |
163 effect, control); | 167 effect, control); |
164 Node* vector = effect = graph()->NewNode( | 168 Node* vector = effect = graph()->NewNode( |
165 machine()->Load(MachineType::AnyTagged()), literals, | 169 machine()->Load(MachineType::AnyTagged()), literals, |
166 jsgraph()->IntPtrConstant(LiteralsArray::kFeedbackVectorOffset - | 170 jsgraph()->IntPtrConstant(LiteralsArray::kFeedbackVectorOffset - |
167 kHeapObjectTag), | 171 kHeapObjectTag), |
168 effect, control); | 172 effect, control); |
169 node->InsertInput(zone(), 2, jsgraph()->SmiConstant(p.feedback().index())); | 173 typedef decltype(callable)::Descriptor Descriptor; |
170 node->ReplaceInput(3, vector); | 174 node->InsertInputs(zone(), 0, 1); |
| 175 node->ReplaceInput(Descriptor::kReceiver, receiver); |
| 176 node->ReplaceInput(Descriptor::kName, key); |
| 177 node->ReplaceInput(Descriptor::kSlot, |
| 178 jsgraph()->SmiConstant(p.feedback().index())); |
| 179 node->ReplaceInput(Descriptor::kVector, vector); |
171 node->ReplaceInput(6, effect); | 180 node->ReplaceInput(6, effect); |
172 ReplaceWithStubCall(node, callable, flags); | 181 ReplaceWithStubCall(node, callable, flags); |
173 } | 182 } |
174 | 183 |
175 | 184 |
176 void JSGenericLowering::LowerJSLoadNamed(Node* node) { | 185 void JSGenericLowering::LowerJSLoadNamed(Node* node) { |
| 186 Node* receiver = NodeProperties::GetValueInput(node, 0); |
177 Node* closure = NodeProperties::GetValueInput(node, 1); | 187 Node* closure = NodeProperties::GetValueInput(node, 1); |
178 Node* effect = NodeProperties::GetEffectInput(node); | 188 Node* effect = NodeProperties::GetEffectInput(node); |
179 Node* control = NodeProperties::GetControlInput(node); | 189 Node* control = NodeProperties::GetControlInput(node); |
180 CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); | 190 CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); |
181 NamedAccess const& p = NamedAccessOf(node->op()); | 191 NamedAccess const& p = NamedAccessOf(node->op()); |
182 Callable callable = CodeFactory::LoadICInOptimizedCode(isolate()); | 192 auto callable = CodeFactory::LoadICInOptimizedCode(isolate()); |
183 // Load the type feedback vector from the closure. | 193 // Load the type feedback vector from the closure. |
184 Node* literals = effect = graph()->NewNode( | 194 Node* literals = effect = graph()->NewNode( |
185 machine()->Load(MachineType::AnyTagged()), closure, | 195 machine()->Load(MachineType::AnyTagged()), closure, |
186 jsgraph()->IntPtrConstant(JSFunction::kLiteralsOffset - kHeapObjectTag), | 196 jsgraph()->IntPtrConstant(JSFunction::kLiteralsOffset - kHeapObjectTag), |
187 effect, control); | 197 effect, control); |
188 Node* vector = effect = graph()->NewNode( | 198 Node* vector = effect = graph()->NewNode( |
189 machine()->Load(MachineType::AnyTagged()), literals, | 199 machine()->Load(MachineType::AnyTagged()), literals, |
190 jsgraph()->IntPtrConstant(LiteralsArray::kFeedbackVectorOffset - | 200 jsgraph()->IntPtrConstant(LiteralsArray::kFeedbackVectorOffset - |
191 kHeapObjectTag), | 201 kHeapObjectTag), |
192 effect, control); | 202 effect, control); |
193 node->InsertInput(zone(), 1, jsgraph()->HeapConstant(p.name())); | 203 typedef decltype(callable)::Descriptor Descriptor; |
194 node->InsertInput(zone(), 2, jsgraph()->SmiConstant(p.feedback().index())); | 204 node->InsertInputs(zone(), 0, 2); |
195 node->ReplaceInput(3, vector); | 205 node->ReplaceInput(Descriptor::kReceiver, receiver); |
| 206 node->ReplaceInput(Descriptor::kName, jsgraph()->HeapConstant(p.name())); |
| 207 node->ReplaceInput(Descriptor::kSlot, |
| 208 jsgraph()->SmiConstant(p.feedback().index())); |
| 209 node->ReplaceInput(Descriptor::kVector, vector); |
196 node->ReplaceInput(6, effect); | 210 node->ReplaceInput(6, effect); |
197 ReplaceWithStubCall(node, callable, flags); | 211 ReplaceWithStubCall(node, callable, flags); |
198 } | 212 } |
199 | 213 |
200 | 214 |
201 void JSGenericLowering::LowerJSLoadGlobal(Node* node) { | 215 void JSGenericLowering::LowerJSLoadGlobal(Node* node) { |
202 Node* closure = NodeProperties::GetValueInput(node, 0); | 216 Node* closure = NodeProperties::GetValueInput(node, 0); |
203 Node* effect = NodeProperties::GetEffectInput(node); | 217 Node* effect = NodeProperties::GetEffectInput(node); |
204 Node* control = NodeProperties::GetControlInput(node); | 218 Node* control = NodeProperties::GetControlInput(node); |
205 CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); | 219 CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); |
206 const LoadGlobalParameters& p = LoadGlobalParametersOf(node->op()); | 220 const LoadGlobalParameters& p = LoadGlobalParametersOf(node->op()); |
207 Callable callable = | 221 auto callable = |
208 CodeFactory::LoadGlobalICInOptimizedCode(isolate(), p.typeof_mode()); | 222 CodeFactory::LoadGlobalICInOptimizedCode(isolate(), p.typeof_mode()); |
209 // Load the type feedback vector from the closure. | 223 // Load the type feedback vector from the closure. |
210 Node* literals = effect = graph()->NewNode( | 224 Node* literals = effect = graph()->NewNode( |
211 machine()->Load(MachineType::AnyTagged()), closure, | 225 machine()->Load(MachineType::AnyTagged()), closure, |
212 jsgraph()->IntPtrConstant(JSFunction::kLiteralsOffset - kHeapObjectTag), | 226 jsgraph()->IntPtrConstant(JSFunction::kLiteralsOffset - kHeapObjectTag), |
213 effect, control); | 227 effect, control); |
214 Node* vector = effect = graph()->NewNode( | 228 Node* vector = effect = graph()->NewNode( |
215 machine()->Load(MachineType::AnyTagged()), literals, | 229 machine()->Load(MachineType::AnyTagged()), literals, |
216 jsgraph()->IntPtrConstant(LiteralsArray::kFeedbackVectorOffset - | 230 jsgraph()->IntPtrConstant(LiteralsArray::kFeedbackVectorOffset - |
217 kHeapObjectTag), | 231 kHeapObjectTag), |
218 effect, control); | 232 effect, control); |
219 node->InsertInput(zone(), 0, jsgraph()->SmiConstant(p.feedback().index())); | 233 typedef decltype(callable)::Descriptor Descriptor; |
220 node->ReplaceInput(1, vector); | 234 node->InsertInputs(zone(), 0, 1); |
| 235 node->ReplaceInput(Descriptor::kSlot, |
| 236 jsgraph()->SmiConstant(p.feedback().index())); |
| 237 node->ReplaceInput(Descriptor::kVector, vector); |
221 node->ReplaceInput(4, effect); | 238 node->ReplaceInput(4, effect); |
222 ReplaceWithStubCall(node, callable, flags); | 239 ReplaceWithStubCall(node, callable, flags); |
223 } | 240 } |
224 | 241 |
225 | 242 |
226 void JSGenericLowering::LowerJSStoreProperty(Node* node) { | 243 void JSGenericLowering::LowerJSStoreProperty(Node* node) { |
227 Node* receiver = NodeProperties::GetValueInput(node, 0); | 244 Node* receiver = NodeProperties::GetValueInput(node, 0); |
228 Node* key = NodeProperties::GetValueInput(node, 1); | 245 Node* key = NodeProperties::GetValueInput(node, 1); |
229 Node* value = NodeProperties::GetValueInput(node, 2); | 246 Node* value = NodeProperties::GetValueInput(node, 2); |
230 Node* closure = NodeProperties::GetValueInput(node, 3); | 247 Node* closure = NodeProperties::GetValueInput(node, 3); |
231 Node* effect = NodeProperties::GetEffectInput(node); | 248 Node* effect = NodeProperties::GetEffectInput(node); |
232 Node* control = NodeProperties::GetControlInput(node); | 249 Node* control = NodeProperties::GetControlInput(node); |
233 CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); | 250 CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); |
234 PropertyAccess const& p = PropertyAccessOf(node->op()); | 251 PropertyAccess const& p = PropertyAccessOf(node->op()); |
235 LanguageMode language_mode = p.language_mode(); | 252 LanguageMode language_mode = p.language_mode(); |
236 Callable callable = | 253 auto callable = |
237 CodeFactory::KeyedStoreICInOptimizedCode(isolate(), language_mode); | 254 CodeFactory::KeyedStoreICInOptimizedCode(isolate(), language_mode); |
238 // Load the type feedback vector from the closure. | 255 // Load the type feedback vector from the closure. |
239 Node* literals = effect = graph()->NewNode( | 256 Node* literals = effect = graph()->NewNode( |
240 machine()->Load(MachineType::AnyTagged()), closure, | 257 machine()->Load(MachineType::AnyTagged()), closure, |
241 jsgraph()->IntPtrConstant(JSFunction::kLiteralsOffset - kHeapObjectTag), | 258 jsgraph()->IntPtrConstant(JSFunction::kLiteralsOffset - kHeapObjectTag), |
242 effect, control); | 259 effect, control); |
243 Node* vector = effect = graph()->NewNode( | 260 Node* vector = effect = graph()->NewNode( |
244 machine()->Load(MachineType::AnyTagged()), literals, | 261 machine()->Load(MachineType::AnyTagged()), literals, |
245 jsgraph()->IntPtrConstant(LiteralsArray::kFeedbackVectorOffset - | 262 jsgraph()->IntPtrConstant(LiteralsArray::kFeedbackVectorOffset - |
246 kHeapObjectTag), | 263 kHeapObjectTag), |
247 effect, control); | 264 effect, control); |
248 typedef StoreWithVectorDescriptor Descriptor; | 265 typedef decltype(callable)::Descriptor Descriptor; |
249 node->InsertInputs(zone(), 0, 1); | 266 node->InsertInputs(zone(), 0, 1); |
250 node->ReplaceInput(Descriptor::kReceiver, receiver); | 267 node->ReplaceInput(Descriptor::kReceiver, receiver); |
251 node->ReplaceInput(Descriptor::kName, key); | 268 node->ReplaceInput(Descriptor::kName, key); |
252 node->ReplaceInput(Descriptor::kValue, value); | 269 node->ReplaceInput(Descriptor::kValue, value); |
253 node->ReplaceInput(Descriptor::kSlot, | 270 node->ReplaceInput(Descriptor::kSlot, |
254 jsgraph()->SmiConstant(p.feedback().index())); | 271 jsgraph()->SmiConstant(p.feedback().index())); |
255 node->ReplaceInput(Descriptor::kVector, vector); | 272 node->ReplaceInput(Descriptor::kVector, vector); |
256 node->ReplaceInput(7, effect); | 273 node->ReplaceInput(7, effect); |
257 ReplaceWithStubCall(node, callable, flags); | 274 ReplaceWithStubCall(node, callable, flags); |
258 } | 275 } |
259 | 276 |
260 | 277 |
261 void JSGenericLowering::LowerJSStoreNamed(Node* node) { | 278 void JSGenericLowering::LowerJSStoreNamed(Node* node) { |
262 Node* receiver = NodeProperties::GetValueInput(node, 0); | 279 Node* receiver = NodeProperties::GetValueInput(node, 0); |
263 Node* value = NodeProperties::GetValueInput(node, 1); | 280 Node* value = NodeProperties::GetValueInput(node, 1); |
264 Node* closure = NodeProperties::GetValueInput(node, 2); | 281 Node* closure = NodeProperties::GetValueInput(node, 2); |
265 Node* effect = NodeProperties::GetEffectInput(node); | 282 Node* effect = NodeProperties::GetEffectInput(node); |
266 Node* control = NodeProperties::GetControlInput(node); | 283 Node* control = NodeProperties::GetControlInput(node); |
267 CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); | 284 CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); |
268 NamedAccess const& p = NamedAccessOf(node->op()); | 285 NamedAccess const& p = NamedAccessOf(node->op()); |
269 Callable callable = | 286 auto callable = |
270 CodeFactory::StoreICInOptimizedCode(isolate(), p.language_mode()); | 287 CodeFactory::StoreICInOptimizedCode(isolate(), p.language_mode()); |
271 // Load the type feedback vector from the closure. | 288 // Load the type feedback vector from the closure. |
272 Node* literals = effect = graph()->NewNode( | 289 Node* literals = effect = graph()->NewNode( |
273 machine()->Load(MachineType::AnyTagged()), closure, | 290 machine()->Load(MachineType::AnyTagged()), closure, |
274 jsgraph()->IntPtrConstant(JSFunction::kLiteralsOffset - kHeapObjectTag), | 291 jsgraph()->IntPtrConstant(JSFunction::kLiteralsOffset - kHeapObjectTag), |
275 effect, control); | 292 effect, control); |
276 Node* vector = effect = graph()->NewNode( | 293 Node* vector = effect = graph()->NewNode( |
277 machine()->Load(MachineType::AnyTagged()), literals, | 294 machine()->Load(MachineType::AnyTagged()), literals, |
278 jsgraph()->IntPtrConstant(LiteralsArray::kFeedbackVectorOffset - | 295 jsgraph()->IntPtrConstant(LiteralsArray::kFeedbackVectorOffset - |
279 kHeapObjectTag), | 296 kHeapObjectTag), |
280 effect, control); | 297 effect, control); |
281 typedef StoreWithVectorDescriptor Descriptor; | 298 typedef decltype(callable)::Descriptor Descriptor; |
282 node->InsertInputs(zone(), 0, 2); | 299 node->InsertInputs(zone(), 0, 2); |
283 node->ReplaceInput(Descriptor::kReceiver, receiver); | 300 node->ReplaceInput(Descriptor::kReceiver, receiver); |
284 node->ReplaceInput(Descriptor::kName, jsgraph()->HeapConstant(p.name())); | 301 node->ReplaceInput(Descriptor::kName, jsgraph()->HeapConstant(p.name())); |
285 node->ReplaceInput(Descriptor::kValue, value); | 302 node->ReplaceInput(Descriptor::kValue, value); |
286 node->ReplaceInput(Descriptor::kSlot, | 303 node->ReplaceInput(Descriptor::kSlot, |
287 jsgraph()->SmiConstant(p.feedback().index())); | 304 jsgraph()->SmiConstant(p.feedback().index())); |
288 node->ReplaceInput(Descriptor::kVector, vector); | 305 node->ReplaceInput(Descriptor::kVector, vector); |
289 node->ReplaceInput(7, effect); | 306 node->ReplaceInput(7, effect); |
290 ReplaceWithStubCall(node, callable, flags); | 307 ReplaceWithStubCall(node, callable, flags); |
291 } | 308 } |
292 | 309 |
293 | 310 |
294 void JSGenericLowering::LowerJSStoreGlobal(Node* node) { | 311 void JSGenericLowering::LowerJSStoreGlobal(Node* node) { |
295 Node* value = NodeProperties::GetValueInput(node, 0); | 312 Node* value = NodeProperties::GetValueInput(node, 0); |
296 Node* closure = NodeProperties::GetValueInput(node, 1); | 313 Node* closure = NodeProperties::GetValueInput(node, 1); |
297 Node* context = NodeProperties::GetContextInput(node); | 314 Node* context = NodeProperties::GetContextInput(node); |
298 Node* effect = NodeProperties::GetEffectInput(node); | 315 Node* effect = NodeProperties::GetEffectInput(node); |
299 Node* control = NodeProperties::GetControlInput(node); | 316 Node* control = NodeProperties::GetControlInput(node); |
300 CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); | 317 CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); |
301 const StoreGlobalParameters& p = StoreGlobalParametersOf(node->op()); | 318 const StoreGlobalParameters& p = StoreGlobalParametersOf(node->op()); |
302 Callable callable = | 319 auto callable = |
303 CodeFactory::StoreICInOptimizedCode(isolate(), p.language_mode()); | 320 CodeFactory::StoreICInOptimizedCode(isolate(), p.language_mode()); |
304 // Load the type feedback vector from the closure. | 321 // Load the type feedback vector from the closure. |
305 Node* literals = effect = graph()->NewNode( | 322 Node* literals = effect = graph()->NewNode( |
306 machine()->Load(MachineType::AnyTagged()), closure, | 323 machine()->Load(MachineType::AnyTagged()), closure, |
307 jsgraph()->IntPtrConstant(JSFunction::kLiteralsOffset - kHeapObjectTag), | 324 jsgraph()->IntPtrConstant(JSFunction::kLiteralsOffset - kHeapObjectTag), |
308 effect, control); | 325 effect, control); |
309 Node* vector = effect = graph()->NewNode( | 326 Node* vector = effect = graph()->NewNode( |
310 machine()->Load(MachineType::AnyTagged()), literals, | 327 machine()->Load(MachineType::AnyTagged()), literals, |
311 jsgraph()->IntPtrConstant(LiteralsArray::kFeedbackVectorOffset - | 328 jsgraph()->IntPtrConstant(LiteralsArray::kFeedbackVectorOffset - |
312 kHeapObjectTag), | 329 kHeapObjectTag), |
313 effect, control); | 330 effect, control); |
314 // Load global object from the context. | 331 // Load global object from the context. |
315 Node* native_context = effect = | 332 Node* native_context = effect = |
316 graph()->NewNode(machine()->Load(MachineType::AnyTagged()), context, | 333 graph()->NewNode(machine()->Load(MachineType::AnyTagged()), context, |
317 jsgraph()->IntPtrConstant( | 334 jsgraph()->IntPtrConstant( |
318 Context::SlotOffset(Context::NATIVE_CONTEXT_INDEX)), | 335 Context::SlotOffset(Context::NATIVE_CONTEXT_INDEX)), |
319 effect, control); | 336 effect, control); |
320 Node* global = effect = graph()->NewNode( | 337 Node* global = effect = graph()->NewNode( |
321 machine()->Load(MachineType::AnyTagged()), native_context, | 338 machine()->Load(MachineType::AnyTagged()), native_context, |
322 jsgraph()->IntPtrConstant(Context::SlotOffset(Context::EXTENSION_INDEX)), | 339 jsgraph()->IntPtrConstant(Context::SlotOffset(Context::EXTENSION_INDEX)), |
323 effect, control); | 340 effect, control); |
324 typedef StoreWithVectorDescriptor Descriptor; | 341 typedef decltype(callable)::Descriptor Descriptor; |
325 node->InsertInputs(zone(), 0, 3); | 342 node->InsertInputs(zone(), 0, 3); |
326 node->ReplaceInput(Descriptor::kReceiver, global); | 343 node->ReplaceInput(Descriptor::kReceiver, global); |
327 node->ReplaceInput(Descriptor::kName, jsgraph()->HeapConstant(p.name())); | 344 node->ReplaceInput(Descriptor::kName, jsgraph()->HeapConstant(p.name())); |
328 node->ReplaceInput(Descriptor::kValue, value); | 345 node->ReplaceInput(Descriptor::kValue, value); |
329 node->ReplaceInput(Descriptor::kSlot, | 346 node->ReplaceInput(Descriptor::kSlot, |
330 jsgraph()->SmiConstant(p.feedback().index())); | 347 jsgraph()->SmiConstant(p.feedback().index())); |
331 node->ReplaceInput(Descriptor::kVector, vector); | 348 node->ReplaceInput(Descriptor::kVector, vector); |
332 node->ReplaceInput(7, effect); | 349 node->ReplaceInput(7, effect); |
333 ReplaceWithStubCall(node, callable, flags); | 350 ReplaceWithStubCall(node, callable, flags); |
334 } | 351 } |
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
692 } | 709 } |
693 | 710 |
694 | 711 |
695 MachineOperatorBuilder* JSGenericLowering::machine() const { | 712 MachineOperatorBuilder* JSGenericLowering::machine() const { |
696 return jsgraph()->machine(); | 713 return jsgraph()->machine(); |
697 } | 714 } |
698 | 715 |
699 } // namespace compiler | 716 } // namespace compiler |
700 } // namespace internal | 717 } // namespace internal |
701 } // namespace v8 | 718 } // namespace v8 |
OLD | NEW |