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

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

Issue 11085003: Convert String to a class. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 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
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/dart_api_message.h" 5 #include "vm/dart_api_message.h"
6 #include "vm/object.h" 6 #include "vm/object.h"
7 #include "vm/snapshot_ids.h" 7 #include "vm/snapshot_ids.h"
8 #include "vm/symbols.h" 8 #include "vm/symbols.h"
9 9
10 namespace dart { 10 namespace dart {
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 if (object_id == kTrueValue) { 406 if (object_id == kTrueValue) {
407 return AllocateDartCObjectBool(true); 407 return AllocateDartCObjectBool(true);
408 } 408 }
409 if (object_id == kFalseValue) { 409 if (object_id == kFalseValue) {
410 return AllocateDartCObjectBool(false); 410 return AllocateDartCObjectBool(false);
411 } 411 }
412 if (object_id == kDynamicType || 412 if (object_id == kDynamicType ||
413 object_id == kDoubleType || 413 object_id == kDoubleType ||
414 object_id == kIntType || 414 object_id == kIntType ||
415 object_id == kBoolType || 415 object_id == kBoolType ||
416 object_id == kStringInterface) { 416 object_id == kStringType) {
417 // Always return dynamic type (this is only a marker). 417 // Always return dynamic type (this is only a marker).
418 return &dynamic_type_marker; 418 return &dynamic_type_marker;
419 } 419 }
420 intptr_t index = object_id - kMaxPredefinedObjectIds; 420 intptr_t index = object_id - kMaxPredefinedObjectIds;
421 ASSERT((0 <= index) && (index < backward_references_.length())); 421 ASSERT((0 <= index) && (index < backward_references_.length()));
422 ASSERT(backward_references_[index]->reference() != NULL); 422 ASSERT(backward_references_[index]->reference() != NULL);
423 return backward_references_[index]->reference(); 423 return backward_references_[index]->reference();
424 } 424 }
425 425
426 426
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
799 // Write out all objects that were added to the forward list and have 799 // Write out all objects that were added to the forward list and have
800 // not been serialized yet. These would typically be fields of arrays. 800 // not been serialized yet. These would typically be fields of arrays.
801 // NOTE: The forward list might grow as we process the list. 801 // NOTE: The forward list might grow as we process the list.
802 for (intptr_t i = 0; i < forward_id_; i++) { 802 for (intptr_t i = 0; i < forward_id_; i++) {
803 WriteForwardedCObject(forward_list_[i]); 803 WriteForwardedCObject(forward_list_[i]);
804 } 804 }
805 UnmarkAllCObjects(object); 805 UnmarkAllCObjects(object);
806 } 806 }
807 807
808 } // namespace dart 808 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698