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

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

Issue 16378004: Revert change 23636 as it is causing issues on dartium. Will resubmit after investigating the darti… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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/debuginfo.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/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 #include "vm/unicode.h" 9 #include "vm/unicode.h"
10 10
(...skipping 788 matching lines...) Expand 10 before | Expand all | Expand 10 after
799 if (object->type == Dart_CObject_kArray) { 799 if (object->type == Dart_CObject_kArray) {
800 for (int i = 0; i < object->value.as_array.length; i++) { 800 for (int i = 0; i < object->value.as_array.length; i++) {
801 Dart_CObject* element = object->value.as_array.values[i]; 801 Dart_CObject* element = object->value.as_array.values[i];
802 UnmarkAllCObjects(element); 802 UnmarkAllCObjects(element);
803 } 803 }
804 } 804 }
805 } 805 }
806 806
807 807
808 void ApiMessageWriter::AddToForwardList(Dart_CObject* object) { 808 void ApiMessageWriter::AddToForwardList(Dart_CObject* object) {
809 ASSERT(forward_id_ <= forward_list_length_); 809 if (forward_id_ >= forward_list_length_) {
810 if (forward_id_ == forward_list_length_) { 810 void* new_list = NULL;
811 intptr_t new_size;
812 intptr_t old_size;
813 if (forward_list_length_ == 0) { 811 if (forward_list_length_ == 0) {
814 old_size = 0;
815 forward_list_length_ = 4; 812 forward_list_length_ = 4;
816 new_size = forward_list_length_ * sizeof(object); 813 intptr_t new_size = forward_list_length_ * sizeof(object);
814 new_list = ::malloc(new_size);
817 } else { 815 } else {
818 old_size = forward_list_length_ * sizeof(object);
819 new_size = old_size + old_size;
820 forward_list_length_ *= 2; 816 forward_list_length_ *= 2;
817 intptr_t new_size = (forward_list_length_ * sizeof(object));
818 new_list = ::realloc(forward_list_, new_size);
821 } 819 }
822 Dart_CObject** new_list = Utils::Realloc(forward_list_, old_size, new_size);
823 ASSERT(new_list != NULL); 820 ASSERT(new_list != NULL);
824 forward_list_ = new_list; 821 forward_list_ = reinterpret_cast<Dart_CObject**>(new_list);
825 } 822 }
826 forward_list_[forward_id_] = object; 823 forward_list_[forward_id_] = object;
827 forward_id_ += 1; 824 forward_id_ += 1;
828 } 825 }
829 826
830 827
831 void ApiMessageWriter::WriteSmi(int64_t value) { 828 void ApiMessageWriter::WriteSmi(int64_t value) {
832 ASSERT(Smi::IsValid64(value)); 829 ASSERT(Smi::IsValid64(value));
833 Write<RawObject*>(Smi::New(value)); 830 Write<RawObject*>(Smi::New(value));
834 } 831 }
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
1117 if (!success) { 1114 if (!success) {
1118 UnmarkAllCObjects(object); 1115 UnmarkAllCObjects(object);
1119 return false; 1116 return false;
1120 } 1117 }
1121 } 1118 }
1122 UnmarkAllCObjects(object); 1119 UnmarkAllCObjects(object);
1123 return true; 1120 return true;
1124 } 1121 }
1125 1122
1126 } // namespace dart 1123 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/dart_api_impl.cc ('k') | runtime/vm/debuginfo.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698