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 725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
736 const Array& param_descriptor = | 736 const Array& param_descriptor = |
737 Array::Handle(Array::New(param_cnt * kParameterEntrySize)); | 737 Array::Handle(Array::New(param_cnt * kParameterEntrySize)); |
738 for (int i = 0, j = 0; i < param_cnt; i++, j += kParameterEntrySize) { | 738 for (int i = 0, j = 0; i < param_cnt; i++, j += kParameterEntrySize) { |
739 param_descriptor.SetAt(j + kParameterIsFinalOffset, | 739 param_descriptor.SetAt(j + kParameterIsFinalOffset, |
740 param[i].is_final ? Bool::True() : Bool::False()); | 740 param[i].is_final ? Bool::True() : Bool::False()); |
741 param_descriptor.SetAt(j + kParameterDefaultValueOffset, | 741 param_descriptor.SetAt(j + kParameterDefaultValueOffset, |
742 (param[i].default_value == NULL) ? Object::null_instance() : | 742 (param[i].default_value == NULL) ? Object::null_instance() : |
743 *(param[i].default_value)); | 743 *(param[i].default_value)); |
744 const Object* metadata = param[i].metadata; | 744 const Object* metadata = param[i].metadata; |
745 if ((metadata != NULL) && (*metadata).IsError()) { | 745 if ((metadata != NULL) && (*metadata).IsError()) { |
746 return (*metadata).raw(); // Error evaluating the metadata. | 746 isolate->set_long_jump_base(base); |
| 747 return metadata->raw(); // Error evaluating the metadata. |
747 } | 748 } |
748 param_descriptor.SetAt(j + kParameterMetadataOffset, | 749 param_descriptor.SetAt(j + kParameterMetadataOffset, |
749 (param[i].metadata == NULL) ? Object::null_instance() : | 750 (param[i].metadata == NULL) ? Object::null_instance() : |
750 *(param[i].metadata)); | 751 *(param[i].metadata)); |
751 } | 752 } |
752 isolate->set_long_jump_base(base); | 753 isolate->set_long_jump_base(base); |
753 return param_descriptor.raw(); | 754 return param_descriptor.raw(); |
754 } else { | 755 } else { |
755 Error& error = Error::Handle(); | 756 Error& error = Error::Handle(); |
756 error = isolate->object_store()->sticky_error(); | 757 error = isolate->object_store()->sticky_error(); |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
857 StackZone zone(isolate); | 858 StackZone zone(isolate); |
858 LongJump* base = isolate->long_jump_base(); | 859 LongJump* base = isolate->long_jump_base(); |
859 LongJump jump; | 860 LongJump jump; |
860 isolate->set_long_jump_base(&jump); | 861 isolate->set_long_jump_base(&jump); |
861 if (setjmp(*jump.Set()) == 0) { | 862 if (setjmp(*jump.Set()) == 0) { |
862 const Script& script = Script::Handle(cls.script()); | 863 const Script& script = Script::Handle(cls.script()); |
863 const Library& lib = Library::Handle(cls.library()); | 864 const Library& lib = Library::Handle(cls.library()); |
864 Parser parser(script, lib, token_pos); | 865 Parser parser(script, lib, token_pos); |
865 parser.set_current_class(cls); | 866 parser.set_current_class(cls); |
866 parser.set_parsing_metadata(true); | 867 parser.set_parsing_metadata(true); |
867 return parser.EvaluateMetadata(); | 868 |
| 869 RawObject* metadata = parser.EvaluateMetadata(); |
| 870 isolate->set_long_jump_base(base); |
| 871 return metadata; |
868 } else { | 872 } else { |
869 Error& error = Error::Handle(); | 873 Error& error = Error::Handle(); |
870 error = isolate->object_store()->sticky_error(); | 874 error = isolate->object_store()->sticky_error(); |
871 isolate->object_store()->clear_sticky_error(); | 875 isolate->object_store()->clear_sticky_error(); |
872 isolate->set_long_jump_base(base); | 876 isolate->set_long_jump_base(base); |
873 return error.raw(); | 877 return error.raw(); |
874 } | 878 } |
875 UNREACHABLE(); | 879 UNREACHABLE(); |
876 return Object::null(); | 880 return Object::null(); |
877 } | 881 } |
(...skipping 9875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10753 void Parser::SkipQualIdent() { | 10757 void Parser::SkipQualIdent() { |
10754 ASSERT(IsIdentifier()); | 10758 ASSERT(IsIdentifier()); |
10755 ConsumeToken(); | 10759 ConsumeToken(); |
10756 if (CurrentToken() == Token::kPERIOD) { | 10760 if (CurrentToken() == Token::kPERIOD) { |
10757 ConsumeToken(); // Consume the kPERIOD token. | 10761 ConsumeToken(); // Consume the kPERIOD token. |
10758 ExpectIdentifier("identifier expected after '.'"); | 10762 ExpectIdentifier("identifier expected after '.'"); |
10759 } | 10763 } |
10760 } | 10764 } |
10761 | 10765 |
10762 } // namespace dart | 10766 } // namespace dart |
OLD | NEW |