| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 // | 4 // |
| 5 // Review notes: | 5 // Review notes: |
| 6 // | 6 // |
| 7 // - The use of macros in these inline functions may seem superfluous | 7 // - The use of macros in these inline functions may seem superfluous |
| 8 // but it is absolutely needed to make sure gcc generates optimal | 8 // but it is absolutely needed to make sure gcc generates optimal |
| 9 // code. gcc is not happy when attempting to inline too deep. | 9 // code. gcc is not happy when attempting to inline too deep. |
| 10 // | 10 // |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 return BooleanBit::get(field(), offset); \ | 136 return BooleanBit::get(field(), offset); \ |
| 137 } \ | 137 } \ |
| 138 void holder::set_##name(bool value) { \ | 138 void holder::set_##name(bool value) { \ |
| 139 set_##field(BooleanBit::set(field(), offset, value)); \ | 139 set_##field(BooleanBit::set(field(), offset, value)); \ |
| 140 } | 140 } |
| 141 | 141 |
| 142 bool HeapObject::IsFixedArrayBase() const { | 142 bool HeapObject::IsFixedArrayBase() const { |
| 143 return IsFixedArray() || IsFixedDoubleArray() || IsFixedTypedArrayBase(); | 143 return IsFixedArray() || IsFixedDoubleArray() || IsFixedTypedArrayBase(); |
| 144 } | 144 } |
| 145 | 145 |
| 146 bool HeapObject::IsWebAssemblyCompiledModule() const { |
| 147 if (!IsJSObject()) return false; |
| 148 return GetIsolate()->native_context()->wasm_module_constructor() == |
| 149 this->map()->GetConstructor(); |
| 150 } |
| 151 |
| 146 bool HeapObject::IsFixedArray() const { | 152 bool HeapObject::IsFixedArray() const { |
| 147 InstanceType instance_type = map()->instance_type(); | 153 InstanceType instance_type = map()->instance_type(); |
| 148 return instance_type == FIXED_ARRAY_TYPE || | 154 return instance_type == FIXED_ARRAY_TYPE || |
| 149 instance_type == TRANSITION_ARRAY_TYPE; | 155 instance_type == TRANSITION_ARRAY_TYPE; |
| 150 } | 156 } |
| 151 | 157 |
| 152 | 158 |
| 153 // External objects are not extensible, so the map check is enough. | 159 // External objects are not extensible, so the map check is enough. |
| 154 bool HeapObject::IsExternal() const { | 160 bool HeapObject::IsExternal() const { |
| 155 return map() == GetHeap()->external_map(); | 161 return map() == GetHeap()->external_map(); |
| (...skipping 8030 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8186 #undef WRITE_INT64_FIELD | 8192 #undef WRITE_INT64_FIELD |
| 8187 #undef READ_BYTE_FIELD | 8193 #undef READ_BYTE_FIELD |
| 8188 #undef WRITE_BYTE_FIELD | 8194 #undef WRITE_BYTE_FIELD |
| 8189 #undef NOBARRIER_READ_BYTE_FIELD | 8195 #undef NOBARRIER_READ_BYTE_FIELD |
| 8190 #undef NOBARRIER_WRITE_BYTE_FIELD | 8196 #undef NOBARRIER_WRITE_BYTE_FIELD |
| 8191 | 8197 |
| 8192 } // namespace internal | 8198 } // namespace internal |
| 8193 } // namespace v8 | 8199 } // namespace v8 |
| 8194 | 8200 |
| 8195 #endif // V8_OBJECTS_INL_H_ | 8201 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |