OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
357 static HType TaggedNumber() { return HType(kTaggedNumber); } | 357 static HType TaggedNumber() { return HType(kTaggedNumber); } |
358 static HType Smi() { return HType(kSmi); } | 358 static HType Smi() { return HType(kSmi); } |
359 static HType HeapNumber() { return HType(kHeapNumber); } | 359 static HType HeapNumber() { return HType(kHeapNumber); } |
360 static HType String() { return HType(kString); } | 360 static HType String() { return HType(kString); } |
361 static HType Boolean() { return HType(kBoolean); } | 361 static HType Boolean() { return HType(kBoolean); } |
362 static HType NonPrimitive() { return HType(kNonPrimitive); } | 362 static HType NonPrimitive() { return HType(kNonPrimitive); } |
363 static HType JSArray() { return HType(kJSArray); } | 363 static HType JSArray() { return HType(kJSArray); } |
364 static HType JSObject() { return HType(kJSObject); } | 364 static HType JSObject() { return HType(kJSObject); } |
365 static HType Uninitialized() { return HType(kUninitialized); } | 365 static HType Uninitialized() { return HType(kUninitialized); } |
366 | 366 |
367 Handle< ::v8::internal::Type> intersect( | |
Jakob Kummerow
2013/07/18 11:56:15
Wouldn't it be easier to rename HType::Type to HTy
| |
368 Handle< ::v8::internal::Type> type, Isolate* isolate); | |
369 | |
367 // Return the weakest (least precise) common type. | 370 // Return the weakest (least precise) common type. |
368 HType Combine(HType other) { | 371 HType Combine(HType other) { |
369 return HType(static_cast<Type>(type_ & other.type_)); | 372 return HType(static_cast<Type>(type_ & other.type_)); |
370 } | 373 } |
371 | 374 |
372 bool Equals(const HType& other) const { | 375 bool Equals(const HType& other) const { |
373 return type_ == other.type_; | 376 return type_ == other.type_; |
374 } | 377 } |
375 | 378 |
376 bool IsSubtypeOf(const HType& other) { | 379 bool IsSubtypeOf(const HType& other) { |
(...skipping 23 matching lines...) Expand all Loading... | |
400 bool IsHeapNumber() const { | 403 bool IsHeapNumber() const { |
401 ASSERT(type_ != kUninitialized); | 404 ASSERT(type_ != kUninitialized); |
402 return ((type_ & kHeapNumber) == kHeapNumber); | 405 return ((type_ & kHeapNumber) == kHeapNumber); |
403 } | 406 } |
404 | 407 |
405 bool IsString() const { | 408 bool IsString() const { |
406 ASSERT(type_ != kUninitialized); | 409 ASSERT(type_ != kUninitialized); |
407 return ((type_ & kString) == kString); | 410 return ((type_ & kString) == kString); |
408 } | 411 } |
409 | 412 |
413 bool IsNoString() const { | |
414 if (IsTaggedPrimitive() || IsSmi() || IsHeapNumber() || | |
415 IsBoolean() || IsJSArray()) { | |
416 return true; | |
417 } | |
418 return false; | |
419 } | |
420 | |
410 bool IsBoolean() const { | 421 bool IsBoolean() const { |
411 ASSERT(type_ != kUninitialized); | 422 ASSERT(type_ != kUninitialized); |
412 return ((type_ & kBoolean) == kBoolean); | 423 return ((type_ & kBoolean) == kBoolean); |
413 } | 424 } |
414 | 425 |
415 bool IsNonPrimitive() const { | 426 bool IsNonPrimitive() const { |
416 ASSERT(type_ != kUninitialized); | 427 ASSERT(type_ != kUninitialized); |
417 return ((type_ & kNonPrimitive) == kNonPrimitive); | 428 return ((type_ & kNonPrimitive) == kNonPrimitive); |
418 } | 429 } |
419 | 430 |
(...skipping 6261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6681 virtual bool IsDeletable() const { return true; } | 6692 virtual bool IsDeletable() const { return true; } |
6682 }; | 6693 }; |
6683 | 6694 |
6684 | 6695 |
6685 #undef DECLARE_INSTRUCTION | 6696 #undef DECLARE_INSTRUCTION |
6686 #undef DECLARE_CONCRETE_INSTRUCTION | 6697 #undef DECLARE_CONCRETE_INSTRUCTION |
6687 | 6698 |
6688 } } // namespace v8::internal | 6699 } } // namespace v8::internal |
6689 | 6700 |
6690 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 6701 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |