| 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/bigint_operations.h" | 5 #include "vm/bigint_operations.h" |
| 6 #include "vm/dart_api_message.h" | 6 #include "vm/dart_api_message.h" |
| 7 #include "vm/object.h" | 7 #include "vm/object.h" |
| 8 #include "vm/snapshot_ids.h" | 8 #include "vm/snapshot_ids.h" |
| 9 #include "vm/symbols.h" | 9 #include "vm/symbols.h" |
| 10 #include "vm/unicode.h" | 10 #include "vm/unicode.h" |
| (...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 vm_symbol_references_ = | 365 vm_symbol_references_ = |
| 366 reinterpret_cast<Dart_CObject**>(alloc_(NULL, 0, size)); | 366 reinterpret_cast<Dart_CObject**>(alloc_(NULL, 0, size)); |
| 367 memset(vm_symbol_references_, 0, size); | 367 memset(vm_symbol_references_, 0, size); |
| 368 } | 368 } |
| 369 | 369 |
| 370 RawOneByteString* str = | 370 RawOneByteString* str = |
| 371 reinterpret_cast<RawOneByteString*>(Symbols::GetVMSymbol(object_id)); | 371 reinterpret_cast<RawOneByteString*>(Symbols::GetVMSymbol(object_id)); |
| 372 intptr_t len = Smi::Value(str->ptr()->length_); | 372 intptr_t len = Smi::Value(str->ptr()->length_); |
| 373 object = AllocateDartCObjectString(len); | 373 object = AllocateDartCObjectString(len); |
| 374 char* p = object->value.as_string; | 374 char* p = object->value.as_string; |
| 375 memmove(p, str->ptr()->data_, len); | 375 memmove(p, str->ptr()->data(), len); |
| 376 p[len] = '\0'; | 376 p[len] = '\0'; |
| 377 ASSERT(vm_symbol_references_[symbol_id] == NULL); | 377 ASSERT(vm_symbol_references_[symbol_id] == NULL); |
| 378 vm_symbol_references_[symbol_id] = object; | 378 vm_symbol_references_[symbol_id] = object; |
| 379 return object; | 379 return object; |
| 380 } | 380 } |
| 381 | 381 |
| 382 | 382 |
| 383 Dart_CObject* ApiMessageReader::ReadObjectRef() { | 383 Dart_CObject* ApiMessageReader::ReadObjectRef() { |
| 384 int64_t value64 = Read<int64_t>(); | 384 int64_t value64 = Read<int64_t>(); |
| 385 if ((value64 & kSmiTagMask) == 0) { | 385 if ((value64 & kSmiTagMask) == 0) { |
| (...skipping 795 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1181 if (!success) { | 1181 if (!success) { |
| 1182 UnmarkAllCObjects(object); | 1182 UnmarkAllCObjects(object); |
| 1183 return false; | 1183 return false; |
| 1184 } | 1184 } |
| 1185 } | 1185 } |
| 1186 UnmarkAllCObjects(object); | 1186 UnmarkAllCObjects(object); |
| 1187 return true; | 1187 return true; |
| 1188 } | 1188 } |
| 1189 | 1189 |
| 1190 } // namespace dart | 1190 } // namespace dart |
| OLD | NEW |