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

Side by Side Diff: vm/raw_object_snapshot.cc

Issue 11411341: Fix for issue 7089 (Symbols::New was not quite working correctly (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 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 | « vm/object_test.cc ('k') | vm/scanner.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) 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/bigint_operations.h" 5 #include "vm/bigint_operations.h"
6 #include "vm/object.h" 6 #include "vm/object.h"
7 #include "vm/object_store.h" 7 #include "vm/object_store.h"
8 #include "vm/snapshot.h" 8 #include "vm/snapshot.h"
9 #include "vm/symbols.h" 9 #include "vm/symbols.h"
10 #include "vm/visitor.h" 10 #include "vm/visitor.h"
(...skipping 1599 matching lines...) Expand 10 before | Expand all | Expand 10 after
1610 Snapshot::Kind kind) { 1610 Snapshot::Kind kind) {
1611 ASSERT(reader != NULL); 1611 ASSERT(reader != NULL);
1612 if (RawObject::IsCanonical(tags)) { 1612 if (RawObject::IsCanonical(tags)) {
1613 // Set up canonical string object. 1613 // Set up canonical string object.
1614 ASSERT(reader != NULL); 1614 ASSERT(reader != NULL);
1615 CharacterType* ptr = 1615 CharacterType* ptr =
1616 Isolate::Current()->current_zone()->Alloc<CharacterType>(len); 1616 Isolate::Current()->current_zone()->Alloc<CharacterType>(len);
1617 for (intptr_t i = 0; i < len; i++) { 1617 for (intptr_t i = 0; i < len; i++) {
1618 ptr[i] = reader->Read<CharacterType>(); 1618 ptr[i] = reader->Read<CharacterType>();
1619 } 1619 }
1620 *str_obj ^= Symbols::New(ptr, len); 1620 *str_obj ^= Symbols::NewSymbol(ptr, len);
1621 } else { 1621 } else {
1622 // Set up the string object. 1622 // Set up the string object.
1623 *str_obj = StringType::New(len, HEAP_SPACE(kind)); 1623 *str_obj = StringType::New(len, HEAP_SPACE(kind));
1624 str_obj->set_tags(tags); 1624 str_obj->set_tags(tags);
1625 str_obj->SetHash(0); // Will get computed when needed. 1625 str_obj->SetHash(0); // Will get computed when needed.
1626 for (intptr_t i = 0; i < len; i++) { 1626 for (intptr_t i = 0; i < len; i++) {
1627 *StringType::CharAddr(*str_obj, i) = reader->Read<CharacterType>(); 1627 *StringType::CharAddr(*str_obj, i) = reader->Read<CharacterType>();
1628 } 1628 }
1629 } 1629 }
1630 } 1630 }
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after
2210 // Write out the class and tags information. 2210 // Write out the class and tags information.
2211 writer->WriteIndexedObject(kWeakPropertyCid); 2211 writer->WriteIndexedObject(kWeakPropertyCid);
2212 writer->WriteIntptrValue(writer->GetObjectTags(this)); 2212 writer->WriteIntptrValue(writer->GetObjectTags(this));
2213 2213
2214 // Write out all the other fields. 2214 // Write out all the other fields.
2215 writer->Write<RawObject*>(ptr()->key_); 2215 writer->Write<RawObject*>(ptr()->key_);
2216 writer->Write<RawObject*>(ptr()->value_); 2216 writer->Write<RawObject*>(ptr()->value_);
2217 } 2217 }
2218 2218
2219 } // namespace dart 2219 } // namespace dart
OLDNEW
« no previous file with comments | « vm/object_test.cc ('k') | vm/scanner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698