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