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

Side by Side Diff: src/compiler/ast-graph-builder.cc

Issue 1432493003: [turbofan] Fix new.target when a function is inlined to a constructor. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@reland
Patch Set: Test added Created 5 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
« no previous file with comments | « no previous file | src/compiler/linkage.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/ast-graph-builder.h" 5 #include "src/compiler/ast-graph-builder.h"
6 6
7 #include "src/compiler.h" 7 #include "src/compiler.h"
8 #include "src/compiler/ast-loop-assignment-analyzer.h" 8 #include "src/compiler/ast-loop-assignment-analyzer.h"
9 #include "src/compiler/control-builders.h" 9 #include "src/compiler/control-builders.h"
10 #include "src/compiler/linkage.h" 10 #include "src/compiler/linkage.h"
(...skipping 3237 matching lines...) Expand 10 before | Expand all | Expand 10 after
3248 } 3248 }
3249 3249
3250 3250
3251 Node* AstGraphBuilder::BuildNewTargetVariable(Variable* new_target_var) { 3251 Node* AstGraphBuilder::BuildNewTargetVariable(Variable* new_target_var) {
3252 if (new_target_var == nullptr) return nullptr; 3252 if (new_target_var == nullptr) return nullptr;
3253 3253
3254 // Retrieve the original constructor in case we are called as a constructor. 3254 // Retrieve the original constructor in case we are called as a constructor.
3255 const Operator* op = 3255 const Operator* op =
3256 javascript()->CallRuntime(Runtime::kGetOriginalConstructor, 0); 3256 javascript()->CallRuntime(Runtime::kGetOriginalConstructor, 0);
3257 Node* object = NewNode(op); 3257 Node* object = NewNode(op);
3258 PrepareFrameState(object, BailoutId::None());
3258 3259
3259 // Assign the object to the {new.target} variable. This should never lazy 3260 // Assign the object to the {new.target} variable. This should never lazy
3260 // deopt, so it is fine to send invalid bailout id. 3261 // deopt, so it is fine to send invalid bailout id.
3261 FrameStateBeforeAndAfter states(this, BailoutId::None()); 3262 FrameStateBeforeAndAfter states(this, BailoutId::None());
3262 BuildVariableAssignment(new_target_var, object, Token::INIT_CONST, 3263 BuildVariableAssignment(new_target_var, object, Token::INIT_CONST,
3263 VectorSlotPair(), BailoutId::None(), states); 3264 VectorSlotPair(), BailoutId::None(), states);
3264 return object; 3265 return object;
3265 } 3266 }
3266 3267
3267 3268
(...skipping 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after
4360 // Phi does not exist yet, introduce one. 4361 // Phi does not exist yet, introduce one.
4361 value = NewPhi(inputs, value, control); 4362 value = NewPhi(inputs, value, control);
4362 value->ReplaceInput(inputs - 1, other); 4363 value->ReplaceInput(inputs - 1, other);
4363 } 4364 }
4364 return value; 4365 return value;
4365 } 4366 }
4366 4367
4367 } // namespace compiler 4368 } // namespace compiler
4368 } // namespace internal 4369 } // namespace internal
4369 } // namespace v8 4370 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/compiler/linkage.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698