OLD | NEW |
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 3197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3208 } | 3208 } |
3209 | 3209 |
3210 | 3210 |
3211 Node* AstGraphBuilder::BuildNewTargetVariable(Variable* new_target_var) { | 3211 Node* AstGraphBuilder::BuildNewTargetVariable(Variable* new_target_var) { |
3212 if (new_target_var == nullptr) return nullptr; | 3212 if (new_target_var == nullptr) return nullptr; |
3213 | 3213 |
3214 // Retrieve the original constructor in case we are called as a constructor. | 3214 // Retrieve the original constructor in case we are called as a constructor. |
3215 const Operator* op = | 3215 const Operator* op = |
3216 javascript()->CallRuntime(Runtime::kGetOriginalConstructor, 0); | 3216 javascript()->CallRuntime(Runtime::kGetOriginalConstructor, 0); |
3217 Node* object = NewNode(op); | 3217 Node* object = NewNode(op); |
3218 PrepareFrameState(object, BailoutId::None()); | 3218 // TODO(4544): Bailout id only needed for JavaScriptFrame::Summarize. |
| 3219 PrepareFrameState(object, BailoutId::FunctionContext()); |
3219 | 3220 |
3220 // Assign the object to the {new.target} variable. This should never lazy | 3221 // Assign the object to the {new.target} variable. This should never lazy |
3221 // deopt, so it is fine to send invalid bailout id. | 3222 // deopt, so it is fine to send invalid bailout id. |
3222 FrameStateBeforeAndAfter states(this, BailoutId::None()); | 3223 FrameStateBeforeAndAfter states(this, BailoutId::None()); |
3223 BuildVariableAssignment(new_target_var, object, Token::INIT_CONST, | 3224 BuildVariableAssignment(new_target_var, object, Token::INIT_CONST, |
3224 VectorSlotPair(), BailoutId::None(), states); | 3225 VectorSlotPair(), BailoutId::None(), states); |
3225 return object; | 3226 return object; |
3226 } | 3227 } |
3227 | 3228 |
3228 | 3229 |
(...skipping 1067 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4296 // Phi does not exist yet, introduce one. | 4297 // Phi does not exist yet, introduce one. |
4297 value = NewPhi(inputs, value, control); | 4298 value = NewPhi(inputs, value, control); |
4298 value->ReplaceInput(inputs - 1, other); | 4299 value->ReplaceInput(inputs - 1, other); |
4299 } | 4300 } |
4300 return value; | 4301 return value; |
4301 } | 4302 } |
4302 | 4303 |
4303 } // namespace compiler | 4304 } // namespace compiler |
4304 } // namespace internal | 4305 } // namespace internal |
4305 } // namespace v8 | 4306 } // namespace v8 |
OLD | NEW |