| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 692 #define WRITE_BYTE_FIELD(p, offset, value) \ | 692 #define WRITE_BYTE_FIELD(p, offset, value) \ |
| 693 (*reinterpret_cast<byte*>(FIELD_ADDR(p, offset)) = value) | 693 (*reinterpret_cast<byte*>(FIELD_ADDR(p, offset)) = value) |
| 694 | 694 |
| 695 | 695 |
| 696 Object** HeapObject::RawField(HeapObject* obj, int byte_offset) { | 696 Object** HeapObject::RawField(HeapObject* obj, int byte_offset) { |
| 697 return &READ_FIELD(obj, byte_offset); | 697 return &READ_FIELD(obj, byte_offset); |
| 698 } | 698 } |
| 699 | 699 |
| 700 | 700 |
| 701 int Smi::value() { | 701 int Smi::value() { |
| 702 return static_cast<int>(reinterpret_cast<intptr_t>(this) >> kSmiTagSize); | 702 return static_cast<int>(reinterpret_cast<intptr_t>(this)) >> kSmiTagSize; |
| 703 } | 703 } |
| 704 | 704 |
| 705 | 705 |
| 706 Smi* Smi::FromInt(int value) { | 706 Smi* Smi::FromInt(int value) { |
| 707 ASSERT(Smi::IsValid(value)); | 707 ASSERT(Smi::IsValid(value)); |
| 708 intptr_t tagged_value = | 708 intptr_t tagged_value = |
| 709 (static_cast<intptr_t>(value) << kSmiTagSize) | kSmiTag; | 709 (static_cast<intptr_t>(value) << kSmiTagSize) | kSmiTag; |
| 710 return reinterpret_cast<Smi*>(tagged_value); | 710 return reinterpret_cast<Smi*>(tagged_value); |
| 711 } | 711 } |
| 712 | 712 |
| (...skipping 1983 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2696 #undef WRITE_INT_FIELD | 2696 #undef WRITE_INT_FIELD |
| 2697 #undef READ_SHORT_FIELD | 2697 #undef READ_SHORT_FIELD |
| 2698 #undef WRITE_SHORT_FIELD | 2698 #undef WRITE_SHORT_FIELD |
| 2699 #undef READ_BYTE_FIELD | 2699 #undef READ_BYTE_FIELD |
| 2700 #undef WRITE_BYTE_FIELD | 2700 #undef WRITE_BYTE_FIELD |
| 2701 | 2701 |
| 2702 | 2702 |
| 2703 } } // namespace v8::internal | 2703 } } // namespace v8::internal |
| 2704 | 2704 |
| 2705 #endif // V8_OBJECTS_INL_H_ | 2705 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |