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

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

Issue 2074533002: Simplify and improve optimization of is-tests in the precompiler. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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/flow_graph_range_analysis.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/atomic.h" 9 #include "vm/atomic.h"
10 #include "vm/globals.h" 10 #include "vm/globals.h"
(...skipping 2263 matching lines...) Expand 10 before | Expand all | Expand 10 after
2274 return (index == kOneByteStringCid || index == kExternalOneByteStringCid); 2274 return (index == kOneByteStringCid || index == kExternalOneByteStringCid);
2275 } 2275 }
2276 2276
2277 2277
2278 inline bool RawObject::IsTwoByteStringClassId(intptr_t index) { 2278 inline bool RawObject::IsTwoByteStringClassId(intptr_t index) {
2279 // Make sure this function is updated when new StringCid types are added. 2279 // Make sure this function is updated when new StringCid types are added.
2280 COMPILE_ASSERT(kOneByteStringCid == kStringCid + 1 && 2280 COMPILE_ASSERT(kOneByteStringCid == kStringCid + 1 &&
2281 kTwoByteStringCid == kStringCid + 2 && 2281 kTwoByteStringCid == kStringCid + 2 &&
2282 kExternalOneByteStringCid == kStringCid + 3 && 2282 kExternalOneByteStringCid == kStringCid + 3 &&
2283 kExternalTwoByteStringCid == kStringCid + 4); 2283 kExternalTwoByteStringCid == kStringCid + 4);
2284 return (index == kOneByteStringCid || 2284 return (index == kTwoByteStringCid || index == kExternalTwoByteStringCid);
Vyacheslav Egorov (Google) 2016/06/16 08:37:37 I wonder how this worked
2285 index == kTwoByteStringCid ||
2286 index == kExternalOneByteStringCid ||
2287 index == kExternalTwoByteStringCid);
2288 } 2285 }
2289 2286
2290 2287
2291 inline bool RawObject::IsExternalStringClassId(intptr_t index) { 2288 inline bool RawObject::IsExternalStringClassId(intptr_t index) {
2292 // Make sure this function is updated when new StringCid types are added. 2289 // Make sure this function is updated when new StringCid types are added.
2293 COMPILE_ASSERT(kOneByteStringCid == kStringCid + 1 && 2290 COMPILE_ASSERT(kOneByteStringCid == kStringCid + 1 &&
2294 kTwoByteStringCid == kStringCid + 2 && 2291 kTwoByteStringCid == kStringCid + 2 &&
2295 kExternalOneByteStringCid == kStringCid + 3 && 2292 kExternalOneByteStringCid == kStringCid + 3 &&
2296 kExternalTwoByteStringCid == kStringCid + 4); 2293 kExternalTwoByteStringCid == kStringCid + 4);
2297 return (index == kExternalOneByteStringCid || 2294 return (index == kExternalOneByteStringCid ||
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
2432 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == 2429 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid ==
2433 kTypedDataInt8ArrayViewCid + 15); 2430 kTypedDataInt8ArrayViewCid + 15);
2434 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); 2431 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14);
2435 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); 2432 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1);
2436 return (kNullCid - kTypedDataInt8ArrayCid); 2433 return (kNullCid - kTypedDataInt8ArrayCid);
2437 } 2434 }
2438 2435
2439 } // namespace dart 2436 } // namespace dart
2440 2437
2441 #endif // VM_RAW_OBJECT_H_ 2438 #endif // VM_RAW_OBJECT_H_
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_range_analysis.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698