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

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

Issue 333773006: Removes open arrays (e.g. data[0]) from raw objects. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/dart_api_impl.cc ('k') | runtime/vm/object.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/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
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
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
OLDNEW
« no previous file with comments | « runtime/vm/dart_api_impl.cc ('k') | runtime/vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698