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 2042 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2053 return ptr[index]; | 2053 return ptr[index]; |
2054 } | 2054 } |
2055 | 2055 |
2056 | 2056 |
2057 void ExternalFloatArray::set(int index, float value) { | 2057 void ExternalFloatArray::set(int index, float value) { |
2058 ASSERT((index >= 0) && (index < this->length())); | 2058 ASSERT((index >= 0) && (index < this->length())); |
2059 float* ptr = static_cast<float*>(external_pointer()); | 2059 float* ptr = static_cast<float*>(external_pointer()); |
2060 ptr[index] = value; | 2060 ptr[index] = value; |
2061 } | 2061 } |
2062 | 2062 |
2063 inline Scavenger Map::scavenger() { | |
2064 Scavenger callback = reinterpret_cast<Scavenger>( | |
2065 READ_INTPTR_FIELD(this, kIterateBodyCallbackOffset)); | |
2066 | |
2067 ASSERT(callback == Heap::GetScavenger(instance_type(), | |
2068 instance_size())); | |
2069 | |
2070 return callback; | |
2071 } | |
2072 | |
2073 inline void Map::set_scavenger(Scavenger callback) { | |
2074 ASSERT(!reinterpret_cast<Object*>( | |
2075 reinterpret_cast<intptr_t>(callback))->IsHeapObject()); | |
2076 WRITE_INTPTR_FIELD(this, | |
2077 kIterateBodyCallbackOffset, | |
2078 reinterpret_cast<intptr_t>(callback)); | |
2079 } | |
2080 | 2063 |
2081 int Map::instance_size() { | 2064 int Map::instance_size() { |
2082 return READ_BYTE_FIELD(this, kInstanceSizeOffset) << kPointerSizeLog2; | 2065 return READ_BYTE_FIELD(this, kInstanceSizeOffset) << kPointerSizeLog2; |
2083 } | 2066 } |
2084 | 2067 |
2085 | 2068 |
2086 int Map::inobject_properties() { | 2069 int Map::inobject_properties() { |
2087 return READ_BYTE_FIELD(this, kInObjectPropertiesOffset); | 2070 return READ_BYTE_FIELD(this, kInObjectPropertiesOffset); |
2088 } | 2071 } |
2089 | 2072 |
(...skipping 1229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3319 #undef WRITE_INT_FIELD | 3302 #undef WRITE_INT_FIELD |
3320 #undef READ_SHORT_FIELD | 3303 #undef READ_SHORT_FIELD |
3321 #undef WRITE_SHORT_FIELD | 3304 #undef WRITE_SHORT_FIELD |
3322 #undef READ_BYTE_FIELD | 3305 #undef READ_BYTE_FIELD |
3323 #undef WRITE_BYTE_FIELD | 3306 #undef WRITE_BYTE_FIELD |
3324 | 3307 |
3325 | 3308 |
3326 } } // namespace v8::internal | 3309 } } // namespace v8::internal |
3327 | 3310 |
3328 #endif // V8_OBJECTS_INL_H_ | 3311 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |