| 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 "vm/bigint_operations.h" | 8 #include "vm/bigint_operations.h" |
| 9 #include "vm/class_finalizer.h" | 9 #include "vm/class_finalizer.h" |
| 10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
| (...skipping 8254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8265 AbstractTypeArguments::Handle(type_arguments.Canonicalize())); | 8265 AbstractTypeArguments::Handle(type_arguments.Canonicalize())); |
| 8266 } | 8266 } |
| 8267 arg_values.SetAt(0, instance); | 8267 arg_values.SetAt(0, instance); |
| 8268 arg_values.SetAt(1, Smi::Handle(Smi::New(Function::kCtorPhaseAll))); | 8268 arg_values.SetAt(1, Smi::Handle(Smi::New(Function::kCtorPhaseAll))); |
| 8269 for (int i = 0; i < arguments->length(); i++) { | 8269 for (int i = 0; i < arguments->length(); i++) { |
| 8270 AstNode* arg = arguments->NodeAt(i); | 8270 AstNode* arg = arguments->NodeAt(i); |
| 8271 // Arguments have been evaluated to a literal value already. | 8271 // Arguments have been evaluated to a literal value already. |
| 8272 ASSERT(arg->IsLiteralNode()); | 8272 ASSERT(arg->IsLiteralNode()); |
| 8273 arg_values.SetAt((i + kNumExtraArgs), arg->AsLiteralNode()->literal()); | 8273 arg_values.SetAt((i + kNumExtraArgs), arg->AsLiteralNode()->literal()); |
| 8274 } | 8274 } |
| 8275 const Array& arg_descriptor = | 8275 const Array& args_descriptor = |
| 8276 Array::Handle(ArgumentsDescriptor::New(num_arguments, | 8276 Array::Handle(ArgumentsDescriptor::New(num_arguments, |
| 8277 arguments->names())); | 8277 arguments->names())); |
| 8278 const Object& result = | 8278 const Object& result = |
| 8279 Object::Handle(DartEntry::InvokeFunction(constructor, | 8279 Object::Handle(DartEntry::InvokeFunction(constructor, |
| 8280 arg_values, | 8280 arg_values, |
| 8281 arg_descriptor)); | 8281 args_descriptor)); |
| 8282 if (result.IsError()) { | 8282 if (result.IsError()) { |
| 8283 // An exception may not occur in every parse attempt, i.e., the | 8283 // An exception may not occur in every parse attempt, i.e., the |
| 8284 // generated AST is not deterministic. Therefore mark the function as | 8284 // generated AST is not deterministic. Therefore mark the function as |
| 8285 // not optimizable. | 8285 // not optimizable. |
| 8286 current_function().set_is_optimizable(false); | 8286 current_function().set_is_optimizable(false); |
| 8287 if (result.IsUnhandledException()) { | 8287 if (result.IsUnhandledException()) { |
| 8288 return result.raw(); | 8288 return result.raw(); |
| 8289 } else { | 8289 } else { |
| 8290 isolate()->long_jump_base()->Jump(1, Error::Cast(result)); | 8290 isolate()->long_jump_base()->Jump(1, Error::Cast(result)); |
| 8291 UNREACHABLE(); | 8291 UNREACHABLE(); |
| (...skipping 1798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10090 void Parser::SkipQualIdent() { | 10090 void Parser::SkipQualIdent() { |
| 10091 ASSERT(IsIdentifier()); | 10091 ASSERT(IsIdentifier()); |
| 10092 ConsumeToken(); | 10092 ConsumeToken(); |
| 10093 if (CurrentToken() == Token::kPERIOD) { | 10093 if (CurrentToken() == Token::kPERIOD) { |
| 10094 ConsumeToken(); // Consume the kPERIOD token. | 10094 ConsumeToken(); // Consume the kPERIOD token. |
| 10095 ExpectIdentifier("identifier expected after '.'"); | 10095 ExpectIdentifier("identifier expected after '.'"); |
| 10096 } | 10096 } |
| 10097 } | 10097 } |
| 10098 | 10098 |
| 10099 } // namespace dart | 10099 } // namespace dart |
| OLD | NEW |