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

Side by Side Diff: runtime/vm/object.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 | « no previous file | runtime/vm/object_store.h » ('j') | runtime/vm/object_store.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/object.h" 5 #include "vm/object.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/assembler.h" 9 #include "vm/assembler.h"
10 #include "vm/cpu.h" 10 #include "vm/cpu.h"
(...skipping 1502 matching lines...) Expand 10 before | Expand all | Expand 10 after
1513 field_name = Symbols::New("cid"#clazz); \ 1513 field_name = Symbols::New("cid"#clazz); \
1514 field = Field::New(field_name, true, false, true, false, cls, 0); \ 1514 field = Field::New(field_name, true, false, true, false, cls, 0); \
1515 value = Smi::New(k##clazz##Cid); \ 1515 value = Smi::New(k##clazz##Cid); \
1516 field.set_value(value); \ 1516 field.set_value(value); \
1517 field.set_type(Type::Handle(Type::IntType())); \ 1517 field.set_type(Type::Handle(Type::IntType())); \
1518 cls.AddField(field); \ 1518 cls.AddField(field); \
1519 1519
1520 CLASS_LIST_WITH_NULL(ADD_SET_FIELD) 1520 CLASS_LIST_WITH_NULL(ADD_SET_FIELD)
1521 #undef ADD_SET_FIELD 1521 #undef ADD_SET_FIELD
1522 1522
1523 isolate->object_store()->InitAsyncObjects(); 1523 isolate->object_store()->InitKnownObjects();
1524 1524
1525 return Error::null(); 1525 return Error::null();
1526 } 1526 }
1527 1527
1528 1528
1529 void Object::InitFromSnapshot(Isolate* isolate) { 1529 void Object::InitFromSnapshot(Isolate* isolate) {
1530 TIMERSCOPE(isolate, time_bootstrap); 1530 TIMERSCOPE(isolate, time_bootstrap);
1531 ObjectStore* object_store = isolate->object_store(); 1531 ObjectStore* object_store = isolate->object_store();
1532 1532
1533 Class& cls = Class::Handle(); 1533 Class& cls = Class::Handle();
(...skipping 16820 matching lines...) Expand 10 before | Expand all | Expand 10 after
18354 NoGCScope no_gc; 18354 NoGCScope no_gc;
18355 memmove(CharAddr(result, 0), characters, len); 18355 memmove(CharAddr(result, 0), characters, len);
18356 } 18356 }
18357 return OneByteString::raw(result); 18357 return OneByteString::raw(result);
18358 } 18358 }
18359 18359
18360 18360
18361 RawOneByteString* OneByteString::New(const uint16_t* characters, 18361 RawOneByteString* OneByteString::New(const uint16_t* characters,
18362 intptr_t len, 18362 intptr_t len,
18363 Heap::Space space) { 18363 Heap::Space space) {
18364 const String& result =String::Handle(OneByteString::New(len, space)); 18364 const String& result = String::Handle(OneByteString::New(len, space));
18365 NoGCScope no_gc; 18365 NoGCScope no_gc;
18366 for (intptr_t i = 0; i < len; ++i) { 18366 for (intptr_t i = 0; i < len; ++i) {
18367 ASSERT(Utf::IsLatin1(characters[i])); 18367 ASSERT(Utf::IsLatin1(characters[i]));
18368 *CharAddr(result, i) = characters[i]; 18368 *CharAddr(result, i) = characters[i];
18369 } 18369 }
18370 return OneByteString::raw(result); 18370 return OneByteString::raw(result);
18371 } 18371 }
18372 18372
18373 18373
18374 RawOneByteString* OneByteString::New(const int32_t* characters, 18374 RawOneByteString* OneByteString::New(const int32_t* characters,
(...skipping 2115 matching lines...) Expand 10 before | Expand all | Expand 10 after
20490 return tag_label.ToCString(); 20490 return tag_label.ToCString();
20491 } 20491 }
20492 20492
20493 20493
20494 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { 20494 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const {
20495 Instance::PrintJSONImpl(stream, ref); 20495 Instance::PrintJSONImpl(stream, ref);
20496 } 20496 }
20497 20497
20498 20498
20499 } // namespace dart 20499 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/object_store.h » ('j') | runtime/vm/object_store.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698