| 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 | 8 #ifndef DART_PRECOMPILED |
| 9 | 9 |
| 10 #include "lib/invocation_mirror.h" | 10 #include "lib/invocation_mirror.h" |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 &found_captured_variables); | 229 &found_captured_variables); |
| 230 | 230 |
| 231 // Frame indices are relative to the frame pointer and are decreasing. | 231 // Frame indices are relative to the frame pointer and are decreasing. |
| 232 ASSERT(next_free_frame_index <= first_stack_local_index_); | 232 ASSERT(next_free_frame_index <= first_stack_local_index_); |
| 233 num_stack_locals_ = first_stack_local_index_ - next_free_frame_index; | 233 num_stack_locals_ = first_stack_local_index_ - next_free_frame_index; |
| 234 } | 234 } |
| 235 | 235 |
| 236 | 236 |
| 237 struct CatchParamDesc { | 237 struct CatchParamDesc { |
| 238 CatchParamDesc() | 238 CatchParamDesc() |
| 239 : token_pos(0), type(NULL), name(NULL), var(NULL) { } | 239 : token_pos(Scanner::kNoSourcePos), type(NULL), name(NULL), var(NULL) { } |
| 240 intptr_t token_pos; | 240 intptr_t token_pos; |
| 241 const AbstractType* type; | 241 const AbstractType* type; |
| 242 const String* name; | 242 const String* name; |
| 243 LocalVariable* var; | 243 LocalVariable* var; |
| 244 }; | 244 }; |
| 245 | 245 |
| 246 | 246 |
| 247 void ParsedFunction::AllocateIrregexpVariables(intptr_t num_stack_locals) { | 247 void ParsedFunction::AllocateIrregexpVariables(intptr_t num_stack_locals) { |
| 248 ASSERT(function().IsIrregexpFunction()); | 248 ASSERT(function().IsIrregexpFunction()); |
| 249 ASSERT(function().NumOptionalParameters() == 0); | 249 ASSERT(function().NumOptionalParameters() == 0); |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 ASSERT(!current_function().IsNull()); | 383 ASSERT(!current_function().IsNull()); |
| 384 EnsureExpressionTemp(); | 384 EnsureExpressionTemp(); |
| 385 } | 385 } |
| 386 | 386 |
| 387 | 387 |
| 388 Parser::~Parser() { | 388 Parser::~Parser() { |
| 389 if (unregister_pending_function_) { | 389 if (unregister_pending_function_) { |
| 390 const GrowableObjectArray& pending_functions = | 390 const GrowableObjectArray& pending_functions = |
| 391 GrowableObjectArray::Handle(T->pending_functions()); | 391 GrowableObjectArray::Handle(T->pending_functions()); |
| 392 ASSERT(pending_functions.Length() > 0); | 392 ASSERT(pending_functions.Length() > 0); |
| 393 ASSERT(pending_functions.At(pending_functions.Length()-1) == | 393 ASSERT(pending_functions.At(pending_functions.Length() - 1) == |
| 394 current_function().raw()); | 394 current_function().raw()); |
| 395 pending_functions.RemoveLast(); | 395 pending_functions.RemoveLast(); |
| 396 } | 396 } |
| 397 } | 397 } |
| 398 | 398 |
| 399 | 399 |
| 400 // Each try in this function gets its own try index. | 400 // Each try in this function gets its own try index. |
| 401 // See definition of RawPcDescriptors::PcDescriptor. | 401 // See definition of RawPcDescriptors::PcDescriptor. |
| 402 int16_t Parser::AllocateTryIndex() { | 402 int16_t Parser::AllocateTryIndex() { |
| 403 if (!Utils::IsInt(16, last_used_try_index_ - 1)) { | 403 if (!Utils::IsInt(16, last_used_try_index_ - 1)) { |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 508 i.ToCString()); | 508 i.ToCString()); |
| 509 } | 509 } |
| 510 } | 510 } |
| 511 return ri; | 511 return ri; |
| 512 } | 512 } |
| 513 | 513 |
| 514 | 514 |
| 515 struct ParamDesc { | 515 struct ParamDesc { |
| 516 ParamDesc() | 516 ParamDesc() |
| 517 : type(NULL), | 517 : type(NULL), |
| 518 name_pos(0), | 518 name_pos(Scanner::kNoSourcePos), |
| 519 name(NULL), | 519 name(NULL), |
| 520 default_value(NULL), | 520 default_value(NULL), |
| 521 metadata(NULL), | 521 metadata(NULL), |
| 522 var(NULL), | 522 var(NULL), |
| 523 is_final(false), | 523 is_final(false), |
| 524 is_field_initializer(false), | 524 is_field_initializer(false), |
| 525 has_explicit_type(false) { } | 525 has_explicit_type(false) { } |
| 526 const AbstractType* type; | 526 const AbstractType* type; |
| 527 intptr_t name_pos; | 527 intptr_t name_pos; |
| 528 const String* name; | 528 const String* name; |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 613 void Clear() { | 613 void Clear() { |
| 614 has_abstract = false; | 614 has_abstract = false; |
| 615 has_external = false; | 615 has_external = false; |
| 616 has_final = false; | 616 has_final = false; |
| 617 has_const = false; | 617 has_const = false; |
| 618 has_static = false; | 618 has_static = false; |
| 619 has_var = false; | 619 has_var = false; |
| 620 has_factory = false; | 620 has_factory = false; |
| 621 has_operator = false; | 621 has_operator = false; |
| 622 has_native = false; | 622 has_native = false; |
| 623 metadata_pos = -1; | 623 metadata_pos = Scanner::kNoSourcePos; |
| 624 operator_token = Token::kILLEGAL; | 624 operator_token = Token::kILLEGAL; |
| 625 type = NULL; | 625 type = NULL; |
| 626 name_pos = 0; | 626 name_pos = 0; |
| 627 name = NULL; | 627 name = NULL; |
| 628 redirect_name = NULL; | 628 redirect_name = NULL; |
| 629 dict_name = NULL; | 629 dict_name = NULL; |
| 630 params.Clear(); | 630 params.Clear(); |
| 631 kind = RawFunction::kRegularFunction; | 631 kind = RawFunction::kRegularFunction; |
| 632 field_ = NULL; | 632 field_ = NULL; |
| 633 } | 633 } |
| (...skipping 13874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14508 const ArgumentListNode& function_args, | 14508 const ArgumentListNode& function_args, |
| 14509 const LocalVariable* temp_for_last_arg, | 14509 const LocalVariable* temp_for_last_arg, |
| 14510 bool is_super_invocation) { | 14510 bool is_super_invocation) { |
| 14511 UNREACHABLE(); | 14511 UNREACHABLE(); |
| 14512 return NULL; | 14512 return NULL; |
| 14513 } | 14513 } |
| 14514 | 14514 |
| 14515 } // namespace dart | 14515 } // namespace dart |
| 14516 | 14516 |
| 14517 #endif // DART_PRECOMPILED | 14517 #endif // DART_PRECOMPILED |
| OLD | NEW |