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

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

Issue 781203005: Allow Symbols in switch and maps (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/object_store.h ('k') | runtime/vm/parser.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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/object_store.h" 5 #include "vm/object_store.h"
6 6
7 #include "vm/exceptions.h" 7 #include "vm/exceptions.h"
8 #include "vm/dart_entry.h" 8 #include "vm/dart_entry.h"
9 #include "vm/isolate.h" 9 #include "vm/isolate.h"
10 #include "vm/object.h" 10 #include "vm/object.h"
(...skipping 20 matching lines...) Expand all
31 bigint_class_(Class::null()), 31 bigint_class_(Class::null()),
32 double_class_(Class::null()), 32 double_class_(Class::null()),
33 double_type_(Type::null()), 33 double_type_(Type::null()),
34 float32x4_type_(Type::null()), 34 float32x4_type_(Type::null()),
35 int32x4_type_(Type::null()), 35 int32x4_type_(Type::null()),
36 float64x2_type_(Type::null()), 36 float64x2_type_(Type::null()),
37 string_type_(Type::null()), 37 string_type_(Type::null()),
38 future_class_(Class::null()), 38 future_class_(Class::null()),
39 completer_class_(Class::null()), 39 completer_class_(Class::null()),
40 stream_iterator_class_(Class::null()), 40 stream_iterator_class_(Class::null()),
41 symbol_class_(Class::null()),
41 one_byte_string_class_(Class::null()), 42 one_byte_string_class_(Class::null()),
42 two_byte_string_class_(Class::null()), 43 two_byte_string_class_(Class::null()),
43 external_one_byte_string_class_(Class::null()), 44 external_one_byte_string_class_(Class::null()),
44 external_two_byte_string_class_(Class::null()), 45 external_two_byte_string_class_(Class::null()),
45 bool_type_(Type::null()), 46 bool_type_(Type::null()),
46 bool_class_(Class::null()), 47 bool_class_(Class::null()),
47 array_class_(Class::null()), 48 array_class_(Class::null()),
48 array_type_(Type::null()), 49 array_type_(Type::null()),
49 immutable_array_class_(Class::null()), 50 immutable_array_class_(Class::null()),
50 growable_object_array_class_(Class::null()), 51 growable_object_array_class_(Class::null()),
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 Stacktrace::Handle(Stacktrace::New(code_array, pc_offset_array)); 164 Stacktrace::Handle(Stacktrace::New(code_array, pc_offset_array));
164 // Expansion of inlined functions requires additional memory at run time, 165 // Expansion of inlined functions requires additional memory at run time,
165 // avoid it. 166 // avoid it.
166 stack_trace.set_expand_inlined(false); 167 stack_trace.set_expand_inlined(false);
167 set_preallocated_stack_trace(stack_trace); 168 set_preallocated_stack_trace(stack_trace);
168 169
169 return true; 170 return true;
170 } 171 }
171 172
172 173
173 void ObjectStore::InitAsyncObjects() { 174 void ObjectStore::InitKnownObjects() {
174 Isolate* isolate = Isolate::Current(); 175 Isolate* isolate = Isolate::Current();
175 ASSERT(isolate != NULL && isolate->object_store() == this); 176 ASSERT(isolate != NULL && isolate->object_store() == this);
176 177
177 const Library& async_lib = Library::Handle(async_library()); 178 const Library& async_lib = Library::Handle(async_library());
178 ASSERT(!async_lib.IsNull()); 179 ASSERT(!async_lib.IsNull());
179 Class& cls = Class::Handle(isolate); 180 Class& cls = Class::Handle(isolate);
180 cls = async_lib.LookupClass(Symbols::Future()); 181 cls = async_lib.LookupClass(Symbols::Future());
181 ASSERT(!cls.IsNull()); 182 ASSERT(!cls.IsNull());
182 set_future_class(cls); 183 set_future_class(cls);
183 cls = async_lib.LookupClass(Symbols::Completer()); 184 cls = async_lib.LookupClass(Symbols::Completer());
184 ASSERT(!cls.IsNull()); 185 ASSERT(!cls.IsNull());
185 set_completer_class(cls); 186 set_completer_class(cls);
186 cls = async_lib.LookupClass(Symbols::StreamIterator()); 187 cls = async_lib.LookupClass(Symbols::StreamIterator());
187 ASSERT(!cls.IsNull()); 188 ASSERT(!cls.IsNull());
188 set_stream_iterator_class(cls); 189 set_stream_iterator_class(cls);
190
191 const Library& internal_lib = Library::Handle(internal_library());
192 cls = internal_lib.LookupClass(Symbols::Symbol());
193 set_symbol_class(cls);
regis 2014/12/09 21:58:55 There are many other "known objects" that are look
hausner 2014/12/10 00:23:27 The only reason I'm aware of to do it here is that
189 } 194 }
190 195
191 } // namespace dart 196 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object_store.h ('k') | runtime/vm/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698