| 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 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 | 279 |
| 280 void JSGenericLowering::LowerJSToObject(Node* node) { | 280 void JSGenericLowering::LowerJSToObject(Node* node) { |
| 281 CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); | 281 CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); |
| 282 Callable callable = CodeFactory::ToObject(isolate()); | 282 Callable callable = CodeFactory::ToObject(isolate()); |
| 283 ReplaceWithStubCall(node, callable, flags); | 283 ReplaceWithStubCall(node, callable, flags); |
| 284 } | 284 } |
| 285 | 285 |
| 286 | 286 |
| 287 void JSGenericLowering::LowerJSLoadProperty(Node* node) { | 287 void JSGenericLowering::LowerJSLoadProperty(Node* node) { |
| 288 CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); | 288 CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); |
| 289 const LoadPropertyParameters& p = LoadPropertyParametersOf(node->op()); | 289 const PropertyAccess& p = PropertyAccessOf(node->op()); |
| 290 Callable callable = CodeFactory::KeyedLoadICInOptimizedCode( | 290 Callable callable = CodeFactory::KeyedLoadICInOptimizedCode( |
| 291 isolate(), p.language_mode(), UNINITIALIZED); | 291 isolate(), p.language_mode(), UNINITIALIZED); |
| 292 node->InsertInput(zone(), 2, jsgraph()->SmiConstant(p.feedback().index())); | 292 node->InsertInput(zone(), 2, jsgraph()->SmiConstant(p.feedback().index())); |
| 293 ReplaceWithStubCall(node, callable, flags); | 293 ReplaceWithStubCall(node, callable, flags); |
| 294 } | 294 } |
| 295 | 295 |
| 296 | 296 |
| 297 void JSGenericLowering::LowerJSLoadNamed(Node* node) { | 297 void JSGenericLowering::LowerJSLoadNamed(Node* node) { |
| 298 CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); | 298 CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); |
| 299 const LoadNamedParameters& p = LoadNamedParametersOf(node->op()); | 299 NamedAccess const& p = NamedAccessOf(node->op()); |
| 300 Callable callable = CodeFactory::LoadICInOptimizedCode( | 300 Callable callable = CodeFactory::LoadICInOptimizedCode( |
| 301 isolate(), NOT_INSIDE_TYPEOF, p.language_mode(), UNINITIALIZED); | 301 isolate(), NOT_INSIDE_TYPEOF, p.language_mode(), UNINITIALIZED); |
| 302 node->InsertInput(zone(), 1, jsgraph()->HeapConstant(p.name())); | 302 node->InsertInput(zone(), 1, jsgraph()->HeapConstant(p.name())); |
| 303 node->InsertInput(zone(), 2, jsgraph()->SmiConstant(p.feedback().index())); | 303 node->InsertInput(zone(), 2, jsgraph()->SmiConstant(p.feedback().index())); |
| 304 ReplaceWithStubCall(node, callable, flags); | 304 ReplaceWithStubCall(node, callable, flags); |
| 305 } | 305 } |
| 306 | 306 |
| 307 | 307 |
| 308 void JSGenericLowering::LowerJSLoadGlobal(Node* node) { | 308 void JSGenericLowering::LowerJSLoadGlobal(Node* node) { |
| 309 CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); | 309 CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 323 node->RemoveInput(0); // script context | 323 node->RemoveInput(0); // script context |
| 324 node->InsertInput(zone(), 1, jsgraph()->HeapConstant(p.name())); | 324 node->InsertInput(zone(), 1, jsgraph()->HeapConstant(p.name())); |
| 325 node->InsertInput(zone(), 2, jsgraph()->SmiConstant(p.feedback().index())); | 325 node->InsertInput(zone(), 2, jsgraph()->SmiConstant(p.feedback().index())); |
| 326 ReplaceWithStubCall(node, callable, flags); | 326 ReplaceWithStubCall(node, callable, flags); |
| 327 } | 327 } |
| 328 } | 328 } |
| 329 | 329 |
| 330 | 330 |
| 331 void JSGenericLowering::LowerJSStoreProperty(Node* node) { | 331 void JSGenericLowering::LowerJSStoreProperty(Node* node) { |
| 332 CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); | 332 CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); |
| 333 const StorePropertyParameters& p = StorePropertyParametersOf(node->op()); | 333 PropertyAccess const& p = PropertyAccessOf(node->op()); |
| 334 LanguageMode language_mode = p.language_mode(); | 334 LanguageMode language_mode = p.language_mode(); |
| 335 Callable callable = CodeFactory::KeyedStoreICInOptimizedCode( | 335 Callable callable = CodeFactory::KeyedStoreICInOptimizedCode( |
| 336 isolate(), language_mode, UNINITIALIZED); | 336 isolate(), language_mode, UNINITIALIZED); |
| 337 if (FLAG_vector_stores) { | 337 if (FLAG_vector_stores) { |
| 338 DCHECK(p.feedback().index() != -1); | 338 DCHECK(p.feedback().index() != -1); |
| 339 node->InsertInput(zone(), 3, jsgraph()->SmiConstant(p.feedback().index())); | 339 node->InsertInput(zone(), 3, jsgraph()->SmiConstant(p.feedback().index())); |
| 340 } else { | 340 } else { |
| 341 node->RemoveInput(3); | 341 node->RemoveInput(3); |
| 342 } | 342 } |
| 343 ReplaceWithStubCall(node, callable, | 343 ReplaceWithStubCall(node, callable, |
| 344 CallDescriptor::kPatchableCallSite | flags); | 344 CallDescriptor::kPatchableCallSite | flags); |
| 345 } | 345 } |
| 346 | 346 |
| 347 | 347 |
| 348 void JSGenericLowering::LowerJSStoreNamed(Node* node) { | 348 void JSGenericLowering::LowerJSStoreNamed(Node* node) { |
| 349 CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); | 349 CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); |
| 350 const StoreNamedParameters& p = StoreNamedParametersOf(node->op()); | 350 NamedAccess const& p = NamedAccessOf(node->op()); |
| 351 Callable callable = CodeFactory::StoreICInOptimizedCode( | 351 Callable callable = CodeFactory::StoreICInOptimizedCode( |
| 352 isolate(), p.language_mode(), UNINITIALIZED); | 352 isolate(), p.language_mode(), UNINITIALIZED); |
| 353 node->InsertInput(zone(), 1, jsgraph()->HeapConstant(p.name())); | 353 node->InsertInput(zone(), 1, jsgraph()->HeapConstant(p.name())); |
| 354 if (FLAG_vector_stores) { | 354 if (FLAG_vector_stores) { |
| 355 DCHECK(p.feedback().index() != -1); | 355 DCHECK(p.feedback().index() != -1); |
| 356 node->InsertInput(zone(), 3, jsgraph()->SmiConstant(p.feedback().index())); | 356 node->InsertInput(zone(), 3, jsgraph()->SmiConstant(p.feedback().index())); |
| 357 } else { | 357 } else { |
| 358 node->RemoveInput(3); | 358 node->RemoveInput(3); |
| 359 } | 359 } |
| 360 ReplaceWithStubCall(node, callable, | 360 ReplaceWithStubCall(node, callable, |
| (...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 850 } | 850 } |
| 851 | 851 |
| 852 | 852 |
| 853 MachineOperatorBuilder* JSGenericLowering::machine() const { | 853 MachineOperatorBuilder* JSGenericLowering::machine() const { |
| 854 return jsgraph()->machine(); | 854 return jsgraph()->machine(); |
| 855 } | 855 } |
| 856 | 856 |
| 857 } // namespace compiler | 857 } // namespace compiler |
| 858 } // namespace internal | 858 } // namespace internal |
| 859 } // namespace v8 | 859 } // namespace v8 |
| OLD | NEW |