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

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

Issue 1842953003: Preserve exception message in iterator finalization. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Turbofan 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
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 1424 matching lines...) Expand 10 before | Expand all | Expand 10 after
1435 try_control.BeginTry(); 1435 try_control.BeginTry();
1436 { 1436 {
1437 ControlScopeForCatch scope(this, &try_control); 1437 ControlScopeForCatch scope(this, &try_control);
1438 STATIC_ASSERT(TryBlockConstant::kElementCount == 1); 1438 STATIC_ASSERT(TryBlockConstant::kElementCount == 1);
1439 environment()->Push(current_context()); 1439 environment()->Push(current_context());
1440 Visit(stmt->try_block()); 1440 Visit(stmt->try_block());
1441 environment()->Pop(); 1441 environment()->Pop();
1442 } 1442 }
1443 try_control.EndTry(); 1443 try_control.EndTry();
1444 1444
1445 // Clear message object as we enter the catch block. 1445 // If requested, clear message object as we enter the catch block.
1446 Node* the_hole = jsgraph()->TheHoleConstant(); 1446 if (stmt->clear_pending_message()) {
1447 NewNode(javascript()->StoreMessage(), the_hole); 1447 Node* the_hole = jsgraph()->TheHoleConstant();
1448 NewNode(javascript()->StoreMessage(), the_hole);
1449 }
1448 1450
1449 // Create a catch scope that binds the exception. 1451 // Create a catch scope that binds the exception.
1450 Node* exception = try_control.GetExceptionNode(); 1452 Node* exception = try_control.GetExceptionNode();
1451 Handle<String> name = stmt->variable()->name(); 1453 Handle<String> name = stmt->variable()->name();
1452 const Operator* op = javascript()->CreateCatchContext(name); 1454 const Operator* op = javascript()->CreateCatchContext(name);
1453 Node* context = NewNode(op, exception, GetFunctionClosureForContext()); 1455 Node* context = NewNode(op, exception, GetFunctionClosureForContext());
1454 1456
1455 // Evaluate the catch-block. 1457 // Evaluate the catch-block.
1456 VisitInScope(stmt->catch_block(), stmt->scope(), context); 1458 VisitInScope(stmt->catch_block(), stmt->scope(), context);
1457 try_control.EndCatch(); 1459 try_control.EndCatch();
(...skipping 2909 matching lines...) Expand 10 before | Expand all | Expand 10 after
4367 // Phi does not exist yet, introduce one. 4369 // Phi does not exist yet, introduce one.
4368 value = NewPhi(inputs, value, control); 4370 value = NewPhi(inputs, value, control);
4369 value->ReplaceInput(inputs - 1, other); 4371 value->ReplaceInput(inputs - 1, other);
4370 } 4372 }
4371 return value; 4373 return value;
4372 } 4374 }
4373 4375
4374 } // namespace compiler 4376 } // namespace compiler
4375 } // namespace internal 4377 } // namespace internal
4376 } // namespace v8 4378 } // namespace v8
OLDNEW
« src/ast/ast.h ('K') | « src/ast/ast.h ('k') | src/full-codegen/full-codegen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698