Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 #include <iomanip> | 5 #include <iomanip> |
| 6 | 6 |
| 7 #include "src/types.h" | 7 #include "src/types.h" |
| 8 | 8 |
| 9 #include "src/ostreams.h" | 9 #include "src/ostreams.h" |
| 10 #include "src/types-inl.h" | 10 #include "src/types-inl.h" |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 171 return bitset; | 171 return bitset; |
| 172 } | 172 } |
| 173 if (type->IsClass()) { | 173 if (type->IsClass()) { |
| 174 // Little hack to avoid the need for a region for handlification here... | 174 // Little hack to avoid the need for a region for handlification here... |
| 175 return Config::is_class(type) ? Lub(*Config::as_class(type)) : | 175 return Config::is_class(type) ? Lub(*Config::as_class(type)) : |
| 176 type->AsClass()->Bound(NULL)->AsBitset(); | 176 type->AsClass()->Bound(NULL)->AsBitset(); |
| 177 } | 177 } |
| 178 if (type->IsConstant()) return type->AsConstant()->Bound()->AsBitset(); | 178 if (type->IsConstant()) return type->AsConstant()->Bound()->AsBitset(); |
| 179 if (type->IsRange()) return type->AsRange()->Bound(); | 179 if (type->IsRange()) return type->AsRange()->Bound(); |
| 180 if (type->IsContext()) return kInternal & kTaggedPointer; | 180 if (type->IsContext()) return kInternal & kTaggedPointer; |
| 181 if (type->IsArray()) return kArray; | 181 if (type->IsArray()) return kOtherObject; |
| 182 if (type->IsFunction()) return kOtherObject; // TODO(rossberg): kFunction | 182 if (type->IsFunction()) return kOtherObject; // TODO(rossberg): kFunction |
| 183 UNREACHABLE(); | 183 UNREACHABLE(); |
| 184 return kNone; | 184 return kNone; |
| 185 } | 185 } |
| 186 | 186 |
| 187 | 187 |
| 188 template<class Config> | 188 template<class Config> |
| 189 typename TypeImpl<Config>::bitset | 189 typename TypeImpl<Config>::bitset |
| 190 TypeImpl<Config>::BitsetType::Lub(i::Map* map) { | 190 TypeImpl<Config>::BitsetType::Lub(i::Map* map) { |
| 191 DisallowHeapAllocation no_allocation; | 191 DisallowHeapAllocation no_allocation; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 227 return kInternal & kTaggedPointer; | 227 return kInternal & kTaggedPointer; |
| 228 } | 228 } |
| 229 case HEAP_NUMBER_TYPE: | 229 case HEAP_NUMBER_TYPE: |
| 230 return kNumber & kTaggedPointer; | 230 return kNumber & kTaggedPointer; |
| 231 case JS_VALUE_TYPE: | 231 case JS_VALUE_TYPE: |
| 232 case JS_DATE_TYPE: | 232 case JS_DATE_TYPE: |
| 233 case JS_OBJECT_TYPE: | 233 case JS_OBJECT_TYPE: |
| 234 case JS_CONTEXT_EXTENSION_OBJECT_TYPE: | 234 case JS_CONTEXT_EXTENSION_OBJECT_TYPE: |
| 235 case JS_GENERATOR_OBJECT_TYPE: | 235 case JS_GENERATOR_OBJECT_TYPE: |
| 236 case JS_MODULE_TYPE: | 236 case JS_MODULE_TYPE: |
| 237 case JS_GLOBAL_OBJECT_TYPE: | |
| 238 case JS_BUILTINS_OBJECT_TYPE: | 237 case JS_BUILTINS_OBJECT_TYPE: |
| 239 case JS_GLOBAL_PROXY_TYPE: | 238 case JS_GLOBAL_PROXY_TYPE: |
| 240 case JS_ARRAY_BUFFER_TYPE: | 239 case JS_ARRAY_BUFFER_TYPE: |
| 241 case JS_TYPED_ARRAY_TYPE: | 240 case JS_TYPED_ARRAY_TYPE: |
| 242 case JS_DATA_VIEW_TYPE: | 241 case JS_DATA_VIEW_TYPE: |
| 243 case JS_SET_TYPE: | 242 case JS_SET_TYPE: |
| 244 case JS_MAP_TYPE: | 243 case JS_MAP_TYPE: |
| 245 case JS_SET_ITERATOR_TYPE: | 244 case JS_SET_ITERATOR_TYPE: |
| 246 case JS_MAP_ITERATOR_TYPE: | 245 case JS_MAP_ITERATOR_TYPE: |
| 247 case JS_WEAK_MAP_TYPE: | 246 case JS_WEAK_MAP_TYPE: |
| 248 case JS_WEAK_SET_TYPE: | 247 case JS_WEAK_SET_TYPE: |
| 249 if (map->is_undetectable()) return kUndetectable; | 248 if (map->is_undetectable()) return kUndetectable; |
| 250 return kOtherObject; | 249 return kOtherObject; |
| 250 case JS_GLOBAL_OBJECT_TYPE: | |
| 251 return kGlobalObject; | |
| 251 case JS_ARRAY_TYPE: | 252 case JS_ARRAY_TYPE: |
|
rossberg
2015/04/10 11:41:55
Nit: just include this case up with the others.
titzer
2015/04/10 12:35:59
Done.
| |
| 252 return kArray; | 253 return kOtherObject; |
| 253 case JS_FUNCTION_TYPE: | 254 case JS_FUNCTION_TYPE: |
| 254 return kOtherObject; // TODO(rossberg): there should be a Function type. | 255 return kOtherObject; // TODO(rossberg): there should be a Function type. |
| 255 case JS_REGEXP_TYPE: | 256 case JS_REGEXP_TYPE: |
| 256 return kOtherObject; // TODO(rossberg): there should be a RegExp type. | 257 return kOtherObject; // TODO(rossberg): there should be a RegExp type. |
| 257 case JS_PROXY_TYPE: | 258 case JS_PROXY_TYPE: |
| 258 case JS_FUNCTION_PROXY_TYPE: | 259 case JS_FUNCTION_PROXY_TYPE: |
| 259 return kProxy; | 260 return kProxy; |
| 260 case MAP_TYPE: | 261 case MAP_TYPE: |
| 261 // When compiling stub templates, the meta map is used as a place holder | 262 // When compiling stub templates, the meta map is used as a place holder |
| 262 // for the actual map with which the template is later instantiated. | 263 // for the actual map with which the template is later instantiated. |
| (...skipping 1097 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1360 template class TypeImpl<HeapTypeConfig>::Iterator<i::Object>; | 1361 template class TypeImpl<HeapTypeConfig>::Iterator<i::Object>; |
| 1361 | 1362 |
| 1362 template TypeImpl<ZoneTypeConfig>::TypeHandle | 1363 template TypeImpl<ZoneTypeConfig>::TypeHandle |
| 1363 TypeImpl<ZoneTypeConfig>::Convert<HeapType>( | 1364 TypeImpl<ZoneTypeConfig>::Convert<HeapType>( |
| 1364 TypeImpl<HeapTypeConfig>::TypeHandle, TypeImpl<ZoneTypeConfig>::Region*); | 1365 TypeImpl<HeapTypeConfig>::TypeHandle, TypeImpl<ZoneTypeConfig>::Region*); |
| 1365 template TypeImpl<HeapTypeConfig>::TypeHandle | 1366 template TypeImpl<HeapTypeConfig>::TypeHandle |
| 1366 TypeImpl<HeapTypeConfig>::Convert<Type>( | 1367 TypeImpl<HeapTypeConfig>::Convert<Type>( |
| 1367 TypeImpl<ZoneTypeConfig>::TypeHandle, TypeImpl<HeapTypeConfig>::Region*); | 1368 TypeImpl<ZoneTypeConfig>::TypeHandle, TypeImpl<HeapTypeConfig>::Region*); |
| 1368 | 1369 |
| 1369 } } // namespace v8::internal | 1370 } } // namespace v8::internal |
| OLD | NEW |