| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 bool MaybeObject::IsException() { | 416 bool MaybeObject::IsException() { |
| 417 return this == Failure::Exception(); | 417 return this == Failure::Exception(); |
| 418 } | 418 } |
| 419 | 419 |
| 420 | 420 |
| 421 bool MaybeObject::IsTheHole() { | 421 bool MaybeObject::IsTheHole() { |
| 422 return this == Heap::the_hole_value(); | 422 return this == Heap::the_hole_value(); |
| 423 } | 423 } |
| 424 | 424 |
| 425 | 425 |
| 426 bool MaybeObject::IsArgumentsMarker() { | |
| 427 return this == Heap::arguments_marker(); | |
| 428 } | |
| 429 | |
| 430 | |
| 431 Failure* Failure::cast(MaybeObject* obj) { | 426 Failure* Failure::cast(MaybeObject* obj) { |
| 432 ASSERT(HAS_FAILURE_TAG(obj)); | 427 ASSERT(HAS_FAILURE_TAG(obj)); |
| 433 return reinterpret_cast<Failure*>(obj); | 428 return reinterpret_cast<Failure*>(obj); |
| 434 } | 429 } |
| 435 | 430 |
| 436 | 431 |
| 437 bool Object::IsJSObject() { | 432 bool Object::IsJSObject() { |
| 438 return IsHeapObject() | 433 return IsHeapObject() |
| 439 && HeapObject::cast(this)->map()->instance_type() >= FIRST_JS_OBJECT_TYPE; | 434 && HeapObject::cast(this)->map()->instance_type() >= FIRST_JS_OBJECT_TYPE; |
| 440 } | 435 } |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 728 bool Object::IsTrue() { | 723 bool Object::IsTrue() { |
| 729 return this == Heap::true_value(); | 724 return this == Heap::true_value(); |
| 730 } | 725 } |
| 731 | 726 |
| 732 | 727 |
| 733 bool Object::IsFalse() { | 728 bool Object::IsFalse() { |
| 734 return this == Heap::false_value(); | 729 return this == Heap::false_value(); |
| 735 } | 730 } |
| 736 | 731 |
| 737 | 732 |
| 733 bool Object::IsArgumentsMarker() { |
| 734 return this == Heap::arguments_marker(); |
| 735 } |
| 736 |
| 737 |
| 738 double Object::Number() { | 738 double Object::Number() { |
| 739 ASSERT(IsNumber()); | 739 ASSERT(IsNumber()); |
| 740 return IsSmi() | 740 return IsSmi() |
| 741 ? static_cast<double>(reinterpret_cast<Smi*>(this)->value()) | 741 ? static_cast<double>(reinterpret_cast<Smi*>(this)->value()) |
| 742 : reinterpret_cast<HeapNumber*>(this)->value(); | 742 : reinterpret_cast<HeapNumber*>(this)->value(); |
| 743 } | 743 } |
| 744 | 744 |
| 745 | 745 |
| 746 | 746 |
| 747 MaybeObject* Object::ToSmi() { | 747 MaybeObject* Object::ToSmi() { |
| (...skipping 3102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3850 #undef WRITE_INT_FIELD | 3850 #undef WRITE_INT_FIELD |
| 3851 #undef READ_SHORT_FIELD | 3851 #undef READ_SHORT_FIELD |
| 3852 #undef WRITE_SHORT_FIELD | 3852 #undef WRITE_SHORT_FIELD |
| 3853 #undef READ_BYTE_FIELD | 3853 #undef READ_BYTE_FIELD |
| 3854 #undef WRITE_BYTE_FIELD | 3854 #undef WRITE_BYTE_FIELD |
| 3855 | 3855 |
| 3856 | 3856 |
| 3857 } } // namespace v8::internal | 3857 } } // namespace v8::internal |
| 3858 | 3858 |
| 3859 #endif // V8_OBJECTS_INL_H_ | 3859 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |