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

Side by Side Diff: runtime/vm/raw_object.h

Issue 282883002: Add a new API function to extract all the native arguments into an array (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 7 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_test.cc ('k') | 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 #ifndef VM_RAW_OBJECT_H_ 5 #ifndef VM_RAW_OBJECT_H_
6 #define VM_RAW_OBJECT_H_ 6 #define VM_RAW_OBJECT_H_
7 7
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/globals.h" 9 #include "vm/globals.h"
10 #include "vm/token.h" 10 #include "vm/token.h"
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 } 252 }
253 253
254 static intptr_t decode(uword tag) { 254 static intptr_t decode(uword tag) {
255 return TagValueToSize(SizeBits::decode(tag)); 255 return TagValueToSize(SizeBits::decode(tag));
256 } 256 }
257 257
258 static uword update(intptr_t size, uword tag) { 258 static uword update(intptr_t size, uword tag) {
259 return SizeBits::update(SizeToTagValue(size), tag); 259 return SizeBits::update(SizeToTagValue(size), tag);
260 } 260 }
261 261
262 private: 262 private:
263 // The actual unscaled bit field used within the tag field. 263 // The actual unscaled bit field used within the tag field.
264 class SizeBits : public BitField<intptr_t, kSizeTagPos, kSizeTagSize> {}; 264 class SizeBits : public BitField<intptr_t, kSizeTagPos, kSizeTagSize> {};
265 265
266 static intptr_t SizeToTagValue(intptr_t size) { 266 static intptr_t SizeToTagValue(intptr_t size) {
267 ASSERT(Utils::IsAligned(size, kObjectAlignment)); 267 ASSERT(Utils::IsAligned(size, kObjectAlignment));
268 return (size > kMaxSizeTag) ? 0 : (size >> kObjectAlignmentLog2); 268 return (size > kMaxSizeTag) ? 0 : (size >> kObjectAlignmentLog2);
269 } 269 }
270 static intptr_t TagValueToSize(intptr_t value) { 270 static intptr_t TagValueToSize(intptr_t value) {
271 return value << kObjectAlignmentLog2; 271 return value << kObjectAlignmentLog2;
272 } 272 }
(...skipping 979 matching lines...) Expand 10 before | Expand all | Expand 10 after
1252 class RawSmi : public RawInteger { 1252 class RawSmi : public RawInteger {
1253 RAW_OBJECT_IMPLEMENTATION(Smi); 1253 RAW_OBJECT_IMPLEMENTATION(Smi);
1254 }; 1254 };
1255 1255
1256 1256
1257 class RawMint : public RawInteger { 1257 class RawMint : public RawInteger {
1258 RAW_HEAP_OBJECT_IMPLEMENTATION(Mint); 1258 RAW_HEAP_OBJECT_IMPLEMENTATION(Mint);
1259 1259
1260 int64_t value_; 1260 int64_t value_;
1261 1261
1262 friend class Api;
1262 friend class SnapshotReader; 1263 friend class SnapshotReader;
1263 }; 1264 };
1264 1265
1265 1266
1266 class RawBigint : public RawInteger { 1267 class RawBigint : public RawInteger {
1267 RAW_HEAP_OBJECT_IMPLEMENTATION(Bigint); 1268 RAW_HEAP_OBJECT_IMPLEMENTATION(Bigint);
1268 1269
1269 // Actual length in chunks at the time of allocation (later we may 1270 // Actual length in chunks at the time of allocation (later we may
1270 // clamp the operational length but we need to maintain a consistent 1271 // clamp the operational length but we need to maintain a consistent
1271 // object length so that the object can be traversed during GC). 1272 // object length so that the object can be traversed during GC).
(...skipping 10 matching lines...) Expand all
1282 1283
1283 friend class SnapshotReader; 1284 friend class SnapshotReader;
1284 }; 1285 };
1285 1286
1286 1287
1287 class RawDouble : public RawNumber { 1288 class RawDouble : public RawNumber {
1288 RAW_HEAP_OBJECT_IMPLEMENTATION(Double); 1289 RAW_HEAP_OBJECT_IMPLEMENTATION(Double);
1289 1290
1290 double value_; 1291 double value_;
1291 1292
1293 friend class Api;
1292 friend class SnapshotReader; 1294 friend class SnapshotReader;
1293 }; 1295 };
1294 1296
1295 1297
1296 class RawString : public RawInstance { 1298 class RawString : public RawInstance {
1297 RAW_HEAP_OBJECT_IMPLEMENTATION(String); 1299 RAW_HEAP_OBJECT_IMPLEMENTATION(String);
1298 1300
1299 protected: 1301 protected:
1300 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->length_); } 1302 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->length_); }
1301 RawSmi* length_; 1303 RawSmi* length_;
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after
1835 // Make sure this is updated when new TypedData types are added. 1837 // Make sure this is updated when new TypedData types are added.
1836 ASSERT(kTypedDataInt8ArrayViewCid == kTypedDataInt8ArrayCid + 14); 1838 ASSERT(kTypedDataInt8ArrayViewCid == kTypedDataInt8ArrayCid + 14);
1837 ASSERT(kExternalTypedDataInt8ArrayCid == kTypedDataInt8ArrayViewCid + 15); 1839 ASSERT(kExternalTypedDataInt8ArrayCid == kTypedDataInt8ArrayViewCid + 15);
1838 ASSERT(kNullCid == kExternalTypedDataInt8ArrayCid + 14); 1840 ASSERT(kNullCid == kExternalTypedDataInt8ArrayCid + 14);
1839 return (kNullCid - kTypedDataInt8ArrayCid); 1841 return (kNullCid - kTypedDataInt8ArrayCid);
1840 } 1842 }
1841 1843
1842 } // namespace dart 1844 } // namespace dart
1843 1845
1844 #endif // VM_RAW_OBJECT_H_ 1846 #endif // VM_RAW_OBJECT_H_
OLDNEW
« no previous file with comments | « runtime/vm/dart_api_impl_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698