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

Unified Diff: src/compiler/js-typed-lowering.cc

Issue 1292383007: [turbofan] Do not optimize with/block-context allocation in global code. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/js-typed-lowering.cc
diff --git a/src/compiler/js-typed-lowering.cc b/src/compiler/js-typed-lowering.cc
index 628e7e07b69b1ae2ec4560e6c41058d2abdd58c5..68c3e308dc7df9c26ab9f92d5883389fce4c67d8 100644
--- a/src/compiler/js-typed-lowering.cc
+++ b/src/compiler/js-typed-lowering.cc
@@ -1189,12 +1189,16 @@ Reduction JSTypedLowering::ReduceJSCreateLiteralObject(Node* node) {
Reduction JSTypedLowering::ReduceJSCreateWithContext(Node* node) {
DCHECK_EQ(IrOpcode::kJSCreateWithContext, node->opcode());
Node* const input = NodeProperties::GetValueInput(node, 0);
+ Node* const closure = NodeProperties::GetValueInput(node, 1);
Type* input_type = NodeProperties::GetBounds(input).upper;
- if (FLAG_turbo_allocate && input_type->Is(Type::Receiver())) {
+ // The closure can be NumberConstant(0) if the closure is global code
+ // (rather than a function). We exclude that case here.
+ // TODO(jarin) Find a better way to check that the closure is a function.
+ if (FLAG_turbo_allocate && input_type->Is(Type::Receiver()) &&
+ closure->opcode() != IrOpcode::kNumberConstant) {
// JSCreateWithContext(o:receiver, f)
Node* const effect = NodeProperties::GetEffectInput(node);
Node* const control = NodeProperties::GetControlInput(node);
- Node* const closure = NodeProperties::GetValueInput(node, 1);
Node* const context = NodeProperties::GetContextInput(node);
Node* const load = graph()->NewNode(
simplified()->LoadField(
« 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