| 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 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 node->InsertInput(zone(), 2, jsgraph()->SmiConstant(p.feedback().index())); | 313 node->InsertInput(zone(), 2, jsgraph()->SmiConstant(p.feedback().index())); |
| 314 node->InsertInput(zone(), 3, | 314 node->InsertInput(zone(), 3, |
| 315 jsgraph()->HeapConstant(p.feedback().vector())); | 315 jsgraph()->HeapConstant(p.feedback().vector())); |
| 316 } | 316 } |
| 317 ReplaceWithStubCall(node, callable, CallDescriptor::kPatchableCallSite); | 317 ReplaceWithStubCall(node, callable, CallDescriptor::kPatchableCallSite); |
| 318 } | 318 } |
| 319 | 319 |
| 320 | 320 |
| 321 void JSGenericLowering::LowerJSLoadNamed(Node* node) { | 321 void JSGenericLowering::LowerJSLoadNamed(Node* node) { |
| 322 const LoadNamedParameters& p = LoadNamedParametersOf(node->op()); | 322 const LoadNamedParameters& p = LoadNamedParametersOf(node->op()); |
| 323 Callable callable = CodeFactory::LoadICInOptimizedCode( | 323 Callable callable = |
| 324 isolate(), p.contextual_mode(), UNINITIALIZED); | 324 p.load_ic() == NAMED |
| 325 ? CodeFactory::LoadICInOptimizedCode(isolate(), p.contextual_mode(), |
| 326 UNINITIALIZED) |
| 327 : CodeFactory::KeyedLoadICInOptimizedCode(isolate(), UNINITIALIZED); |
| 325 node->InsertInput(zone(), 1, jsgraph()->HeapConstant(p.name())); | 328 node->InsertInput(zone(), 1, jsgraph()->HeapConstant(p.name())); |
| 326 if (FLAG_vector_ics) { | 329 if (FLAG_vector_ics) { |
| 327 node->InsertInput(zone(), 2, jsgraph()->SmiConstant(p.feedback().index())); | 330 node->InsertInput(zone(), 2, jsgraph()->SmiConstant(p.feedback().index())); |
| 328 node->InsertInput(zone(), 3, | 331 node->InsertInput(zone(), 3, |
| 329 jsgraph()->HeapConstant(p.feedback().vector())); | 332 jsgraph()->HeapConstant(p.feedback().vector())); |
| 330 } | 333 } |
| 331 ReplaceWithStubCall(node, callable, CallDescriptor::kPatchableCallSite); | 334 ReplaceWithStubCall(node, callable, CallDescriptor::kPatchableCallSite); |
| 332 } | 335 } |
| 333 | 336 |
| 334 | 337 |
| 335 void JSGenericLowering::LowerJSStoreProperty(Node* node) { | 338 void JSGenericLowering::LowerJSStoreProperty(Node* node) { |
| 336 LanguageMode language_mode = OpParameter<LanguageMode>(node); | 339 LanguageMode language_mode = OpParameter<LanguageMode>(node); |
| 337 Callable callable = CodeFactory::KeyedStoreICInOptimizedCode( | 340 Callable callable = CodeFactory::KeyedStoreICInOptimizedCode( |
| 338 isolate(), language_mode, UNINITIALIZED); | 341 isolate(), language_mode, UNINITIALIZED); |
| 339 ReplaceWithStubCall(node, callable, CallDescriptor::kPatchableCallSite); | 342 ReplaceWithStubCall(node, callable, CallDescriptor::kPatchableCallSite); |
| 340 } | 343 } |
| 341 | 344 |
| 342 | 345 |
| 343 void JSGenericLowering::LowerJSStoreNamed(Node* node) { | 346 void JSGenericLowering::LowerJSStoreNamed(Node* node) { |
| 344 const StoreNamedParameters& p = StoreNamedParametersOf(node->op()); | 347 const StoreNamedParameters& p = StoreNamedParametersOf(node->op()); |
| 345 Callable callable = CodeFactory::StoreIC(isolate(), p.language_mode()); | 348 Callable callable = p.store_ic() == NAMED |
| 349 ? CodeFactory::StoreIC(isolate(), p.language_mode()) |
| 350 : CodeFactory::KeyedStoreICInOptimizedCode( |
| 351 isolate(), p.language_mode(), UNINITIALIZED); |
| 346 node->InsertInput(zone(), 1, jsgraph()->HeapConstant(p.name())); | 352 node->InsertInput(zone(), 1, jsgraph()->HeapConstant(p.name())); |
| 347 ReplaceWithStubCall(node, callable, CallDescriptor::kPatchableCallSite); | 353 ReplaceWithStubCall(node, callable, CallDescriptor::kPatchableCallSite); |
| 348 } | 354 } |
| 349 | 355 |
| 350 | 356 |
| 351 void JSGenericLowering::LowerJSDeleteProperty(Node* node) { | 357 void JSGenericLowering::LowerJSDeleteProperty(Node* node) { |
| 352 LanguageMode language_mode = OpParameter<LanguageMode>(node); | 358 LanguageMode language_mode = OpParameter<LanguageMode>(node); |
| 353 ReplaceWithBuiltinCall(node, Builtins::DELETE, 3); | 359 ReplaceWithBuiltinCall(node, Builtins::DELETE, 3); |
| 354 node->InsertInput(zone(), 4, jsgraph()->SmiConstant(language_mode)); | 360 node->InsertInput(zone(), 4, jsgraph()->SmiConstant(language_mode)); |
| 355 } | 361 } |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 545 } | 551 } |
| 546 | 552 |
| 547 | 553 |
| 548 MachineOperatorBuilder* JSGenericLowering::machine() const { | 554 MachineOperatorBuilder* JSGenericLowering::machine() const { |
| 549 return jsgraph()->machine(); | 555 return jsgraph()->machine(); |
| 550 } | 556 } |
| 551 | 557 |
| 552 } // namespace compiler | 558 } // namespace compiler |
| 553 } // namespace internal | 559 } // namespace internal |
| 554 } // namespace v8 | 560 } // namespace v8 |
| OLD | NEW |