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

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

Issue 1854713002: Correctly annotate eval origin. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase Created 4 years, 8 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 unified diff | Download patch
« no previous file with comments | « src/compiler.cc ('k') | src/debug/debug.h » ('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/ast/scopes.h" 7 #include "src/ast/scopes.h"
8 #include "src/compiler.h" 8 #include "src/compiler.h"
9 #include "src/compiler/ast-loop-assignment-analyzer.h" 9 #include "src/compiler/ast-loop-assignment-analyzer.h"
10 #include "src/compiler/control-builders.h" 10 #include "src/compiler/control-builders.h"
(...skipping 2438 matching lines...) Expand 10 before | Expand all | Expand 10 after
2449 int arg_count = args->length(); 2449 int arg_count = args->length();
2450 2450
2451 // Extract callee and source string from the environment. 2451 // Extract callee and source string from the environment.
2452 Node* callee = environment()->Peek(arg_count + 1); 2452 Node* callee = environment()->Peek(arg_count + 1);
2453 Node* source = environment()->Peek(arg_count - 1); 2453 Node* source = environment()->Peek(arg_count - 1);
2454 2454
2455 // Create node to ask for help resolving potential eval call. This will 2455 // Create node to ask for help resolving potential eval call. This will
2456 // provide a fully resolved callee to patch into the environment. 2456 // provide a fully resolved callee to patch into the environment.
2457 Node* function = GetFunctionClosure(); 2457 Node* function = GetFunctionClosure();
2458 Node* language = jsgraph()->Constant(language_mode()); 2458 Node* language = jsgraph()->Constant(language_mode());
2459 Node* position = jsgraph()->Constant(current_scope()->start_position()); 2459 Node* eval_scope_position =
2460 jsgraph()->Constant(current_scope()->start_position());
2461 Node* eval_position = jsgraph()->Constant(expr->position());
2460 const Operator* op = 2462 const Operator* op =
2461 javascript()->CallRuntime(Runtime::kResolvePossiblyDirectEval); 2463 javascript()->CallRuntime(Runtime::kResolvePossiblyDirectEval);
2462 Node* new_callee = 2464 Node* new_callee = NewNode(op, callee, source, function, language,
2463 NewNode(op, callee, source, function, language, position); 2465 eval_scope_position, eval_position);
2464 PrepareFrameState(new_callee, expr->EvalId(), 2466 PrepareFrameState(new_callee, expr->EvalId(),
2465 OutputFrameStateCombine::PokeAt(arg_count + 1)); 2467 OutputFrameStateCombine::PokeAt(arg_count + 1));
2466 2468
2467 // Patch callee on the environment. 2469 // Patch callee on the environment.
2468 environment()->Poke(arg_count + 1, new_callee); 2470 environment()->Poke(arg_count + 1, new_callee);
2469 } 2471 }
2470 2472
2471 // Create node to perform the function call. 2473 // Create node to perform the function call.
2472 VectorSlotPair feedback = CreateVectorSlotPair(expr->CallFeedbackICSlot()); 2474 VectorSlotPair feedback = CreateVectorSlotPair(expr->CallFeedbackICSlot());
2473 const Operator* call = javascript()->CallFunction( 2475 const Operator* call = javascript()->CallFunction(
(...skipping 1895 matching lines...) Expand 10 before | Expand all | Expand 10 after
4369 // Phi does not exist yet, introduce one. 4371 // Phi does not exist yet, introduce one.
4370 value = NewPhi(inputs, value, control); 4372 value = NewPhi(inputs, value, control);
4371 value->ReplaceInput(inputs - 1, other); 4373 value->ReplaceInput(inputs - 1, other);
4372 } 4374 }
4373 return value; 4375 return value;
4374 } 4376 }
4375 4377
4376 } // namespace compiler 4378 } // namespace compiler
4377 } // namespace internal 4379 } // namespace internal
4378 } // namespace v8 4380 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler.cc ('k') | src/debug/debug.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698