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/ast-loop-assignment-analyzer.h" | 8 #include "src/compiler/ast-loop-assignment-analyzer.h" |
9 #include "src/compiler/control-builders.h" | 9 #include "src/compiler/control-builders.h" |
10 #include "src/compiler/linkage.h" | 10 #include "src/compiler/linkage.h" |
(...skipping 1176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1187 // that is intercepting 'throw' control commands. | 1187 // that is intercepting 'throw' control commands. |
1188 try_control.BeginTry(); | 1188 try_control.BeginTry(); |
1189 { | 1189 { |
1190 ControlScopeForCatch scope(this, &try_control); | 1190 ControlScopeForCatch scope(this, &try_control); |
1191 Visit(stmt->try_block()); | 1191 Visit(stmt->try_block()); |
1192 } | 1192 } |
1193 try_control.EndTry(); | 1193 try_control.EndTry(); |
1194 | 1194 |
1195 // Create a catch scope that binds the exception. | 1195 // Create a catch scope that binds the exception. |
1196 Node* exception = try_control.GetExceptionNode(); | 1196 Node* exception = try_control.GetExceptionNode(); |
1197 if (exception == NULL) exception = jsgraph()->NullConstant(); | |
1198 Unique<String> name = MakeUnique(stmt->variable()->name()); | 1197 Unique<String> name = MakeUnique(stmt->variable()->name()); |
1199 const Operator* op = javascript()->CreateCatchContext(name); | 1198 const Operator* op = javascript()->CreateCatchContext(name); |
1200 Node* context = NewNode(op, exception, GetFunctionClosure()); | 1199 Node* context = NewNode(op, exception, GetFunctionClosure()); |
1201 PrepareFrameState(context, BailoutId::None()); | 1200 PrepareFrameState(context, BailoutId::None()); |
1202 ContextScope scope(this, stmt->scope(), context); | 1201 ContextScope scope(this, stmt->scope(), context); |
1203 DCHECK(stmt->scope()->declarations()->is_empty()); | 1202 DCHECK(stmt->scope()->declarations()->is_empty()); |
1204 | 1203 |
1205 // Evaluate the catch-block. | 1204 // Evaluate the catch-block. |
1206 Visit(stmt->catch_block()); | 1205 Visit(stmt->catch_block()); |
1207 try_control.EndCatch(); | 1206 try_control.EndCatch(); |
(...skipping 1924 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3132 Node* dead_node = graph()->NewNode(common()->Dead()); | 3131 Node* dead_node = graph()->NewNode(common()->Dead()); |
3133 dead_control_.set(dead_node); | 3132 dead_control_.set(dead_node); |
3134 return dead_node; | 3133 return dead_node; |
3135 } | 3134 } |
3136 return dead_control_.get(); | 3135 return dead_control_.get(); |
3137 } | 3136 } |
3138 | 3137 |
3139 } // namespace compiler | 3138 } // namespace compiler |
3140 } // namespace internal | 3139 } // namespace internal |
3141 } // namespace v8 | 3140 } // namespace v8 |
OLD | NEW |