OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/ast/ast-numbering.h" | 5 #include "src/ast/ast-numbering.h" |
6 | 6 |
7 #include "src/ast/ast.h" | 7 #include "src/ast/ast.h" |
8 #include "src/ast/scopes.h" | 8 #include "src/ast/scopes.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 IncrementNodeCount(); | 250 IncrementNodeCount(); |
251 VisitVariableProxy(node->proxy()); | 251 VisitVariableProxy(node->proxy()); |
252 VisitFunctionLiteral(node->fun()); | 252 VisitFunctionLiteral(node->fun()); |
253 } | 253 } |
254 | 254 |
255 | 255 |
256 void AstNumberingVisitor::VisitCallRuntime(CallRuntime* node) { | 256 void AstNumberingVisitor::VisitCallRuntime(CallRuntime* node) { |
257 IncrementNodeCount(); | 257 IncrementNodeCount(); |
258 node->set_base_id(ReserveIdRange(CallRuntime::num_ids())); | 258 node->set_base_id(ReserveIdRange(CallRuntime::num_ids())); |
259 VisitArguments(node->arguments()); | 259 VisitArguments(node->arguments()); |
| 260 // Indicate the catch prediction to the running async program |
| 261 if (node->is_jsruntime() && |
| 262 node->context_index() == Context::ASYNC_FUNCTION_AWAIT_CAUGHT_INDEX && |
| 263 catch_prediction_ == HandlerTable::ASYNC_AWAIT) { |
| 264 node->set_context_index(Context::ASYNC_FUNCTION_AWAIT_UNCAUGHT_INDEX); |
| 265 } |
260 } | 266 } |
261 | 267 |
262 | 268 |
263 void AstNumberingVisitor::VisitWithStatement(WithStatement* node) { | 269 void AstNumberingVisitor::VisitWithStatement(WithStatement* node) { |
264 IncrementNodeCount(); | 270 IncrementNodeCount(); |
265 DisableCrankshaft(kWithStatement); | 271 DisableCrankshaft(kWithStatement); |
266 node->set_base_id(ReserveIdRange(WithStatement::num_ids())); | 272 node->set_base_id(ReserveIdRange(WithStatement::num_ids())); |
267 Visit(node->expression()); | 273 Visit(node->expression()); |
268 Visit(node->statement()); | 274 Visit(node->statement()); |
269 } | 275 } |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
602 } | 608 } |
603 | 609 |
604 | 610 |
605 bool AstNumbering::Renumber(Isolate* isolate, Zone* zone, | 611 bool AstNumbering::Renumber(Isolate* isolate, Zone* zone, |
606 FunctionLiteral* function) { | 612 FunctionLiteral* function) { |
607 AstNumberingVisitor visitor(isolate, zone); | 613 AstNumberingVisitor visitor(isolate, zone); |
608 return visitor.Renumber(function); | 614 return visitor.Renumber(function); |
609 } | 615 } |
610 } // namespace internal | 616 } // namespace internal |
611 } // namespace v8 | 617 } // namespace v8 |
OLD | NEW |