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

Side by Side Diff: src/types-inl.h

Issue 877643002: Reland of "Steps towards unification of number bitset and range types." (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Avoid (some of the) uninhabited type normalization based on representation. Created 5 years, 11 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
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_TYPES_INL_H_ 5 #ifndef V8_TYPES_INL_H_
6 #define V8_TYPES_INL_H_ 6 #define V8_TYPES_INL_H_
7 7
8 #include "src/types.h" 8 #include "src/types.h"
9 9
10 #include "src/factory.h" 10 #include "src/factory.h"
11 #include "src/handles-inl.h" 11 #include "src/handles-inl.h"
12 12
13 namespace v8 { 13 namespace v8 {
14 namespace internal { 14 namespace internal {
15 15
16 // ----------------------------------------------------------------------------- 16 // -----------------------------------------------------------------------------
17 // TypeImpl 17 // TypeImpl
18 18
19 template <class Config>
20 typename TypeImpl<Config>::bitset TypeImpl<Config>::BitsetType::SignedSmall() {
21 return i::SmiValuesAre31Bits() ? kSigned31 : kSigned32;
22 }
23
24
25 template <class Config>
26 typename TypeImpl<Config>::bitset
27 TypeImpl<Config>::BitsetType::UnsignedSmall() {
28 return i::SmiValuesAre31Bits() ? kUnsigned30 : kUnsigned31;
29 }
30
31
19 template<class Config> 32 template<class Config>
20 TypeImpl<Config>* TypeImpl<Config>::cast(typename Config::Base* object) { 33 TypeImpl<Config>* TypeImpl<Config>::cast(typename Config::Base* object) {
21 TypeImpl* t = static_cast<TypeImpl*>(object); 34 TypeImpl* t = static_cast<TypeImpl*>(object);
22 DCHECK(t->IsBitset() || t->IsClass() || t->IsConstant() || t->IsRange() || 35 DCHECK(t->IsBitset() || t->IsClass() || t->IsConstant() || t->IsRange() ||
23 t->IsUnion() || t->IsArray() || t->IsFunction() || t->IsContext()); 36 t->IsUnion() || t->IsArray() || t->IsFunction() || t->IsContext());
24 return t; 37 return t;
25 } 38 }
26 39
27 40
28 // Most precise _current_ type of a value (usually its class). 41 // Most precise _current_ type of a value (usually its class).
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 // static 357 // static
345 template<class V> 358 template<class V>
346 void HeapTypeConfig::struct_set_value( 359 void HeapTypeConfig::struct_set_value(
347 i::Handle<Struct> structure, int i, i::Handle<V> x) { 360 i::Handle<Struct> structure, int i, i::Handle<V> x) {
348 structure->set(i + 1, *x); 361 structure->set(i + 1, *x);
349 } 362 }
350 363
351 } } // namespace v8::internal 364 } } // namespace v8::internal
352 365
353 #endif // V8_TYPES_INL_H_ 366 #endif // V8_TYPES_INL_H_
OLDNEW
« src/types.cc ('K') | « src/types.cc ('k') | test/cctest/compiler/test-js-typed-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698