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 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 ReplaceWithStubCall(node, callable, flags); | 263 ReplaceWithStubCall(node, callable, flags); |
264 } | 264 } |
265 | 265 |
266 | 266 |
267 void JSGenericLowering::LowerJSLoadProperty(Node* node) { | 267 void JSGenericLowering::LowerJSLoadProperty(Node* node) { |
268 Node* closure = NodeProperties::GetValueInput(node, 2); | 268 Node* closure = NodeProperties::GetValueInput(node, 2); |
269 Node* effect = NodeProperties::GetEffectInput(node); | 269 Node* effect = NodeProperties::GetEffectInput(node); |
270 Node* control = NodeProperties::GetControlInput(node); | 270 Node* control = NodeProperties::GetControlInput(node); |
271 CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); | 271 CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); |
272 const PropertyAccess& p = PropertyAccessOf(node->op()); | 272 const PropertyAccess& p = PropertyAccessOf(node->op()); |
273 Callable callable = CodeFactory::KeyedLoadICInOptimizedCode( | 273 Callable callable = |
274 isolate(), p.language_mode(), UNINITIALIZED); | 274 CodeFactory::KeyedLoadICInOptimizedCode(isolate(), UNINITIALIZED); |
275 // Load the type feedback vector from the closure. | 275 // Load the type feedback vector from the closure. |
276 Node* shared_info = effect = graph()->NewNode( | 276 Node* shared_info = effect = graph()->NewNode( |
277 machine()->Load(MachineType::AnyTagged()), closure, | 277 machine()->Load(MachineType::AnyTagged()), closure, |
278 jsgraph()->IntPtrConstant(JSFunction::kSharedFunctionInfoOffset - | 278 jsgraph()->IntPtrConstant(JSFunction::kSharedFunctionInfoOffset - |
279 kHeapObjectTag), | 279 kHeapObjectTag), |
280 effect, control); | 280 effect, control); |
281 Node* vector = effect = graph()->NewNode( | 281 Node* vector = effect = graph()->NewNode( |
282 machine()->Load(MachineType::AnyTagged()), shared_info, | 282 machine()->Load(MachineType::AnyTagged()), shared_info, |
283 jsgraph()->IntPtrConstant(SharedFunctionInfo::kFeedbackVectorOffset - | 283 jsgraph()->IntPtrConstant(SharedFunctionInfo::kFeedbackVectorOffset - |
284 kHeapObjectTag), | 284 kHeapObjectTag), |
285 effect, control); | 285 effect, control); |
286 node->InsertInput(zone(), 2, jsgraph()->SmiConstant(p.feedback().index())); | 286 node->InsertInput(zone(), 2, jsgraph()->SmiConstant(p.feedback().index())); |
287 node->ReplaceInput(3, vector); | 287 node->ReplaceInput(3, vector); |
288 node->ReplaceInput(6, effect); | 288 node->ReplaceInput(6, effect); |
289 ReplaceWithStubCall(node, callable, flags); | 289 ReplaceWithStubCall(node, callable, flags); |
290 } | 290 } |
291 | 291 |
292 | 292 |
293 void JSGenericLowering::LowerJSLoadNamed(Node* node) { | 293 void JSGenericLowering::LowerJSLoadNamed(Node* node) { |
294 Node* closure = NodeProperties::GetValueInput(node, 1); | 294 Node* closure = NodeProperties::GetValueInput(node, 1); |
295 Node* effect = NodeProperties::GetEffectInput(node); | 295 Node* effect = NodeProperties::GetEffectInput(node); |
296 Node* control = NodeProperties::GetControlInput(node); | 296 Node* control = NodeProperties::GetControlInput(node); |
297 CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); | 297 CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); |
298 NamedAccess const& p = NamedAccessOf(node->op()); | 298 NamedAccess const& p = NamedAccessOf(node->op()); |
299 Callable callable = CodeFactory::LoadICInOptimizedCode( | 299 Callable callable = CodeFactory::LoadICInOptimizedCode( |
300 isolate(), NOT_INSIDE_TYPEOF, p.language_mode(), UNINITIALIZED); | 300 isolate(), NOT_INSIDE_TYPEOF, UNINITIALIZED); |
301 // Load the type feedback vector from the closure. | 301 // Load the type feedback vector from the closure. |
302 Node* shared_info = effect = graph()->NewNode( | 302 Node* shared_info = effect = graph()->NewNode( |
303 machine()->Load(MachineType::AnyTagged()), closure, | 303 machine()->Load(MachineType::AnyTagged()), closure, |
304 jsgraph()->IntPtrConstant(JSFunction::kSharedFunctionInfoOffset - | 304 jsgraph()->IntPtrConstant(JSFunction::kSharedFunctionInfoOffset - |
305 kHeapObjectTag), | 305 kHeapObjectTag), |
306 effect, control); | 306 effect, control); |
307 Node* vector = effect = graph()->NewNode( | 307 Node* vector = effect = graph()->NewNode( |
308 machine()->Load(MachineType::AnyTagged()), shared_info, | 308 machine()->Load(MachineType::AnyTagged()), shared_info, |
309 jsgraph()->IntPtrConstant(SharedFunctionInfo::kFeedbackVectorOffset - | 309 jsgraph()->IntPtrConstant(SharedFunctionInfo::kFeedbackVectorOffset - |
310 kHeapObjectTag), | 310 kHeapObjectTag), |
311 effect, control); | 311 effect, control); |
312 node->InsertInput(zone(), 1, jsgraph()->HeapConstant(p.name())); | 312 node->InsertInput(zone(), 1, jsgraph()->HeapConstant(p.name())); |
313 node->InsertInput(zone(), 2, jsgraph()->SmiConstant(p.feedback().index())); | 313 node->InsertInput(zone(), 2, jsgraph()->SmiConstant(p.feedback().index())); |
314 node->ReplaceInput(3, vector); | 314 node->ReplaceInput(3, vector); |
315 node->ReplaceInput(6, effect); | 315 node->ReplaceInput(6, effect); |
316 ReplaceWithStubCall(node, callable, flags); | 316 ReplaceWithStubCall(node, callable, flags); |
317 } | 317 } |
318 | 318 |
319 | 319 |
320 void JSGenericLowering::LowerJSLoadGlobal(Node* node) { | 320 void JSGenericLowering::LowerJSLoadGlobal(Node* node) { |
321 Node* closure = NodeProperties::GetValueInput(node, 0); | 321 Node* closure = NodeProperties::GetValueInput(node, 0); |
322 Node* context = NodeProperties::GetContextInput(node); | 322 Node* context = NodeProperties::GetContextInput(node); |
323 Node* effect = NodeProperties::GetEffectInput(node); | 323 Node* effect = NodeProperties::GetEffectInput(node); |
324 Node* control = NodeProperties::GetControlInput(node); | 324 Node* control = NodeProperties::GetControlInput(node); |
325 CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); | 325 CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); |
326 const LoadGlobalParameters& p = LoadGlobalParametersOf(node->op()); | 326 const LoadGlobalParameters& p = LoadGlobalParametersOf(node->op()); |
327 Callable callable = CodeFactory::LoadICInOptimizedCode( | 327 Callable callable = CodeFactory::LoadICInOptimizedCode( |
328 isolate(), p.typeof_mode(), SLOPPY, UNINITIALIZED); | 328 isolate(), p.typeof_mode(), UNINITIALIZED); |
329 // Load the type feedback vector from the closure. | 329 // Load the type feedback vector from the closure. |
330 Node* shared_info = effect = graph()->NewNode( | 330 Node* shared_info = effect = graph()->NewNode( |
331 machine()->Load(MachineType::AnyTagged()), closure, | 331 machine()->Load(MachineType::AnyTagged()), closure, |
332 jsgraph()->IntPtrConstant(JSFunction::kSharedFunctionInfoOffset - | 332 jsgraph()->IntPtrConstant(JSFunction::kSharedFunctionInfoOffset - |
333 kHeapObjectTag), | 333 kHeapObjectTag), |
334 effect, control); | 334 effect, control); |
335 Node* vector = effect = graph()->NewNode( | 335 Node* vector = effect = graph()->NewNode( |
336 machine()->Load(MachineType::AnyTagged()), shared_info, | 336 machine()->Load(MachineType::AnyTagged()), shared_info, |
337 jsgraph()->IntPtrConstant(SharedFunctionInfo::kFeedbackVectorOffset - | 337 jsgraph()->IntPtrConstant(SharedFunctionInfo::kFeedbackVectorOffset - |
338 kHeapObjectTag), | 338 kHeapObjectTag), |
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
859 } | 859 } |
860 | 860 |
861 | 861 |
862 MachineOperatorBuilder* JSGenericLowering::machine() const { | 862 MachineOperatorBuilder* JSGenericLowering::machine() const { |
863 return jsgraph()->machine(); | 863 return jsgraph()->machine(); |
864 } | 864 } |
865 | 865 |
866 } // namespace compiler | 866 } // namespace compiler |
867 } // namespace internal | 867 } // namespace internal |
868 } // namespace v8 | 868 } // namespace v8 |
OLD | NEW |