| 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 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); | 325 CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); |
| 326 const LoadNamedParameters& p = LoadNamedParametersOf(node->op()); | 326 const LoadNamedParameters& p = LoadNamedParametersOf(node->op()); |
| 327 Callable callable = CodeFactory::LoadICInOptimizedCode( | 327 Callable callable = CodeFactory::LoadICInOptimizedCode( |
| 328 isolate(), p.contextual_mode(), UNINITIALIZED); | 328 isolate(), p.contextual_mode(), UNINITIALIZED); |
| 329 node->InsertInput(zone(), 1, jsgraph()->HeapConstant(p.name())); | 329 node->InsertInput(zone(), 1, jsgraph()->HeapConstant(p.name())); |
| 330 node->InsertInput(zone(), 2, jsgraph()->SmiConstant(p.feedback().index())); | 330 node->InsertInput(zone(), 2, jsgraph()->SmiConstant(p.feedback().index())); |
| 331 ReplaceWithStubCall(node, callable, flags); | 331 ReplaceWithStubCall(node, callable, flags); |
| 332 } | 332 } |
| 333 | 333 |
| 334 | 334 |
| 335 void JSGenericLowering::LowerJSLoadGlobal(Node* node) { |
| 336 CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); |
| 337 const LoadNamedParameters& p = LoadGlobalParametersOf(node->op()); |
| 338 Callable callable = CodeFactory::LoadICInOptimizedCode( |
| 339 isolate(), p.contextual_mode(), UNINITIALIZED); |
| 340 node->InsertInput(zone(), 1, jsgraph()->HeapConstant(p.name())); |
| 341 node->InsertInput(zone(), 2, jsgraph()->SmiConstant(p.feedback().index())); |
| 342 ReplaceWithStubCall(node, callable, flags); |
| 343 } |
| 344 |
| 345 |
| 335 void JSGenericLowering::LowerJSStoreProperty(Node* node) { | 346 void JSGenericLowering::LowerJSStoreProperty(Node* node) { |
| 336 CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); | 347 CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); |
| 337 const StorePropertyParameters& p = StorePropertyParametersOf(node->op()); | 348 const StorePropertyParameters& p = StorePropertyParametersOf(node->op()); |
| 338 LanguageMode language_mode = OpParameter<LanguageMode>(node); | 349 LanguageMode language_mode = OpParameter<LanguageMode>(node); |
| 339 Callable callable = CodeFactory::KeyedStoreICInOptimizedCode( | 350 Callable callable = CodeFactory::KeyedStoreICInOptimizedCode( |
| 340 isolate(), language_mode, UNINITIALIZED); | 351 isolate(), language_mode, UNINITIALIZED); |
| 341 if (FLAG_vector_stores) { | 352 if (FLAG_vector_stores) { |
| 342 DCHECK(p.feedback().index() != -1); | 353 DCHECK(p.feedback().index() != -1); |
| 343 node->InsertInput(zone(), 3, jsgraph()->SmiConstant(p.feedback().index())); | 354 node->InsertInput(zone(), 3, jsgraph()->SmiConstant(p.feedback().index())); |
| 344 } else { | 355 } else { |
| (...skipping 13 matching lines...) Expand all Loading... |
| 358 DCHECK(p.feedback().index() != -1); | 369 DCHECK(p.feedback().index() != -1); |
| 359 node->InsertInput(zone(), 3, jsgraph()->SmiConstant(p.feedback().index())); | 370 node->InsertInput(zone(), 3, jsgraph()->SmiConstant(p.feedback().index())); |
| 360 } else { | 371 } else { |
| 361 node->RemoveInput(3); | 372 node->RemoveInput(3); |
| 362 } | 373 } |
| 363 ReplaceWithStubCall(node, callable, | 374 ReplaceWithStubCall(node, callable, |
| 364 CallDescriptor::kPatchableCallSite | flags); | 375 CallDescriptor::kPatchableCallSite | flags); |
| 365 } | 376 } |
| 366 | 377 |
| 367 | 378 |
| 379 void JSGenericLowering::LowerJSStoreGlobal(Node* node) { |
| 380 CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); |
| 381 const StoreNamedParameters& p = StoreGlobalParametersOf(node->op()); |
| 382 Callable callable = CodeFactory::StoreIC(isolate(), p.language_mode()); |
| 383 node->InsertInput(zone(), 1, jsgraph()->HeapConstant(p.name())); |
| 384 if (FLAG_vector_stores) { |
| 385 DCHECK(p.feedback().index() != -1); |
| 386 node->InsertInput(zone(), 3, jsgraph()->SmiConstant(p.feedback().index())); |
| 387 } else { |
| 388 node->RemoveInput(3); |
| 389 } |
| 390 ReplaceWithStubCall(node, callable, |
| 391 CallDescriptor::kPatchableCallSite | flags); |
| 392 } |
| 393 |
| 394 |
| 368 void JSGenericLowering::LowerJSDeleteProperty(Node* node) { | 395 void JSGenericLowering::LowerJSDeleteProperty(Node* node) { |
| 369 LanguageMode language_mode = OpParameter<LanguageMode>(node); | 396 LanguageMode language_mode = OpParameter<LanguageMode>(node); |
| 370 ReplaceWithBuiltinCall(node, Builtins::DELETE, 3); | 397 ReplaceWithBuiltinCall(node, Builtins::DELETE, 3); |
| 371 node->InsertInput(zone(), 4, jsgraph()->SmiConstant(language_mode)); | 398 node->InsertInput(zone(), 4, jsgraph()->SmiConstant(language_mode)); |
| 372 } | 399 } |
| 373 | 400 |
| 374 | 401 |
| 375 void JSGenericLowering::LowerJSHasProperty(Node* node) { | 402 void JSGenericLowering::LowerJSHasProperty(Node* node) { |
| 376 ReplaceWithBuiltinCall(node, Builtins::IN, 2); | 403 ReplaceWithBuiltinCall(node, Builtins::IN, 2); |
| 377 } | 404 } |
| (...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 778 } | 805 } |
| 779 | 806 |
| 780 | 807 |
| 781 MachineOperatorBuilder* JSGenericLowering::machine() const { | 808 MachineOperatorBuilder* JSGenericLowering::machine() const { |
| 782 return jsgraph()->machine(); | 809 return jsgraph()->machine(); |
| 783 } | 810 } |
| 784 | 811 |
| 785 } // namespace compiler | 812 } // namespace compiler |
| 786 } // namespace internal | 813 } // namespace internal |
| 787 } // namespace v8 | 814 } // namespace v8 |
| OLD | NEW |