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 1968 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1979 } | 1979 } |
1980 *str_obj ^= (*new_symbol)(reader->thread(), ptr, len); | 1980 *str_obj ^= (*new_symbol)(reader->thread(), ptr, len); |
1981 } else { | 1981 } else { |
1982 // Set up the string object. | 1982 // Set up the string object. |
1983 *str_obj = StringType::New(len, HEAP_SPACE(kind)); | 1983 *str_obj = StringType::New(len, HEAP_SPACE(kind)); |
1984 str_obj->SetHash(0); // Will get computed when needed. | 1984 str_obj->SetHash(0); // Will get computed when needed. |
1985 if (len == 0) { | 1985 if (len == 0) { |
1986 return; | 1986 return; |
1987 } | 1987 } |
1988 NoSafepointScope no_safepoint; | 1988 NoSafepointScope no_safepoint; |
1989 CharacterType* str_addr = StringType::CharAddr(*str_obj, 0); | 1989 CharacterType* str_addr = StringType::DataStart(*str_obj); |
1990 for (intptr_t i = 0; i < len; i++) { | 1990 for (intptr_t i = 0; i < len; i++) { |
1991 *str_addr = reader->Read<CharacterType>(); | 1991 *str_addr = reader->Read<CharacterType>(); |
1992 str_addr++; | 1992 str_addr++; |
1993 } | 1993 } |
1994 } | 1994 } |
1995 } | 1995 } |
1996 | 1996 |
1997 RawOneByteString* OneByteString::ReadFrom(SnapshotReader* reader, | 1997 RawOneByteString* OneByteString::ReadFrom(SnapshotReader* reader, |
1998 intptr_t object_id, | 1998 intptr_t object_id, |
1999 intptr_t tags, | 1999 intptr_t tags, |
(...skipping 934 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2934 // We do not allow objects with native fields in an isolate message. | 2934 // We do not allow objects with native fields in an isolate message. |
2935 writer->SetWriteException(Exceptions::kArgument, | 2935 writer->SetWriteException(Exceptions::kArgument, |
2936 "Illegal argument in isolate message" | 2936 "Illegal argument in isolate message" |
2937 " : (object is a UserTag)"); | 2937 " : (object is a UserTag)"); |
2938 } else { | 2938 } else { |
2939 UNREACHABLE(); | 2939 UNREACHABLE(); |
2940 } | 2940 } |
2941 } | 2941 } |
2942 | 2942 |
2943 } // namespace dart | 2943 } // namespace dart |
OLD | NEW |