| 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 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 node->InsertInput(zone(), 2, jsgraph()->SmiConstant(p.feedback().index())); | 346 node->InsertInput(zone(), 2, jsgraph()->SmiConstant(p.feedback().index())); |
| 347 node->InsertInput(zone(), 3, jsgraph()->HeapConstant(p.feedback().vector())); | 347 node->InsertInput(zone(), 3, jsgraph()->HeapConstant(p.feedback().vector())); |
| 348 ReplaceWithStubCall(node, callable, | 348 ReplaceWithStubCall(node, callable, |
| 349 CallDescriptor::kPatchableCallSite | flags); | 349 CallDescriptor::kPatchableCallSite | flags); |
| 350 } | 350 } |
| 351 | 351 |
| 352 | 352 |
| 353 void JSGenericLowering::LowerJSLoadNamed(Node* node) { | 353 void JSGenericLowering::LowerJSLoadNamed(Node* node) { |
| 354 CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); | 354 CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); |
| 355 const LoadNamedParameters& p = LoadNamedParametersOf(node->op()); | 355 const LoadNamedParameters& p = LoadNamedParametersOf(node->op()); |
| 356 Callable callable = | 356 Callable callable = CodeFactory::LoadICInOptimizedCode( |
| 357 p.load_ic() == NAMED | 357 isolate(), p.contextual_mode(), UNINITIALIZED); |
| 358 ? CodeFactory::LoadICInOptimizedCode(isolate(), p.contextual_mode(), | |
| 359 UNINITIALIZED) | |
| 360 : CodeFactory::KeyedLoadICInOptimizedCode(isolate(), UNINITIALIZED); | |
| 361 node->InsertInput(zone(), 1, jsgraph()->HeapConstant(p.name())); | 358 node->InsertInput(zone(), 1, jsgraph()->HeapConstant(p.name())); |
| 362 node->InsertInput(zone(), 2, jsgraph()->SmiConstant(p.feedback().index())); | 359 node->InsertInput(zone(), 2, jsgraph()->SmiConstant(p.feedback().index())); |
| 363 node->InsertInput(zone(), 3, jsgraph()->HeapConstant(p.feedback().vector())); | 360 node->InsertInput(zone(), 3, jsgraph()->HeapConstant(p.feedback().vector())); |
| 364 ReplaceWithStubCall(node, callable, | 361 ReplaceWithStubCall(node, callable, |
| 365 CallDescriptor::kPatchableCallSite | flags); | 362 CallDescriptor::kPatchableCallSite | flags); |
| 366 } | 363 } |
| 367 | 364 |
| 368 | 365 |
| 369 void JSGenericLowering::LowerJSStoreProperty(Node* node) { | 366 void JSGenericLowering::LowerJSStoreProperty(Node* node) { |
| 370 CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); | 367 CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); |
| 371 LanguageMode language_mode = OpParameter<LanguageMode>(node); | 368 LanguageMode language_mode = OpParameter<LanguageMode>(node); |
| 372 Callable callable = CodeFactory::KeyedStoreICInOptimizedCode( | 369 Callable callable = CodeFactory::KeyedStoreICInOptimizedCode( |
| 373 isolate(), language_mode, UNINITIALIZED); | 370 isolate(), language_mode, UNINITIALIZED); |
| 374 ReplaceWithStubCall(node, callable, | 371 ReplaceWithStubCall(node, callable, |
| 375 CallDescriptor::kPatchableCallSite | flags); | 372 CallDescriptor::kPatchableCallSite | flags); |
| 376 } | 373 } |
| 377 | 374 |
| 378 | 375 |
| 379 void JSGenericLowering::LowerJSStoreNamed(Node* node) { | 376 void JSGenericLowering::LowerJSStoreNamed(Node* node) { |
| 380 CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); | 377 CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); |
| 381 const StoreNamedParameters& p = StoreNamedParametersOf(node->op()); | 378 const StoreNamedParameters& p = StoreNamedParametersOf(node->op()); |
| 382 Callable callable = p.store_ic() == NAMED | 379 Callable callable = CodeFactory::StoreIC(isolate(), p.language_mode()); |
| 383 ? CodeFactory::StoreIC(isolate(), p.language_mode()) | |
| 384 : CodeFactory::KeyedStoreICInOptimizedCode( | |
| 385 isolate(), p.language_mode(), UNINITIALIZED); | |
| 386 node->InsertInput(zone(), 1, jsgraph()->HeapConstant(p.name())); | 380 node->InsertInput(zone(), 1, jsgraph()->HeapConstant(p.name())); |
| 387 ReplaceWithStubCall(node, callable, | 381 ReplaceWithStubCall(node, callable, |
| 388 CallDescriptor::kPatchableCallSite | flags); | 382 CallDescriptor::kPatchableCallSite | flags); |
| 389 } | 383 } |
| 390 | 384 |
| 391 | 385 |
| 392 void JSGenericLowering::LowerJSDeleteProperty(Node* node) { | 386 void JSGenericLowering::LowerJSDeleteProperty(Node* node) { |
| 393 LanguageMode language_mode = OpParameter<LanguageMode>(node); | 387 LanguageMode language_mode = OpParameter<LanguageMode>(node); |
| 394 ReplaceWithBuiltinCall(node, Builtins::DELETE, 3); | 388 ReplaceWithBuiltinCall(node, Builtins::DELETE, 3); |
| 395 node->InsertInput(zone(), 4, jsgraph()->SmiConstant(language_mode)); | 389 node->InsertInput(zone(), 4, jsgraph()->SmiConstant(language_mode)); |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 612 } | 606 } |
| 613 | 607 |
| 614 | 608 |
| 615 MachineOperatorBuilder* JSGenericLowering::machine() const { | 609 MachineOperatorBuilder* JSGenericLowering::machine() const { |
| 616 return jsgraph()->machine(); | 610 return jsgraph()->machine(); |
| 617 } | 611 } |
| 618 | 612 |
| 619 } // namespace compiler | 613 } // namespace compiler |
| 620 } // namespace internal | 614 } // namespace internal |
| 621 } // namespace v8 | 615 } // namespace v8 |
| OLD | NEW |