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

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

Issue 1870343002: - Refactor Symbol allocation to expect a thread parameter. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Address review feedback. 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
« no previous file with comments | « runtime/vm/profiler_test.cc ('k') | runtime/vm/regexp.h » ('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/native_entry.h" 5 #include "vm/native_entry.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/stub_code.h" 9 #include "vm/stub_code.h"
10 #include "vm/symbols.h" 10 #include "vm/symbols.h"
(...skipping 2500 matching lines...) Expand 10 before | Expand all | Expand 10 after
2511 CallbackType new_symbol, 2511 CallbackType new_symbol,
2512 Snapshot::Kind kind) { 2512 Snapshot::Kind kind) {
2513 ASSERT(reader != NULL); 2513 ASSERT(reader != NULL);
2514 if (RawObject::IsCanonical(tags)) { 2514 if (RawObject::IsCanonical(tags)) {
2515 // Set up canonical string object. 2515 // Set up canonical string object.
2516 ASSERT(reader != NULL); 2516 ASSERT(reader != NULL);
2517 CharacterType* ptr = reader->zone()->Alloc<CharacterType>(len); 2517 CharacterType* ptr = reader->zone()->Alloc<CharacterType>(len);
2518 for (intptr_t i = 0; i < len; i++) { 2518 for (intptr_t i = 0; i < len; i++) {
2519 ptr[i] = reader->Read<CharacterType>(); 2519 ptr[i] = reader->Read<CharacterType>();
2520 } 2520 }
2521 *str_obj ^= (*new_symbol)(ptr, len); 2521 *str_obj ^= (*new_symbol)(reader->thread(), ptr, len);
2522 } else { 2522 } else {
2523 // Set up the string object. 2523 // Set up the string object.
2524 *str_obj = StringType::New(len, HEAP_SPACE(kind)); 2524 *str_obj = StringType::New(len, HEAP_SPACE(kind));
2525 str_obj->SetHash(0); // Will get computed when needed. 2525 str_obj->SetHash(0); // Will get computed when needed.
2526 if (len == 0) { 2526 if (len == 0) {
2527 return; 2527 return;
2528 } 2528 }
2529 NoSafepointScope no_safepoint; 2529 NoSafepointScope no_safepoint;
2530 CharacterType* str_addr = StringType::CharAddr(*str_obj, 0); 2530 CharacterType* str_addr = StringType::CharAddr(*str_obj, 0);
2531 for (intptr_t i = 0; i < len; i++) { 2531 for (intptr_t i = 0; i < len; i++) {
(...skipping 1168 matching lines...) Expand 10 before | Expand all | Expand 10 after
3700 // We do not allow objects with native fields in an isolate message. 3700 // We do not allow objects with native fields in an isolate message.
3701 writer->SetWriteException(Exceptions::kArgument, 3701 writer->SetWriteException(Exceptions::kArgument,
3702 "Illegal argument in isolate message" 3702 "Illegal argument in isolate message"
3703 " : (object is a UserTag)"); 3703 " : (object is a UserTag)");
3704 } else { 3704 } else {
3705 UNREACHABLE(); 3705 UNREACHABLE();
3706 } 3706 }
3707 } 3707 }
3708 3708
3709 } // namespace dart 3709 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/profiler_test.cc ('k') | runtime/vm/regexp.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698