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

Unified Diff: src/compiler/ast-graph-builder.cc

Issue 1652013002: [turbofan] Properly call %TraceExit on explicit return. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address Michis comments. Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/ast-graph-builder.cc
diff --git a/src/compiler/ast-graph-builder.cc b/src/compiler/ast-graph-builder.cc
index b236775154bf59a1962cfcfea71a4a8e9f48a0f9..fcef520d4b946e29e4c09b5af23eafcd4ed246d0 100644
--- a/src/compiler/ast-graph-builder.cc
+++ b/src/compiler/ast-graph-builder.cc
@@ -610,13 +610,6 @@ void AstGraphBuilder::CreateGraphBody(bool stack_check) {
// Visit statements in the function body.
VisitStatements(info()->literal()->body());
- // Emit tracing call if requested to do so.
- if (FLAG_trace) {
- // TODO(mstarzinger): Only traces implicit return.
- Node* return_value = jsgraph()->UndefinedConstant();
- NewNode(javascript()->CallRuntime(Runtime::kTraceExit), return_value);
- }
-
// Return 'undefined' in case we can fall off the end.
BuildReturn(jsgraph()->UndefinedConstant());
}
@@ -3797,6 +3790,11 @@ Node* AstGraphBuilder::BuildThrowUnsupportedSuperError(BailoutId bailout_id) {
Node* AstGraphBuilder::BuildReturn(Node* return_value) {
+ // Emit tracing call if requested to do so.
+ if (FLAG_trace) {
+ return_value =
+ NewNode(javascript()->CallRuntime(Runtime::kTraceExit), return_value);
+ }
Node* control = NewNode(common()->Return(), return_value);
UpdateControlDependencyToLeaveFunction(control);
return control;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698