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/control-builders.h" | 8 #include "src/compiler/control-builders.h" |
9 #include "src/compiler/machine-operator.h" | 9 #include "src/compiler/machine-operator.h" |
10 #include "src/compiler/node-properties.h" | 10 #include "src/compiler/node-properties.h" |
(...skipping 1290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1301 // will mutate the callee and receiver values pushed onto the environment. | 1301 // will mutate the callee and receiver values pushed onto the environment. |
1302 if (possibly_eval && args->length() > 0) { | 1302 if (possibly_eval && args->length() > 0) { |
1303 int arg_count = args->length(); | 1303 int arg_count = args->length(); |
1304 | 1304 |
1305 // Extract callee and source string from the environment. | 1305 // Extract callee and source string from the environment. |
1306 Node* callee = environment()->Peek(arg_count + 1); | 1306 Node* callee = environment()->Peek(arg_count + 1); |
1307 Node* source = environment()->Peek(arg_count - 1); | 1307 Node* source = environment()->Peek(arg_count - 1); |
1308 | 1308 |
1309 // Create node to ask for help resolving potential eval call. This will | 1309 // Create node to ask for help resolving potential eval call. This will |
1310 // provide a fully resolved callee and the corresponding receiver. | 1310 // provide a fully resolved callee and the corresponding receiver. |
| 1311 Node* function = GetFunctionClosure(); |
1311 Node* receiver = environment()->Lookup(info()->scope()->receiver()); | 1312 Node* receiver = environment()->Lookup(info()->scope()->receiver()); |
1312 Node* strict = jsgraph()->Constant(strict_mode()); | 1313 Node* strict = jsgraph()->Constant(strict_mode()); |
1313 Node* position = jsgraph()->Constant(info()->scope()->start_position()); | 1314 Node* position = jsgraph()->Constant(info()->scope()->start_position()); |
1314 const Operator* op = | 1315 const Operator* op = |
1315 javascript()->CallRuntime(Runtime::kResolvePossiblyDirectEval, 5); | 1316 javascript()->CallRuntime(Runtime::kResolvePossiblyDirectEval, 6); |
1316 Node* pair = NewNode(op, callee, source, receiver, strict, position); | 1317 Node* pair = |
| 1318 NewNode(op, callee, source, function, receiver, strict, position); |
1317 PrepareFrameState(pair, expr->EvalOrLookupId(), | 1319 PrepareFrameState(pair, expr->EvalOrLookupId(), |
1318 OutputFrameStateCombine::PokeAt(arg_count + 1)); | 1320 OutputFrameStateCombine::PokeAt(arg_count + 1)); |
1319 Node* new_callee = NewNode(common()->Projection(0), pair); | 1321 Node* new_callee = NewNode(common()->Projection(0), pair); |
1320 Node* new_receiver = NewNode(common()->Projection(1), pair); | 1322 Node* new_receiver = NewNode(common()->Projection(1), pair); |
1321 | 1323 |
1322 // Patch callee and receiver on the environment. | 1324 // Patch callee and receiver on the environment. |
1323 environment()->Poke(arg_count + 1, new_callee); | 1325 environment()->Poke(arg_count + 1, new_callee); |
1324 environment()->Poke(arg_count + 0, new_receiver); | 1326 environment()->Poke(arg_count + 0, new_receiver); |
1325 } | 1327 } |
1326 | 1328 |
(...skipping 801 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2128 DCHECK(NodeProperties::GetFrameStateInput(node)->opcode() == | 2130 DCHECK(NodeProperties::GetFrameStateInput(node)->opcode() == |
2129 IrOpcode::kDead); | 2131 IrOpcode::kDead); |
2130 NodeProperties::ReplaceFrameStateInput( | 2132 NodeProperties::ReplaceFrameStateInput( |
2131 node, environment()->Checkpoint(ast_id, combine)); | 2133 node, environment()->Checkpoint(ast_id, combine)); |
2132 } | 2134 } |
2133 } | 2135 } |
2134 | 2136 |
2135 } | 2137 } |
2136 } | 2138 } |
2137 } // namespace v8::internal::compiler | 2139 } // namespace v8::internal::compiler |
OLD | NEW |