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

Side by Side Diff: vm/dart_api_message.cc

Issue 10541055: Fix bug in native message writer, the GetMarkedCObjectMark method was shifting teh value incorrectl… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 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 | « no previous file | no next file » | 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/dart_api_message.h" 5 #include "vm/dart_api_message.h"
6 #include "vm/object.h" 6 #include "vm/object.h"
7 #include "vm/object_store.h" 7 #include "vm/object_store.h"
8 8
9 namespace dart { 9 namespace dart {
10 10
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 } 397 }
398 398
399 399
400 bool ApiMessageWriter::IsCObjectMarked(Dart_CObject* object) { 400 bool ApiMessageWriter::IsCObjectMarked(Dart_CObject* object) {
401 return (object->type & kDartCObjectMarkMask) != 0; 401 return (object->type & kDartCObjectMarkMask) != 0;
402 } 402 }
403 403
404 404
405 intptr_t ApiMessageWriter::GetMarkedCObjectMark(Dart_CObject* object) { 405 intptr_t ApiMessageWriter::GetMarkedCObjectMark(Dart_CObject* object) {
406 ASSERT(IsCObjectMarked(object)); 406 ASSERT(IsCObjectMarked(object));
407 intptr_t mark_value = ((object->type & kDartCObjectMarkMask) >> 3); 407 intptr_t mark_value =
408 ((object->type & kDartCObjectMarkMask) >> kDartCObjectTypeBits);
408 // An offset was added to object id for making marking object id 0 possible. 409 // An offset was added to object id for making marking object id 0 possible.
409 return mark_value - kDartCObjectMarkOffset; 410 return mark_value - kDartCObjectMarkOffset;
410 } 411 }
411 412
412 413
413 void ApiMessageWriter::UnmarkAllCObjects(Dart_CObject* object) { 414 void ApiMessageWriter::UnmarkAllCObjects(Dart_CObject* object) {
414 if (!IsCObjectMarked(object)) return; 415 if (!IsCObjectMarked(object)) return;
415 UnmarkCObject(object); 416 UnmarkCObject(object);
416 if (object->type == Dart_CObject::kArray) { 417 if (object->type == Dart_CObject::kArray) {
417 for (int i = 0; i < object->value.as_array.length; i++) { 418 for (int i = 0; i < object->value.as_array.length; i++) {
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
563 } 564 }
564 565
565 566
566 void ApiMessageWriter::WriteCMessage(Dart_CObject* object) { 567 void ApiMessageWriter::WriteCMessage(Dart_CObject* object) {
567 WriteCObject(object); 568 WriteCObject(object);
568 UnmarkAllCObjects(object); 569 UnmarkAllCObjects(object);
569 FinalizeBuffer(); 570 FinalizeBuffer();
570 } 571 }
571 572
572 } // namespace dart 573 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698