| 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 | 6 |
| 7 #include "lib/invocation_mirror.h" | 7 #include "lib/invocation_mirror.h" |
| 8 #include "platform/utils.h" | 8 #include "platform/utils.h" |
| 9 #include "vm/bootstrap.h" | 9 #include "vm/bootstrap.h" |
| 10 #include "vm/class_finalizer.h" | 10 #include "vm/class_finalizer.h" |
| (...skipping 8807 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8818 ASSERT(!func.IsNull()); | 8818 ASSERT(!func.IsNull()); |
| 8819 ASSERT(func.kind() == RawFunction::kImplicitStaticFinalGetter); | 8819 ASSERT(func.kind() == RawFunction::kImplicitStaticFinalGetter); |
| 8820 Object& const_value = Object::Handle( | 8820 Object& const_value = Object::Handle( |
| 8821 DartEntry::InvokeFunction(func, Object::empty_array())); | 8821 DartEntry::InvokeFunction(func, Object::empty_array())); |
| 8822 if (const_value.IsError()) { | 8822 if (const_value.IsError()) { |
| 8823 const Error& error = Error::Cast(const_value); | 8823 const Error& error = Error::Cast(const_value); |
| 8824 if (error.IsUnhandledException()) { | 8824 if (error.IsUnhandledException()) { |
| 8825 // An exception may not occur in every parse attempt, i.e., the | 8825 // An exception may not occur in every parse attempt, i.e., the |
| 8826 // generated AST is not deterministic. Therefore mark the function as | 8826 // generated AST is not deterministic. Therefore mark the function as |
| 8827 // not optimizable. | 8827 // not optimizable. |
| 8828 current_function().set_is_optimizable(false); | 8828 current_function().SetIsOptimizable(false); |
| 8829 field.set_value(Object::null_instance()); | 8829 field.set_value(Object::null_instance()); |
| 8830 // It is a compile-time error if evaluation of a compile-time constant | 8830 // It is a compile-time error if evaluation of a compile-time constant |
| 8831 // would raise an exception. | 8831 // would raise an exception. |
| 8832 AppendErrorMsg(error, field_ref_pos, | 8832 AppendErrorMsg(error, field_ref_pos, |
| 8833 "error initializing const field '%s'", | 8833 "error initializing const field '%s'", |
| 8834 String::Handle(field.name()).ToCString()); | 8834 String::Handle(field.name()).ToCString()); |
| 8835 } else { | 8835 } else { |
| 8836 isolate()->long_jump_base()->Jump(1, error); | 8836 isolate()->long_jump_base()->Jump(1, error); |
| 8837 } | 8837 } |
| 8838 } | 8838 } |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8900 Array::Handle(ArgumentsDescriptor::New(num_arguments, | 8900 Array::Handle(ArgumentsDescriptor::New(num_arguments, |
| 8901 arguments->names())); | 8901 arguments->names())); |
| 8902 const Object& result = | 8902 const Object& result = |
| 8903 Object::Handle(DartEntry::InvokeFunction(constructor, | 8903 Object::Handle(DartEntry::InvokeFunction(constructor, |
| 8904 arg_values, | 8904 arg_values, |
| 8905 args_descriptor)); | 8905 args_descriptor)); |
| 8906 if (result.IsError()) { | 8906 if (result.IsError()) { |
| 8907 // An exception may not occur in every parse attempt, i.e., the | 8907 // An exception may not occur in every parse attempt, i.e., the |
| 8908 // generated AST is not deterministic. Therefore mark the function as | 8908 // generated AST is not deterministic. Therefore mark the function as |
| 8909 // not optimizable. | 8909 // not optimizable. |
| 8910 current_function().set_is_optimizable(false); | 8910 current_function().SetIsOptimizable(false); |
| 8911 if (result.IsUnhandledException()) { | 8911 if (result.IsUnhandledException()) { |
| 8912 return result.raw(); | 8912 return result.raw(); |
| 8913 } else { | 8913 } else { |
| 8914 isolate()->long_jump_base()->Jump(1, Error::Cast(result)); | 8914 isolate()->long_jump_base()->Jump(1, Error::Cast(result)); |
| 8915 UNREACHABLE(); | 8915 UNREACHABLE(); |
| 8916 return Object::null(); | 8916 return Object::null(); |
| 8917 } | 8917 } |
| 8918 } else { | 8918 } else { |
| 8919 if (constructor.IsFactory()) { | 8919 if (constructor.IsFactory()) { |
| 8920 // The factory method returns the allocated object. | 8920 // The factory method returns the allocated object. |
| (...skipping 1830 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10751 void Parser::SkipQualIdent() { | 10751 void Parser::SkipQualIdent() { |
| 10752 ASSERT(IsIdentifier()); | 10752 ASSERT(IsIdentifier()); |
| 10753 ConsumeToken(); | 10753 ConsumeToken(); |
| 10754 if (CurrentToken() == Token::kPERIOD) { | 10754 if (CurrentToken() == Token::kPERIOD) { |
| 10755 ConsumeToken(); // Consume the kPERIOD token. | 10755 ConsumeToken(); // Consume the kPERIOD token. |
| 10756 ExpectIdentifier("identifier expected after '.'"); | 10756 ExpectIdentifier("identifier expected after '.'"); |
| 10757 } | 10757 } |
| 10758 } | 10758 } |
| 10759 | 10759 |
| 10760 } // namespace dart | 10760 } // namespace dart |
| OLD | NEW |