Chromium Code Reviews| 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/compiler/js-generic-lowering.h" | 5 #include "src/compiler/js-generic-lowering.h" |
| 6 | 6 |
| 7 #include "src/ast/ast.h" | 7 #include "src/ast/ast.h" |
| 8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
| 9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
| 10 #include "src/compiler/common-operator.h" | 10 #include "src/compiler/common-operator.h" |
| (...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 338 | 338 |
| 339 | 339 |
| 340 void JSGenericLowering::LowerJSDeleteProperty(Node* node) { | 340 void JSGenericLowering::LowerJSDeleteProperty(Node* node) { |
| 341 LanguageMode language_mode = OpParameter<LanguageMode>(node); | 341 LanguageMode language_mode = OpParameter<LanguageMode>(node); |
| 342 ReplaceWithRuntimeCall(node, is_strict(language_mode) | 342 ReplaceWithRuntimeCall(node, is_strict(language_mode) |
| 343 ? Runtime::kDeleteProperty_Strict | 343 ? Runtime::kDeleteProperty_Strict |
| 344 : Runtime::kDeleteProperty_Sloppy); | 344 : Runtime::kDeleteProperty_Sloppy); |
| 345 } | 345 } |
| 346 | 346 |
| 347 | 347 |
| 348 void JSGenericLowering::LowerJSGetSuperConstructor(Node* node) { | |
| 349 // The typeof operator doesn't need the current context. | |
| 350 NodeProperties::ReplaceContextInput(node, jsgraph()->NoContextConstant()); | |
|
caitp
2016/11/21 13:52:53
I would just replace this whole block with `Replac
Benedikt Meurer
2016/11/23 04:51:00
This should use the GetSuperConstructor builtin:
| |
| 351 Callable callable = CodeFactory::Typeof(isolate()); | |
| 352 node->AppendInput(zone(), graph()->start()); | |
| 353 ReplaceWithStubCall(node, callable, CallDescriptor::kNoAllocate, | |
| 354 Operator::kEliminatable); | |
| 355 } | |
| 356 | |
| 357 | |
| 348 void JSGenericLowering::LowerJSInstanceOf(Node* node) { | 358 void JSGenericLowering::LowerJSInstanceOf(Node* node) { |
| 349 CallDescriptor::Flags flags = FrameStateFlagForCall(node); | 359 CallDescriptor::Flags flags = FrameStateFlagForCall(node); |
| 350 Callable callable = CodeFactory::InstanceOf(isolate()); | 360 Callable callable = CodeFactory::InstanceOf(isolate()); |
| 351 ReplaceWithStubCall(node, callable, flags); | 361 ReplaceWithStubCall(node, callable, flags); |
| 352 } | 362 } |
| 353 | 363 |
| 354 | 364 |
| 355 void JSGenericLowering::LowerJSLoadContext(Node* node) { | 365 void JSGenericLowering::LowerJSLoadContext(Node* node) { |
| 356 const ContextAccess& access = ContextAccessOf(node->op()); | 366 const ContextAccess& access = ContextAccessOf(node->op()); |
| 357 for (size_t i = 0; i < access.depth(); ++i) { | 367 for (size_t i = 0; i < access.depth(); ++i) { |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 690 } | 700 } |
| 691 | 701 |
| 692 | 702 |
| 693 MachineOperatorBuilder* JSGenericLowering::machine() const { | 703 MachineOperatorBuilder* JSGenericLowering::machine() const { |
| 694 return jsgraph()->machine(); | 704 return jsgraph()->machine(); |
| 695 } | 705 } |
| 696 | 706 |
| 697 } // namespace compiler | 707 } // namespace compiler |
| 698 } // namespace internal | 708 } // namespace internal |
| 699 } // namespace v8 | 709 } // namespace v8 |
| OLD | NEW |