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

Side by Side Diff: src/compiler/js-call-reducer.cc

Issue 2651133002: [turbofan] Maintain the invariant to never inline cross native context. (Closed)
Patch Set: Created 3 years, 11 months 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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-call-reducer.h" 5 #include "src/compiler/js-call-reducer.h"
6 6
7 #include "src/code-factory.h" 7 #include "src/code-factory.h"
8 #include "src/code-stubs.h" 8 #include "src/code-stubs.h"
9 #include "src/compiler/js-graph.h" 9 #include "src/compiler/js-graph.h"
10 #include "src/compiler/linkage.h" 10 #include "src/compiler/linkage.h"
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 400
401 // Raise a TypeError if the {target} is a "classConstructor". 401 // Raise a TypeError if the {target} is a "classConstructor".
402 if (IsClassConstructor(shared->kind())) { 402 if (IsClassConstructor(shared->kind())) {
403 NodeProperties::ReplaceValueInputs(node, target); 403 NodeProperties::ReplaceValueInputs(node, target);
404 NodeProperties::ChangeOp( 404 NodeProperties::ChangeOp(
405 node, javascript()->CallRuntime( 405 node, javascript()->CallRuntime(
406 Runtime::kThrowConstructorNonCallableError, 1)); 406 Runtime::kThrowConstructorNonCallableError, 1));
407 return Changed(node); 407 return Changed(node);
408 } 408 }
409 409
410 // Don't inline cross native context.
411 if (function->native_context() != *native_context()) return NoChange();
412
410 // Check for known builtin functions. 413 // Check for known builtin functions.
411 switch (shared->code()->builtin_index()) { 414 switch (shared->code()->builtin_index()) {
412 case Builtins::kFunctionPrototypeApply: 415 case Builtins::kFunctionPrototypeApply:
413 return ReduceFunctionPrototypeApply(node); 416 return ReduceFunctionPrototypeApply(node);
414 case Builtins::kFunctionPrototypeCall: 417 case Builtins::kFunctionPrototypeCall:
415 return ReduceFunctionPrototypeCall(node); 418 return ReduceFunctionPrototypeCall(node);
416 case Builtins::kFunctionPrototypeHasInstance: 419 case Builtins::kFunctionPrototypeHasInstance:
417 return ReduceFunctionPrototypeHasInstance(node); 420 return ReduceFunctionPrototypeHasInstance(node);
418 case Builtins::kNumberConstructor: 421 case Builtins::kNumberConstructor:
419 return ReduceNumberConstructor(node); 422 return ReduceNumberConstructor(node);
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
562 565
563 // Raise a TypeError if the {target} is not a constructor. 566 // Raise a TypeError if the {target} is not a constructor.
564 if (!function->IsConstructor()) { 567 if (!function->IsConstructor()) {
565 NodeProperties::ReplaceValueInputs(node, target); 568 NodeProperties::ReplaceValueInputs(node, target);
566 NodeProperties::ChangeOp( 569 NodeProperties::ChangeOp(
567 node, javascript()->CallRuntime( 570 node, javascript()->CallRuntime(
568 Runtime::kThrowConstructedNonConstructable)); 571 Runtime::kThrowConstructedNonConstructable));
569 return Changed(node); 572 return Changed(node);
570 } 573 }
571 574
575 // Don't inline cross native context.
576 if (function->native_context() != *native_context()) return NoChange();
577
572 // Check for the ArrayConstructor. 578 // Check for the ArrayConstructor.
573 if (*function == function->native_context()->array_function()) { 579 if (*function == function->native_context()->array_function()) {
574 // Check if we have an allocation site. 580 // Check if we have an allocation site.
575 Handle<AllocationSite> site; 581 Handle<AllocationSite> site;
576 if (p.feedback().IsValid()) { 582 if (p.feedback().IsValid()) {
577 CallICNexus nexus(p.feedback().vector(), p.feedback().slot()); 583 CallICNexus nexus(p.feedback().vector(), p.feedback().slot());
578 Handle<Object> feedback(nexus.GetFeedback(), isolate()); 584 Handle<Object> feedback(nexus.GetFeedback(), isolate());
579 if (feedback->IsAllocationSite()) { 585 if (feedback->IsAllocationSite()) {
580 site = Handle<AllocationSite>::cast(feedback); 586 site = Handle<AllocationSite>::cast(feedback);
581 } 587 }
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
668 return jsgraph()->javascript(); 674 return jsgraph()->javascript();
669 } 675 }
670 676
671 SimplifiedOperatorBuilder* JSCallReducer::simplified() const { 677 SimplifiedOperatorBuilder* JSCallReducer::simplified() const {
672 return jsgraph()->simplified(); 678 return jsgraph()->simplified();
673 } 679 }
674 680
675 } // namespace compiler 681 } // namespace compiler
676 } // namespace internal 682 } // namespace internal
677 } // namespace v8 683 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698