OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |