| 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 1247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1258 // will mutate the callee and receiver values pushed onto the environment. | 1258 // will mutate the callee and receiver values pushed onto the environment. |
| 1259 if (possibly_eval && args->length() > 0) { | 1259 if (possibly_eval && args->length() > 0) { |
| 1260 int arg_count = args->length(); | 1260 int arg_count = args->length(); |
| 1261 | 1261 |
| 1262 // Extract callee and source string from the environment. | 1262 // Extract callee and source string from the environment. |
| 1263 Node* callee = environment()->Peek(arg_count + 1); | 1263 Node* callee = environment()->Peek(arg_count + 1); |
| 1264 Node* source = environment()->Peek(arg_count - 1); | 1264 Node* source = environment()->Peek(arg_count - 1); |
| 1265 | 1265 |
| 1266 // Create node to ask for help resolving potential eval call. This will | 1266 // Create node to ask for help resolving potential eval call. This will |
| 1267 // provide a fully resolved callee and the corresponding receiver. | 1267 // provide a fully resolved callee and the corresponding receiver. |
| 1268 Node* function = GetFunctionClosure(); |
| 1268 Node* receiver = environment()->Lookup(info()->scope()->receiver()); | 1269 Node* receiver = environment()->Lookup(info()->scope()->receiver()); |
| 1269 Node* strict = jsgraph()->Constant(strict_mode()); | 1270 Node* strict = jsgraph()->Constant(strict_mode()); |
| 1270 Node* position = jsgraph()->Constant(info()->scope()->start_position()); | 1271 Node* position = jsgraph()->Constant(info()->scope()->start_position()); |
| 1271 const Operator* op = | 1272 const Operator* op = |
| 1272 javascript()->Runtime(Runtime::kResolvePossiblyDirectEval, 5); | 1273 javascript()->Runtime(Runtime::kResolvePossiblyDirectEval, 6); |
| 1273 Node* pair = NewNode(op, callee, source, receiver, strict, position); | 1274 Node* pair = |
| 1275 NewNode(op, callee, source, function, receiver, strict, position); |
| 1274 Node* new_callee = NewNode(common()->Projection(0), pair); | 1276 Node* new_callee = NewNode(common()->Projection(0), pair); |
| 1275 Node* new_receiver = NewNode(common()->Projection(1), pair); | 1277 Node* new_receiver = NewNode(common()->Projection(1), pair); |
| 1276 | 1278 |
| 1277 // Patch callee and receiver on the environment. | 1279 // Patch callee and receiver on the environment. |
| 1278 environment()->Poke(arg_count + 1, new_callee); | 1280 environment()->Poke(arg_count + 1, new_callee); |
| 1279 environment()->Poke(arg_count + 0, new_receiver); | 1281 environment()->Poke(arg_count + 0, new_receiver); |
| 1280 } | 1282 } |
| 1281 | 1283 |
| 1282 // Create node to perform the function call. | 1284 // Create node to perform the function call. |
| 1283 const Operator* call = javascript()->Call(args->length() + 2, flags); | 1285 const Operator* call = javascript()->Call(args->length() + 2, flags); |
| (...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2023 DCHECK(NodeProperties::GetFrameStateInput(node)->opcode() == | 2025 DCHECK(NodeProperties::GetFrameStateInput(node)->opcode() == |
| 2024 IrOpcode::kDead); | 2026 IrOpcode::kDead); |
| 2025 NodeProperties::ReplaceFrameStateInput( | 2027 NodeProperties::ReplaceFrameStateInput( |
| 2026 node, environment()->Checkpoint(ast_id, combine)); | 2028 node, environment()->Checkpoint(ast_id, combine)); |
| 2027 } | 2029 } |
| 2028 } | 2030 } |
| 2029 | 2031 |
| 2030 } | 2032 } |
| 2031 } | 2033 } |
| 2032 } // namespace v8::internal::compiler | 2034 } // namespace v8::internal::compiler |
| OLD | NEW |