| 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 8927 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8938 const Array& args_descriptor = | 8938 const Array& args_descriptor = |
| 8939 Array::Handle(ArgumentsDescriptor::New(num_arguments, | 8939 Array::Handle(ArgumentsDescriptor::New(num_arguments, |
| 8940 arguments->names())); | 8940 arguments->names())); |
| 8941 const Object& result = | 8941 const Object& result = |
| 8942 Object::Handle(DartEntry::InvokeFunction(constructor, | 8942 Object::Handle(DartEntry::InvokeFunction(constructor, |
| 8943 arg_values, | 8943 arg_values, |
| 8944 args_descriptor)); | 8944 args_descriptor)); |
| 8945 if (result.IsError()) { | 8945 if (result.IsError()) { |
| 8946 // An exception may not occur in every parse attempt, i.e., the | 8946 // An exception may not occur in every parse attempt, i.e., the |
| 8947 // generated AST is not deterministic. Therefore mark the function as | 8947 // generated AST is not deterministic. Therefore mark the function as |
| 8948 // not optimizable. | 8948 // not optimizable. Unless we are evaluating metadata, in which case there |
| 8949 current_function().SetIsOptimizable(false); | 8949 // is no current function. |
| 8950 if (!parsing_metadata_) { |
| 8951 current_function().SetIsOptimizable(false); |
| 8952 } |
| 8950 if (result.IsUnhandledException()) { | 8953 if (result.IsUnhandledException()) { |
| 8951 return result.raw(); | 8954 return result.raw(); |
| 8952 } else { | 8955 } else { |
| 8953 isolate()->long_jump_base()->Jump(1, Error::Cast(result)); | 8956 isolate()->long_jump_base()->Jump(1, Error::Cast(result)); |
| 8954 UNREACHABLE(); | 8957 UNREACHABLE(); |
| 8955 return Object::null(); | 8958 return Object::null(); |
| 8956 } | 8959 } |
| 8957 } else { | 8960 } else { |
| 8958 if (constructor.IsFactory()) { | 8961 if (constructor.IsFactory()) { |
| 8959 // The factory method returns the allocated object. | 8962 // The factory method returns the allocated object. |
| (...skipping 1831 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10791 void Parser::SkipQualIdent() { | 10794 void Parser::SkipQualIdent() { |
| 10792 ASSERT(IsIdentifier()); | 10795 ASSERT(IsIdentifier()); |
| 10793 ConsumeToken(); | 10796 ConsumeToken(); |
| 10794 if (CurrentToken() == Token::kPERIOD) { | 10797 if (CurrentToken() == Token::kPERIOD) { |
| 10795 ConsumeToken(); // Consume the kPERIOD token. | 10798 ConsumeToken(); // Consume the kPERIOD token. |
| 10796 ExpectIdentifier("identifier expected after '.'"); | 10799 ExpectIdentifier("identifier expected after '.'"); |
| 10797 } | 10800 } |
| 10798 } | 10801 } |
| 10799 | 10802 |
| 10800 } // namespace dart | 10803 } // namespace dart |
| OLD | NEW |