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/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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 } | 84 } |
85 | 85 |
86 | 86 |
87 Dart_CObject* ApiMessageReader::AllocateDartCObjectInt64(int64_t val) { | 87 Dart_CObject* ApiMessageReader::AllocateDartCObjectInt64(int64_t val) { |
88 Dart_CObject* value = AllocateDartCObject(Dart_CObject_kInt64); | 88 Dart_CObject* value = AllocateDartCObject(Dart_CObject_kInt64); |
89 value->value.as_int64 = val; | 89 value->value.as_int64 = val; |
90 return value; | 90 return value; |
91 } | 91 } |
92 | 92 |
93 | 93 |
| 94 _Dart_CObject* ApiMessageReader::singleton_uint32_typed_data_ = NULL; |
| 95 |
94 Dart_CObject* ApiMessageReader::AllocateDartCObjectBigint() { | 96 Dart_CObject* ApiMessageReader::AllocateDartCObjectBigint() { |
95 Dart_CObject* value = AllocateDartCObject(Dart_CObject_kBigint); | 97 Dart_CObject* value = AllocateDartCObject(Dart_CObject_kBigint); |
96 value->value.as_bigint.neg = false; | 98 value->value.as_bigint.neg = false; |
97 value->value.as_bigint.used = 0; | 99 value->value.as_bigint.used = 0; |
98 value->value.as_bigint.digits = NULL; | 100 if (singleton_uint32_typed_data_ == NULL) { |
| 101 singleton_uint32_typed_data_ = |
| 102 AllocateDartCObjectTypedData(Dart_TypedData_kUint32, 0); |
| 103 } |
| 104 value->value.as_bigint.digits = singleton_uint32_typed_data_; |
99 value->type = Dart_CObject_kBigint; | 105 value->type = Dart_CObject_kBigint; |
100 return value; | 106 return value; |
101 } | 107 } |
102 | 108 |
103 | 109 |
104 Dart_CObject* ApiMessageReader::AllocateDartCObjectDouble(double val) { | 110 Dart_CObject* ApiMessageReader::AllocateDartCObjectDouble(double val) { |
105 Dart_CObject* value = AllocateDartCObject(Dart_CObject_kDouble); | 111 Dart_CObject* value = AllocateDartCObject(Dart_CObject_kDouble); |
106 value->value.as_double = val; | 112 value->value.as_double = val; |
107 return value; | 113 return value; |
108 } | 114 } |
(...skipping 1106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1215 if (!success) { | 1221 if (!success) { |
1216 UnmarkAllCObjects(object); | 1222 UnmarkAllCObjects(object); |
1217 return false; | 1223 return false; |
1218 } | 1224 } |
1219 } | 1225 } |
1220 UnmarkAllCObjects(object); | 1226 UnmarkAllCObjects(object); |
1221 return true; | 1227 return true; |
1222 } | 1228 } |
1223 | 1229 |
1224 } // namespace dart | 1230 } // namespace dart |
OLD | NEW |