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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 return union_get(this->as_union(), 0)->GlbBitset(); | 233 return union_get(this->as_union(), 0)->GlbBitset(); |
234 } else { | 234 } else { |
235 return kNone; | 235 return kNone; |
236 } | 236 } |
237 } | 237 } |
238 | 238 |
239 | 239 |
240 // Check this <= that. | 240 // Check this <= that. |
241 bool Type::SlowIs(Type* that) { | 241 bool Type::SlowIs(Type* that) { |
242 // Fast path for bitsets. | 242 // Fast path for bitsets. |
243 if (this->is_none()) return true; | |
244 if (that->is_bitset()) { | 243 if (that->is_bitset()) { |
245 return (this->LubBitset() | that->as_bitset()) == that->as_bitset(); | 244 return (this->LubBitset() | that->as_bitset()) == that->as_bitset(); |
246 } | 245 } |
247 | 246 |
248 if (that->is_class()) { | 247 if (that->is_class()) { |
249 return this->is_class() && *this->as_class() == *that->as_class(); | 248 return this->is_class() && *this->as_class() == *that->as_class(); |
250 } | 249 } |
251 if (that->is_constant()) { | 250 if (that->is_constant()) { |
252 return this->is_constant() && *this->as_constant() == *that->as_constant(); | 251 return this->is_constant() && *this->as_constant() == *that->as_constant(); |
253 } | 252 } |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
520 for (unsigned i = 0; i < sizeof(val)*8; ++i) { | 519 for (unsigned i = 0; i < sizeof(val)*8; ++i) { |
521 int mask = (1 << i); | 520 int mask = (1 << i); |
522 if ((val & mask) != 0) { | 521 if ((val & mask) != 0) { |
523 if (!first_entry) PrintF(out, ","); | 522 if (!first_entry) PrintF(out, ","); |
524 first_entry = false; | 523 first_entry = false; |
525 PrintF(out, "%s", GetPrimitiveName(mask)); | 524 PrintF(out, "%s", GetPrimitiveName(mask)); |
526 } | 525 } |
527 } | 526 } |
528 PrintF(out, "}"); | 527 PrintF(out, "}"); |
529 } else if (is_constant()) { | 528 } else if (is_constant()) { |
530 PrintF(out, "Constant(%p : ", static_cast<void*>(*as_constant())); | 529 PrintF(out, "Constant(%p)", static_cast<void*>(*as_constant())); |
531 from_bitset(LubBitset())->TypePrint(out); | |
532 PrintF(")"); | |
533 } else if (is_class()) { | 530 } else if (is_class()) { |
534 PrintF(out, "Class(%p < ", static_cast<void*>(*as_class())); | 531 PrintF(out, "Class(%p)", static_cast<void*>(*as_class())); |
535 from_bitset(LubBitset())->TypePrint(out); | |
536 PrintF(")"); | |
537 } else if (is_union()) { | 532 } else if (is_union()) { |
538 PrintF(out, "{"); | 533 PrintF(out, "{"); |
539 Handle<Unioned> unioned = as_union(); | 534 Handle<Unioned> unioned = as_union(); |
540 for (int i = 0; i < unioned->length(); ++i) { | 535 for (int i = 0; i < unioned->length(); ++i) { |
541 Handle<Type> type_i = union_get(unioned, i); | 536 Handle<Type> type_i = union_get(unioned, i); |
542 if (i > 0) PrintF(out, ","); | 537 if (i > 0) PrintF(out, ","); |
543 type_i->TypePrint(out); | 538 type_i->TypePrint(out); |
544 } | 539 } |
545 PrintF(out, "}"); | 540 PrintF(out, "}"); |
546 } | 541 } |
547 } | 542 } |
548 #endif | 543 #endif |
549 | 544 |
550 | 545 |
551 } } // namespace v8::internal | 546 } } // namespace v8::internal |
OLD | NEW |