| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 #include "objects-visiting.h" | 52 #include "objects-visiting.h" |
| 53 | 53 |
| 54 namespace v8 { | 54 namespace v8 { |
| 55 namespace internal { | 55 namespace internal { |
| 56 | 56 |
| 57 PropertyDetails::PropertyDetails(Smi* smi) { | 57 PropertyDetails::PropertyDetails(Smi* smi) { |
| 58 value_ = smi->value(); | 58 value_ = smi->value(); |
| 59 } | 59 } |
| 60 | 60 |
| 61 | 61 |
| 62 Smi* PropertyDetails::AsSmi() { | 62 Smi* PropertyDetails::AsSmi() const { |
| 63 // Ensure the upper 2 bits have the same value by sign extending it. This is | 63 // Ensure the upper 2 bits have the same value by sign extending it. This is |
| 64 // necessary to be able to use the 31st bit of the property details. | 64 // necessary to be able to use the 31st bit of the property details. |
| 65 int value = value_ << 1; | 65 int value = value_ << 1; |
| 66 return Smi::FromInt(value >> 1); | 66 return Smi::FromInt(value >> 1); |
| 67 } | 67 } |
| 68 | 68 |
| 69 | 69 |
| 70 PropertyDetails PropertyDetails::AsDeleted() { | 70 PropertyDetails PropertyDetails::AsDeleted() const { |
| 71 Smi* smi = Smi::FromInt(value_ | DeletedField::encode(1)); | 71 Smi* smi = Smi::FromInt(value_ | DeletedField::encode(1)); |
| 72 return PropertyDetails(smi); | 72 return PropertyDetails(smi); |
| 73 } | 73 } |
| 74 | 74 |
| 75 | 75 |
| 76 #define TYPE_CHECKER(type, instancetype) \ | 76 #define TYPE_CHECKER(type, instancetype) \ |
| 77 bool Object::Is##type() { \ | 77 bool Object::Is##type() { \ |
| 78 return Object::IsHeapObject() && \ | 78 return Object::IsHeapObject() && \ |
| 79 HeapObject::cast(this)->map()->instance_type() == instancetype; \ | 79 HeapObject::cast(this)->map()->instance_type() == instancetype; \ |
| 80 } | 80 } |
| (...skipping 6658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6739 #undef READ_UINT32_FIELD | 6739 #undef READ_UINT32_FIELD |
| 6740 #undef WRITE_UINT32_FIELD | 6740 #undef WRITE_UINT32_FIELD |
| 6741 #undef READ_SHORT_FIELD | 6741 #undef READ_SHORT_FIELD |
| 6742 #undef WRITE_SHORT_FIELD | 6742 #undef WRITE_SHORT_FIELD |
| 6743 #undef READ_BYTE_FIELD | 6743 #undef READ_BYTE_FIELD |
| 6744 #undef WRITE_BYTE_FIELD | 6744 #undef WRITE_BYTE_FIELD |
| 6745 | 6745 |
| 6746 } } // namespace v8::internal | 6746 } } // namespace v8::internal |
| 6747 | 6747 |
| 6748 #endif // V8_OBJECTS_INL_H_ | 6748 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |