| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/parser.h" | 5 #include "vm/parser.h" |
| 6 #include "vm/flags.h" | 6 #include "vm/flags.h" |
| 7 | 7 |
| 8 #ifndef DART_PRECOMPILED_RUNTIME | 8 #ifndef DART_PRECOMPILED_RUNTIME |
| 9 | 9 |
| 10 #include "lib/invocation_mirror.h" | 10 #include "lib/invocation_mirror.h" |
| (...skipping 3560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3571 func.set_modifier(func_modifier); | 3571 func.set_modifier(func_modifier); |
| 3572 } | 3572 } |
| 3573 | 3573 |
| 3574 OpenBlock(); // Open a nested scope for the outermost function block. | 3574 OpenBlock(); // Open a nested scope for the outermost function block. |
| 3575 | 3575 |
| 3576 Function& generated_body_closure = Function::ZoneHandle(Z); | 3576 Function& generated_body_closure = Function::ZoneHandle(Z); |
| 3577 if (func.IsAsyncFunction()) { | 3577 if (func.IsAsyncFunction()) { |
| 3578 ASSERT(!func.is_generated_body()); | 3578 ASSERT(!func.is_generated_body()); |
| 3579 // The code of an async function is synthesized. Disable debugging. | 3579 // The code of an async function is synthesized. Disable debugging. |
| 3580 func.set_is_debuggable(false); | 3580 func.set_is_debuggable(false); |
| 3581 // In order to collect causal asynchronous stacks efficiently we rely on | 3581 if (FLAG_causal_async_stacks) { |
| 3582 // this function not being inlined. | 3582 // In order to collect causal asynchronous stacks efficiently we rely on |
| 3583 func.set_is_inlinable(!FLAG_causal_async_stacks); | 3583 // this function not being inlined. |
| 3584 func.set_is_inlinable(false); |
| 3585 } |
| 3584 generated_body_closure = OpenAsyncFunction(func.token_pos()); | 3586 generated_body_closure = OpenAsyncFunction(func.token_pos()); |
| 3585 } else if (func.IsAsyncClosure()) { | 3587 } else if (func.IsAsyncClosure()) { |
| 3586 // The closure containing the body of an async function is debuggable. | 3588 // The closure containing the body of an async function is debuggable. |
| 3587 ASSERT(func.is_debuggable()); | 3589 ASSERT(func.is_debuggable()); |
| 3588 // In order to collect causal asynchronous stacks efficiently we rely on | 3590 if (FLAG_causal_async_stacks) { |
| 3589 // this function not being inlined. | 3591 // In order to collect causal asynchronous stacks efficiently we rely on |
| 3590 func.set_is_inlinable(!FLAG_causal_async_stacks); | 3592 // this function not being inlined. |
| 3593 func.set_is_inlinable(false); |
| 3594 } |
| 3591 OpenAsyncClosure(); | 3595 OpenAsyncClosure(); |
| 3592 } else if (func.IsSyncGenerator()) { | 3596 } else if (func.IsSyncGenerator()) { |
| 3593 // The code of a sync generator is synthesized. Disable debugging. | 3597 // The code of a sync generator is synthesized. Disable debugging. |
| 3594 func.set_is_debuggable(false); | 3598 func.set_is_debuggable(false); |
| 3595 generated_body_closure = OpenSyncGeneratorFunction(func.token_pos()); | 3599 generated_body_closure = OpenSyncGeneratorFunction(func.token_pos()); |
| 3596 } else if (func.IsSyncGenClosure()) { | 3600 } else if (func.IsSyncGenClosure()) { |
| 3597 // The closure containing the body of a sync generator is debuggable. | 3601 // The closure containing the body of a sync generator is debuggable. |
| 3598 ASSERT(func.is_debuggable()); | 3602 ASSERT(func.is_debuggable()); |
| 3599 async_temp_scope_ = current_block_->scope; | 3603 async_temp_scope_ = current_block_->scope; |
| 3600 } else if (func.IsAsyncGenerator()) { | 3604 } else if (func.IsAsyncGenerator()) { |
| 3601 func.set_is_debuggable(false); | 3605 func.set_is_debuggable(false); |
| 3602 // In order to collect causal asynchronous stacks efficiently we rely on | 3606 if (FLAG_causal_async_stacks) { |
| 3603 // this function not being inlined. | 3607 // In order to collect causal asynchronous stacks efficiently we rely on |
| 3604 func.set_is_inlinable(!FLAG_causal_async_stacks); | 3608 // this function not being inlined. |
| 3609 func.set_is_inlinable(false); |
| 3610 } |
| 3605 generated_body_closure = OpenAsyncGeneratorFunction(func.token_pos()); | 3611 generated_body_closure = OpenAsyncGeneratorFunction(func.token_pos()); |
| 3606 } else if (func.IsAsyncGenClosure()) { | 3612 } else if (func.IsAsyncGenClosure()) { |
| 3607 // The closure containing the body of an async* function is debuggable. | 3613 // The closure containing the body of an async* function is debuggable. |
| 3608 ASSERT(func.is_debuggable()); | 3614 ASSERT(func.is_debuggable()); |
| 3609 // In order to collect causal asynchronous stacks efficiently we rely on | 3615 if (FLAG_causal_async_stacks) { |
| 3610 // this function not being inlined. | 3616 // In order to collect causal asynchronous stacks efficiently we rely on |
| 3611 func.set_is_inlinable(!FLAG_causal_async_stacks); | 3617 // this function not being inlined. |
| 3618 func.set_is_inlinable(false); |
| 3619 } |
| 3612 OpenAsyncGeneratorClosure(); | 3620 OpenAsyncGeneratorClosure(); |
| 3613 } | 3621 } |
| 3614 | 3622 |
| 3615 BoolScope allow_await(&this->await_is_keyword_, | 3623 BoolScope allow_await(&this->await_is_keyword_, |
| 3616 func.IsAsyncOrGenerator() || func.is_generated_body()); | 3624 func.IsAsyncOrGenerator() || func.is_generated_body()); |
| 3617 TokenPosition end_token_pos = TokenPosition::kNoSource; | 3625 TokenPosition end_token_pos = TokenPosition::kNoSource; |
| 3618 if (CurrentToken() == Token::kLBRACE) { | 3626 if (CurrentToken() == Token::kLBRACE) { |
| 3619 ConsumeToken(); | 3627 ConsumeToken(); |
| 3620 if (String::Handle(Z, func.name()).Equals(Symbols::EqualOperator())) { | 3628 if (String::Handle(Z, func.name()).Equals(Symbols::EqualOperator())) { |
| 3621 const Class& owner = Class::Handle(Z, func.Owner()); | 3629 const Class& owner = Class::Handle(Z, func.Owner()); |
| (...skipping 11445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15067 const ArgumentListNode& function_args, | 15075 const ArgumentListNode& function_args, |
| 15068 const LocalVariable* temp_for_last_arg, | 15076 const LocalVariable* temp_for_last_arg, |
| 15069 bool is_super_invocation) { | 15077 bool is_super_invocation) { |
| 15070 UNREACHABLE(); | 15078 UNREACHABLE(); |
| 15071 return NULL; | 15079 return NULL; |
| 15072 } | 15080 } |
| 15073 | 15081 |
| 15074 } // namespace dart | 15082 } // namespace dart |
| 15075 | 15083 |
| 15076 #endif // DART_PRECOMPILED_RUNTIME | 15084 #endif // DART_PRECOMPILED_RUNTIME |
| OLD | NEW |