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

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

Issue 1182673002: Add an assertion to ensure that the return type and types of parameters are canonical or a TypeParam (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: address code review comments Created 5 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
« no previous file with comments | « runtime/vm/dart_api_impl.cc ('k') | runtime/vm/snapshot_test.cc » ('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 #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/atomic.h" 9 #include "vm/atomic.h"
10 #include "vm/globals.h" 10 #include "vm/globals.h"
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 385
386 bool IsDartInstance() { 386 bool IsDartInstance() {
387 return (!IsHeapObject() || (GetClassId() >= kInstanceCid)); 387 return (!IsHeapObject() || (GetClassId() >= kInstanceCid));
388 } 388 }
389 bool IsFreeListElement() { 389 bool IsFreeListElement() {
390 return ((GetClassId() == kFreeListElement)); 390 return ((GetClassId() == kFreeListElement));
391 } 391 }
392 bool IsScript() { 392 bool IsScript() {
393 return ((GetClassId() == kScriptCid)); 393 return ((GetClassId() == kScriptCid));
394 } 394 }
395 bool IsFunction() {
396 return ((GetClassId() == kFunctionCid));
397 }
395 398
396 intptr_t Size() const { 399 intptr_t Size() const {
397 uword tags = ptr()->tags_; 400 uword tags = ptr()->tags_;
398 intptr_t result = SizeTag::decode(tags); 401 intptr_t result = SizeTag::decode(tags);
399 if (result != 0) { 402 if (result != 0) {
400 ASSERT(result == SizeFromClass()); 403 ASSERT(result == SizeFromClass());
401 return result; 404 return result;
402 } 405 }
403 result = SizeFromClass(); 406 result = SizeFromClass();
404 ASSERT(result > SizeTag::kMaxSizeTag); 407 ASSERT(result > SizeTag::kMaxSizeTag);
(...skipping 1733 matching lines...) Expand 10 before | Expand all | Expand 10 after
2138 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == 2141 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid ==
2139 kTypedDataInt8ArrayViewCid + 15); 2142 kTypedDataInt8ArrayViewCid + 15);
2140 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); 2143 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14);
2141 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); 2144 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1);
2142 return (kNullCid - kTypedDataInt8ArrayCid); 2145 return (kNullCid - kTypedDataInt8ArrayCid);
2143 } 2146 }
2144 2147
2145 } // namespace dart 2148 } // namespace dart
2146 2149
2147 #endif // VM_RAW_OBJECT_H_ 2150 #endif // VM_RAW_OBJECT_H_
OLDNEW
« no previous file with comments | « runtime/vm/dart_api_impl.cc ('k') | runtime/vm/snapshot_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698