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

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

Issue 12744006: Added check that the object being stored as a return value in the NativeArguments array is a Dart i… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 9 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
« runtime/vm/dart_api_impl.cc ('K') | « runtime/vm/native_entry.h ('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 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 ptr()->tags_ = CanonicalObjectTag::update(true, tags); 334 ptr()->tags_ = CanonicalObjectTag::update(true, tags);
335 } 335 }
336 bool IsCreatedFromSnapshot() const { 336 bool IsCreatedFromSnapshot() const {
337 return CreatedFromSnapshotTag::decode(ptr()->tags_); 337 return CreatedFromSnapshotTag::decode(ptr()->tags_);
338 } 338 }
339 void SetCreatedFromSnapshot() { 339 void SetCreatedFromSnapshot() {
340 uword tags = ptr()->tags_; 340 uword tags = ptr()->tags_;
341 ptr()->tags_ = CreatedFromSnapshotTag::update(true, tags); 341 ptr()->tags_ = CreatedFromSnapshotTag::update(true, tags);
342 } 342 }
343 343
344 bool IsDartInstance() {
345 return (!IsHeapObject() || (GetClassId() >= kInstanceCid));
346 }
347
344 intptr_t Size() const { 348 intptr_t Size() const {
345 uword tags = ptr()->tags_; 349 uword tags = ptr()->tags_;
346 intptr_t result = SizeTag::decode(tags); 350 intptr_t result = SizeTag::decode(tags);
347 if (result != 0) { 351 if (result != 0) {
348 ASSERT(result == SizeFromClass()); 352 ASSERT(result == SizeFromClass());
349 return result; 353 return result;
350 } 354 }
351 result = SizeFromClass(); 355 result = SizeFromClass();
352 ASSERT(result > SizeTag::kMaxSizeTag); 356 ASSERT(result > SizeTag::kMaxSizeTag);
353 return result; 357 return result;
(...skipping 1521 matching lines...) Expand 10 before | Expand all | Expand 10 after
1875 inline intptr_t RawObject::NumberOfTypedDataClasses() { 1879 inline intptr_t RawObject::NumberOfTypedDataClasses() {
1876 // Make sure this is updated when new TypedData types are added. 1880 // Make sure this is updated when new TypedData types are added.
1877 ASSERT(kExternalTypedDataInt8ArrayCid == kTypedDataInt8ArrayCid + 11); 1881 ASSERT(kExternalTypedDataInt8ArrayCid == kTypedDataInt8ArrayCid + 11);
1878 ASSERT(kNullCid == kExternalTypedDataInt8ArrayCid + 11); 1882 ASSERT(kNullCid == kExternalTypedDataInt8ArrayCid + 11);
1879 return (kNullCid - kTypedDataInt8ArrayCid); 1883 return (kNullCid - kTypedDataInt8ArrayCid);
1880 } 1884 }
1881 1885
1882 } // namespace dart 1886 } // namespace dart
1883 1887
1884 #endif // VM_RAW_OBJECT_H_ 1888 #endif // VM_RAW_OBJECT_H_
OLDNEW
« runtime/vm/dart_api_impl.cc ('K') | « runtime/vm/native_entry.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698