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

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

Issue 2511223003: [turbofan] Properly optimize instanceof (even in the presence of @@hasInstance). (Closed)
Patch Set: 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 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 : Runtime::kDeleteProperty_Sloppy); 345 : Runtime::kDeleteProperty_Sloppy);
346 } 346 }
347 347
348 348
349 void JSGenericLowering::LowerJSInstanceOf(Node* node) { 349 void JSGenericLowering::LowerJSInstanceOf(Node* node) {
350 CallDescriptor::Flags flags = FrameStateFlagForCall(node); 350 CallDescriptor::Flags flags = FrameStateFlagForCall(node);
351 Callable callable = CodeFactory::InstanceOf(isolate()); 351 Callable callable = CodeFactory::InstanceOf(isolate());
352 ReplaceWithStubCall(node, callable, flags); 352 ReplaceWithStubCall(node, callable, flags);
353 } 353 }
354 354
355 void JSGenericLowering::LowerJSOrdinaryHasInstance(Node* node) {
356 CallDescriptor::Flags flags = FrameStateFlagForCall(node);
357 Callable callable = CodeFactory::OrdinaryHasInstance(isolate());
358 ReplaceWithStubCall(node, callable, flags);
359 }
355 360
356 void JSGenericLowering::LowerJSLoadContext(Node* node) { 361 void JSGenericLowering::LowerJSLoadContext(Node* node) {
357 const ContextAccess& access = ContextAccessOf(node->op()); 362 const ContextAccess& access = ContextAccessOf(node->op());
358 for (size_t i = 0; i < access.depth(); ++i) { 363 for (size_t i = 0; i < access.depth(); ++i) {
359 node->ReplaceInput( 364 node->ReplaceInput(
360 0, graph()->NewNode(machine()->Load(MachineType::AnyTagged()), 365 0, graph()->NewNode(machine()->Load(MachineType::AnyTagged()),
361 NodeProperties::GetValueInput(node, 0), 366 NodeProperties::GetValueInput(node, 0),
362 jsgraph()->Int32Constant( 367 jsgraph()->Int32Constant(
363 Context::SlotOffset(Context::PREVIOUS_INDEX)), 368 Context::SlotOffset(Context::PREVIOUS_INDEX)),
364 NodeProperties::GetEffectInput(node), 369 NodeProperties::GetEffectInput(node),
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
706 } 711 }
707 712
708 713
709 MachineOperatorBuilder* JSGenericLowering::machine() const { 714 MachineOperatorBuilder* JSGenericLowering::machine() const {
710 return jsgraph()->machine(); 715 return jsgraph()->machine();
711 } 716 }
712 717
713 } // namespace compiler 718 } // namespace compiler
714 } // namespace internal 719 } // namespace internal
715 } // namespace v8 720 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698