Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 123 Map* map = NULL; | 123 Map* map = NULL; |
| 124 if (this->is_class()) { | 124 if (this->is_class()) { |
| 125 map = *this->as_class(); | 125 map = *this->as_class(); |
| 126 } else { | 126 } else { |
| 127 Handle<v8::internal::Object> value = this->as_constant(); | 127 Handle<v8::internal::Object> value = this->as_constant(); |
| 128 if (value->IsSmi()) return kInteger31; | 128 if (value->IsSmi()) return kInteger31; |
| 129 map = HeapObject::cast(*value)->map(); | 129 map = HeapObject::cast(*value)->map(); |
| 130 if (map->instance_type() == ODDBALL_TYPE) { | 130 if (map->instance_type() == ODDBALL_TYPE) { |
| 131 if (value->IsUndefined()) return kUndefined; | 131 if (value->IsUndefined()) return kUndefined; |
| 132 if (value->IsNull()) return kNull; | 132 if (value->IsNull()) return kNull; |
| 133 if (value->IsTrue() || value->IsFalse()) return kBoolean; | 133 if (value->IsTrue() || value->IsFalse()) return kBoolean; |
|
rossberg
2013/06/25 10:47:38
You might want to add a case sending the hole to t
danno
2013/06/28 13:56:05
Done.
| |
| 134 } | 134 } |
| 135 } | 135 } |
| 136 switch (map->instance_type()) { | 136 switch (map->instance_type()) { |
| 137 case STRING_TYPE: | 137 case STRING_TYPE: |
| 138 case ASCII_STRING_TYPE: | 138 case ASCII_STRING_TYPE: |
| 139 case CONS_STRING_TYPE: | 139 case CONS_STRING_TYPE: |
| 140 case CONS_ASCII_STRING_TYPE: | 140 case CONS_ASCII_STRING_TYPE: |
| 141 case SLICED_STRING_TYPE: | 141 case SLICED_STRING_TYPE: |
| 142 case SLICED_ASCII_STRING_TYPE: | 142 case SLICED_ASCII_STRING_TYPE: |
| 143 case EXTERNAL_STRING_TYPE: | 143 case EXTERNAL_STRING_TYPE: |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 190 // When compiling stub templates, the meta map is used as a place holder | 190 // When compiling stub templates, the meta map is used as a place holder |
| 191 // for the actual map with which the template is later instantiated. | 191 // for the actual map with which the template is later instantiated. |
| 192 // We treat it as a kind of type variable whose upper bound is Any. | 192 // We treat it as a kind of type variable whose upper bound is Any. |
| 193 // TODO(rossberg): for caching of CompareNilIC stubs to work correctly, | 193 // TODO(rossberg): for caching of CompareNilIC stubs to work correctly, |
| 194 // we must exclude Undetectable here. This makes no sense, really, | 194 // we must exclude Undetectable here. This makes no sense, really, |
| 195 // because it means that the template isn't actually parametric. | 195 // because it means that the template isn't actually parametric. |
| 196 // Also, it doesn't apply elsewhere. 8-( | 196 // Also, it doesn't apply elsewhere. 8-( |
| 197 // We ought to find a cleaner solution for compiling stubs parameterised | 197 // We ought to find a cleaner solution for compiling stubs parameterised |
| 198 // over type or class variables, esp ones with bounds... | 198 // over type or class variables, esp ones with bounds... |
| 199 return kDetectable; | 199 return kDetectable; |
| 200 case DECLARED_ACCESSOR_INFO_TYPE: | |
| 201 case EXECUTABLE_ACCESSOR_INFO_TYPE: | |
| 202 case ACCESSOR_PAIR_TYPE: | |
| 203 case JS_SET_TYPE: | |
| 204 case JS_MAP_TYPE: | |
| 205 return kInternal; | |
| 200 default: | 206 default: |
| 201 UNREACHABLE(); | 207 UNREACHABLE(); |
| 202 return kNone; | 208 return kNone; |
| 203 } | 209 } |
| 204 } | 210 } |
| 205 } | 211 } |
| 206 | 212 |
| 207 | 213 |
| 208 // Get the largest bitset subsumed by this type. | 214 // Get the largest bitset subsumed by this type. |
| 209 int Type::GlbBitset() { | 215 int Type::GlbBitset() { |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 462 } | 468 } |
| 463 | 469 |
| 464 | 470 |
| 465 Type* Type::Optional(Handle<Type> type) { | 471 Type* Type::Optional(Handle<Type> type) { |
| 466 return type->is_bitset() | 472 return type->is_bitset() |
| 467 ? from_bitset(type->as_bitset() | kUndefined) | 473 ? from_bitset(type->as_bitset() | kUndefined) |
| 468 : Union(type, Undefined()->handle_via_isolate_of(*type)); | 474 : Union(type, Undefined()->handle_via_isolate_of(*type)); |
| 469 } | 475 } |
| 470 | 476 |
| 471 } } // namespace v8::internal | 477 } } // namespace v8::internal |
| OLD | NEW |