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/compiler.h" | 9 #include "src/compiler.h" |
10 #include "src/objects-inl.h" | 10 #include "src/objects-inl.h" |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 // The AstNumberingVisitor is what learns whether it is caught. To make | 288 // The AstNumberingVisitor is what learns whether it is caught. To make |
289 // the information available later to the runtime, the AstNumberingVisitor | 289 // the information available later to the runtime, the AstNumberingVisitor |
290 // has to stash it somewhere. Changing the runtime function into another | 290 // has to stash it somewhere. Changing the runtime function into another |
291 // one in ast-numbering seemed like a simple and straightforward solution to | 291 // one in ast-numbering seemed like a simple and straightforward solution to |
292 // that problem. | 292 // that problem. |
293 if (node->is_jsruntime() && | 293 if (node->is_jsruntime() && |
294 node->context_index() == Context::ASYNC_FUNCTION_AWAIT_CAUGHT_INDEX && | 294 node->context_index() == Context::ASYNC_FUNCTION_AWAIT_CAUGHT_INDEX && |
295 catch_prediction_ == HandlerTable::ASYNC_AWAIT) { | 295 catch_prediction_ == HandlerTable::ASYNC_AWAIT) { |
296 node->set_context_index(Context::ASYNC_FUNCTION_AWAIT_UNCAUGHT_INDEX); | 296 node->set_context_index(Context::ASYNC_FUNCTION_AWAIT_UNCAUGHT_INDEX); |
297 } | 297 } |
| 298 |
| 299 // Similar measures are taken for AsyncGeneratorAwait calls. |
| 300 if (node->is_jsruntime() && |
| 301 node->context_index() == Context::ASYNC_GENERATOR_AWAIT_CAUGHT && |
| 302 catch_prediction_ == HandlerTable::ASYNC_AWAIT) { |
| 303 node->set_context_index(Context::ASYNC_GENERATOR_AWAIT_UNCAUGHT); |
| 304 } |
298 } | 305 } |
299 | 306 |
300 | 307 |
301 void AstNumberingVisitor::VisitWithStatement(WithStatement* node) { | 308 void AstNumberingVisitor::VisitWithStatement(WithStatement* node) { |
302 IncrementNodeCount(); | 309 IncrementNodeCount(); |
303 DisableFullCodegenAndCrankshaft(kWithStatement); | 310 DisableFullCodegenAndCrankshaft(kWithStatement); |
304 Visit(node->expression()); | 311 Visit(node->expression()); |
305 Visit(node->statement()); | 312 Visit(node->statement()); |
306 } | 313 } |
307 | 314 |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
662 } | 669 } |
663 | 670 |
664 bool AstNumbering::Renumber( | 671 bool AstNumbering::Renumber( |
665 Isolate* isolate, Zone* zone, FunctionLiteral* function, | 672 Isolate* isolate, Zone* zone, FunctionLiteral* function, |
666 Compiler::EagerInnerFunctionLiterals* eager_literals) { | 673 Compiler::EagerInnerFunctionLiterals* eager_literals) { |
667 AstNumberingVisitor visitor(isolate, zone, eager_literals); | 674 AstNumberingVisitor visitor(isolate, zone, eager_literals); |
668 return visitor.Renumber(function); | 675 return visitor.Renumber(function); |
669 } | 676 } |
670 } // namespace internal | 677 } // namespace internal |
671 } // namespace v8 | 678 } // namespace v8 |
OLD | NEW |