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 #include "src/objects-inl.h" | 9 #include "src/objects-inl.h" |
10 | 10 |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 // The AstNumberingVisitor is what learns whether it is caught. To make | 281 // The AstNumberingVisitor is what learns whether it is caught. To make |
282 // the information available later to the runtime, the AstNumberingVisitor | 282 // the information available later to the runtime, the AstNumberingVisitor |
283 // has to stash it somewhere. Changing the runtime function into another | 283 // has to stash it somewhere. Changing the runtime function into another |
284 // one in ast-numbering seemed like a simple and straightforward solution to | 284 // one in ast-numbering seemed like a simple and straightforward solution to |
285 // that problem. | 285 // that problem. |
286 if (node->is_jsruntime() && | 286 if (node->is_jsruntime() && |
287 node->context_index() == Context::ASYNC_FUNCTION_AWAIT_CAUGHT_INDEX && | 287 node->context_index() == Context::ASYNC_FUNCTION_AWAIT_CAUGHT_INDEX && |
288 catch_prediction_ == HandlerTable::ASYNC_AWAIT) { | 288 catch_prediction_ == HandlerTable::ASYNC_AWAIT) { |
289 node->set_context_index(Context::ASYNC_FUNCTION_AWAIT_UNCAUGHT_INDEX); | 289 node->set_context_index(Context::ASYNC_FUNCTION_AWAIT_UNCAUGHT_INDEX); |
290 } | 290 } |
| 291 |
| 292 // Similar measures are taken for AsyncGeneratorAwait calls. |
| 293 if (node->is_jsruntime() && |
| 294 node->context_index() == Context::ASYNC_GENERATOR_AWAIT_CAUGHT && |
| 295 catch_prediction_ == HandlerTable::ASYNC_AWAIT) { |
| 296 node->set_context_index(Context::ASYNC_GENERATOR_AWAIT_UNCAUGHT); |
| 297 } |
291 } | 298 } |
292 | 299 |
293 | 300 |
294 void AstNumberingVisitor::VisitWithStatement(WithStatement* node) { | 301 void AstNumberingVisitor::VisitWithStatement(WithStatement* node) { |
295 IncrementNodeCount(); | 302 IncrementNodeCount(); |
296 DisableFullCodegenAndCrankshaft(kWithStatement); | 303 DisableFullCodegenAndCrankshaft(kWithStatement); |
297 Visit(node->expression()); | 304 Visit(node->expression()); |
298 Visit(node->statement()); | 305 Visit(node->statement()); |
299 } | 306 } |
300 | 307 |
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
650 } | 657 } |
651 | 658 |
652 | 659 |
653 bool AstNumbering::Renumber(Isolate* isolate, Zone* zone, | 660 bool AstNumbering::Renumber(Isolate* isolate, Zone* zone, |
654 FunctionLiteral* function) { | 661 FunctionLiteral* function) { |
655 AstNumberingVisitor visitor(isolate, zone); | 662 AstNumberingVisitor visitor(isolate, zone); |
656 return visitor.Renumber(function); | 663 return visitor.Renumber(function); |
657 } | 664 } |
658 } // namespace internal | 665 } // namespace internal |
659 } // namespace v8 | 666 } // namespace v8 |
OLD | NEW |