| 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/parsing/parser.h" | 5 #include "src/parsing/parser.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "src/api.h" | 9 #include "src/api.h" |
| 10 #include "src/ast/ast-expression-rewriter.h" | 10 #include "src/ast/ast-expression-rewriter.h" |
| (...skipping 5439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5450 do_block->statements()->Add( | 5450 do_block->statements()->Add( |
| 5451 factory()->NewExpressionStatement(value_assignment, value->position()), | 5451 factory()->NewExpressionStatement(value_assignment, value->position()), |
| 5452 zone()); | 5452 zone()); |
| 5453 | 5453 |
| 5454 ZoneList<Expression*>* async_function_await_args = | 5454 ZoneList<Expression*>* async_function_await_args = |
| 5455 new (zone()) ZoneList<Expression*>(2, zone()); | 5455 new (zone()) ZoneList<Expression*>(2, zone()); |
| 5456 Expression* generator_object = | 5456 Expression* generator_object = |
| 5457 factory()->NewVariableProxy(generator_object_variable); | 5457 factory()->NewVariableProxy(generator_object_variable); |
| 5458 async_function_await_args->Add(generator_object, zone()); | 5458 async_function_await_args->Add(generator_object, zone()); |
| 5459 async_function_await_args->Add(temp_proxy, zone()); | 5459 async_function_await_args->Add(temp_proxy, zone()); |
| 5460 Expression* async_function_await = factory()->NewCallRuntime( | 5460 Expression* async_function_await = |
| 5461 Context::ASYNC_FUNCTION_AWAIT_INDEX, async_function_await_args, nopos); | 5461 factory()->NewCallRuntime(Context::ASYNC_FUNCTION_AWAIT_CAUGHT_INDEX, |
| 5462 async_function_await_args, nopos); |
| 5462 // Wrap await to provide a break location between value evaluation and yield. | 5463 // Wrap await to provide a break location between value evaluation and yield. |
| 5463 Expression* await_assignment = factory()->NewAssignment( | 5464 Expression* await_assignment = factory()->NewAssignment( |
| 5464 Token::ASSIGN, temp_proxy, async_function_await, nopos); | 5465 Token::ASSIGN, temp_proxy, async_function_await, nopos); |
| 5465 do_block->statements()->Add( | 5466 do_block->statements()->Add( |
| 5466 factory()->NewExpressionStatement(await_assignment, await_pos), zone()); | 5467 factory()->NewExpressionStatement(await_assignment, await_pos), zone()); |
| 5467 Expression* do_expr = factory()->NewDoExpression(do_block, temp_var, nopos); | 5468 Expression* do_expr = factory()->NewDoExpression(do_block, temp_var, nopos); |
| 5468 | 5469 |
| 5469 generator_object = factory()->NewVariableProxy(generator_object_variable); | 5470 generator_object = factory()->NewVariableProxy(generator_object_variable); |
| 5470 return factory()->NewYield(generator_object, do_expr, nopos, | 5471 return factory()->NewYield(generator_object, do_expr, nopos, |
| 5471 Yield::kOnExceptionRethrow); | 5472 Yield::kOnExceptionRethrow); |
| (...skipping 1188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6660 node->Print(Isolate::Current()); | 6661 node->Print(Isolate::Current()); |
| 6661 } | 6662 } |
| 6662 #endif // DEBUG | 6663 #endif // DEBUG |
| 6663 | 6664 |
| 6664 #undef CHECK_OK | 6665 #undef CHECK_OK |
| 6665 #undef CHECK_OK_VOID | 6666 #undef CHECK_OK_VOID |
| 6666 #undef CHECK_FAILED | 6667 #undef CHECK_FAILED |
| 6667 | 6668 |
| 6668 } // namespace internal | 6669 } // namespace internal |
| 6669 } // namespace v8 | 6670 } // namespace v8 |
| OLD | NEW |