Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(149)

Side by Side Diff: src/compiler/js-generic-lowering.cc

Issue 2504553003: [es6] Perform the IsConstructor test in GetSuperConstructor. (Closed)
Patch Set: Convert GetSuperConstructor to a new interpreter bytecode Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698