Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(89)

Side by Side Diff: runtime/vm/parser.cc

Issue 1868803002: Use symbols when looking up fields in a class (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_RUNTIME 8 #ifndef DART_PRECOMPILED_RUNTIME
9 9
10 #include "lib/invocation_mirror.h" 10 #include "lib/invocation_mirror.h"
(...skipping 4776 matching lines...) Expand 10 before | Expand all | Expand 10 after
4787 4787
4788 // Allocate the immutable array containing the enumeration values. 4788 // Allocate the immutable array containing the enumeration values.
4789 // The actual enum instance values will be patched in later. 4789 // The actual enum instance values will be patched in later.
4790 const Array& values_array = Array::Handle(Z, Array::New(i, Heap::kOld)); 4790 const Array& values_array = Array::Handle(Z, Array::New(i, Heap::kOld));
4791 values_field.SetStaticValue(values_array, true); 4791 values_field.SetStaticValue(values_array, true);
4792 values_field.RecordStore(values_array); 4792 values_field.RecordStore(values_array);
4793 4793
4794 // Create a static field that contains the list of enumeration names. 4794 // Create a static field that contains the list of enumeration names.
4795 // Clone the _enum_names field from the helper class. 4795 // Clone the _enum_names field from the helper class.
4796 Field& names_field = Field::Handle(Z, 4796 Field& names_field = Field::Handle(Z,
4797 helper_class.LookupStaticField(Symbols::_EnumNames())); 4797 helper_class.LookupStaticFieldAllowPrivate(Symbols::_EnumNames()));
4798 ASSERT(!names_field.IsNull()); 4798 ASSERT(!names_field.IsNull());
4799 names_field = names_field.Clone(cls); 4799 names_field = names_field.Clone(cls);
4800 enum_members.AddField(names_field); 4800 enum_members.AddField(names_field);
4801 const Array& names_array = Array::Handle(Array::MakeArray(enum_names)); 4801 const Array& names_array = Array::Handle(Array::MakeArray(enum_names));
4802 names_field.SetStaticValue(names_array, true); 4802 names_field.SetStaticValue(names_array, true);
4803 names_field.RecordStore(names_array); 4803 names_field.RecordStore(names_array);
4804 4804
4805 // Clone the toString() function from the helper class. 4805 // Clone the toString() function from the helper class.
4806 Function& to_string_func = Function::Handle(Z, 4806 Function& to_string_func = Function::Handle(Z,
4807 helper_class.LookupDynamicFunctionAllowPrivate(Symbols::toString())); 4807 helper_class.LookupDynamicFunctionAllowPrivate(Symbols::toString()));
(...skipping 9665 matching lines...) Expand 10 before | Expand all | Expand 10 after
14473 const ArgumentListNode& function_args, 14473 const ArgumentListNode& function_args,
14474 const LocalVariable* temp_for_last_arg, 14474 const LocalVariable* temp_for_last_arg,
14475 bool is_super_invocation) { 14475 bool is_super_invocation) {
14476 UNREACHABLE(); 14476 UNREACHABLE();
14477 return NULL; 14477 return NULL;
14478 } 14478 }
14479 14479
14480 } // namespace dart 14480 } // namespace dart
14481 14481
14482 #endif // DART_PRECOMPILED_RUNTIME 14482 #endif // DART_PRECOMPILED_RUNTIME
OLDNEW
« runtime/vm/object.cc ('K') | « runtime/vm/object.cc ('k') | runtime/vm/parser_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698