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 1136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1147 if (length < 0 || | 1147 if (length < 0 || |
1148 length > ExternalTypedData::MaxElements( | 1148 length > ExternalTypedData::MaxElements( |
1149 kExternalTypedDataUint8ArrayCid)) { | 1149 kExternalTypedDataUint8ArrayCid)) { |
1150 return false; | 1150 return false; |
1151 } | 1151 } |
1152 uint8_t* data = object->value.as_external_typed_data.data; | 1152 uint8_t* data = object->value.as_external_typed_data.data; |
1153 void* peer = object->value.as_external_typed_data.peer; | 1153 void* peer = object->value.as_external_typed_data.peer; |
1154 Dart_WeakPersistentHandleFinalizer callback = | 1154 Dart_WeakPersistentHandleFinalizer callback = |
1155 object->value.as_external_typed_data.callback; | 1155 object->value.as_external_typed_data.callback; |
1156 WriteSmi(length); | 1156 WriteSmi(length); |
1157 WriteIntptrValue(reinterpret_cast<intptr_t>(data)); | 1157 WriteRawPointerValue(reinterpret_cast<intptr_t>(data)); |
1158 WriteIntptrValue(reinterpret_cast<intptr_t>(peer)); | 1158 WriteRawPointerValue(reinterpret_cast<intptr_t>(peer)); |
1159 WriteIntptrValue(reinterpret_cast<intptr_t>(callback)); | 1159 WriteRawPointerValue(reinterpret_cast<intptr_t>(callback)); |
1160 break; | 1160 break; |
1161 } | 1161 } |
1162 default: | 1162 default: |
1163 UNREACHABLE(); | 1163 UNREACHABLE(); |
1164 } | 1164 } |
1165 | 1165 |
1166 return true; | 1166 return true; |
1167 } | 1167 } |
1168 | 1168 |
1169 | 1169 |
(...skipping 11 matching lines...) Expand all 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 |