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 6050 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6061 void SharedFunctionInfo::set_bytecode_array(BytecodeArray* bytecode) { | 6061 void SharedFunctionInfo::set_bytecode_array(BytecodeArray* bytecode) { |
6062 DCHECK(function_data()->IsUndefined(GetIsolate())); | 6062 DCHECK(function_data()->IsUndefined(GetIsolate())); |
6063 set_function_data(bytecode); | 6063 set_function_data(bytecode); |
6064 } | 6064 } |
6065 | 6065 |
6066 void SharedFunctionInfo::ClearBytecodeArray() { | 6066 void SharedFunctionInfo::ClearBytecodeArray() { |
6067 DCHECK(function_data()->IsUndefined(GetIsolate()) || HasBytecodeArray()); | 6067 DCHECK(function_data()->IsUndefined(GetIsolate()) || HasBytecodeArray()); |
6068 set_function_data(GetHeap()->undefined_value()); | 6068 set_function_data(GetHeap()->undefined_value()); |
6069 } | 6069 } |
6070 | 6070 |
| 6071 bool SharedFunctionInfo::HasAsmWasmData() { |
| 6072 return function_data()->IsFixedArray(); |
| 6073 } |
| 6074 |
| 6075 FixedArray* SharedFunctionInfo::asm_wasm_data() { |
| 6076 DCHECK(HasAsmWasmData()); |
| 6077 return FixedArray::cast(function_data()); |
| 6078 } |
| 6079 |
| 6080 void SharedFunctionInfo::set_asm_wasm_data(FixedArray* data) { |
| 6081 DCHECK(function_data()->IsUndefined(GetIsolate()) || HasAsmWasmData()); |
| 6082 set_function_data(data); |
| 6083 } |
| 6084 |
| 6085 void SharedFunctionInfo::ClearAsmWasmData() { |
| 6086 DCHECK(function_data()->IsUndefined(GetIsolate()) || HasAsmWasmData()); |
| 6087 set_function_data(GetHeap()->undefined_value()); |
| 6088 } |
| 6089 |
6071 bool SharedFunctionInfo::HasBuiltinFunctionId() { | 6090 bool SharedFunctionInfo::HasBuiltinFunctionId() { |
6072 return function_identifier()->IsSmi(); | 6091 return function_identifier()->IsSmi(); |
6073 } | 6092 } |
6074 | 6093 |
6075 BuiltinFunctionId SharedFunctionInfo::builtin_function_id() { | 6094 BuiltinFunctionId SharedFunctionInfo::builtin_function_id() { |
6076 DCHECK(HasBuiltinFunctionId()); | 6095 DCHECK(HasBuiltinFunctionId()); |
6077 return static_cast<BuiltinFunctionId>( | 6096 return static_cast<BuiltinFunctionId>( |
6078 Smi::cast(function_identifier())->value()); | 6097 Smi::cast(function_identifier())->value()); |
6079 } | 6098 } |
6080 | 6099 |
(...skipping 1965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8046 #undef WRITE_INT64_FIELD | 8065 #undef WRITE_INT64_FIELD |
8047 #undef READ_BYTE_FIELD | 8066 #undef READ_BYTE_FIELD |
8048 #undef WRITE_BYTE_FIELD | 8067 #undef WRITE_BYTE_FIELD |
8049 #undef NOBARRIER_READ_BYTE_FIELD | 8068 #undef NOBARRIER_READ_BYTE_FIELD |
8050 #undef NOBARRIER_WRITE_BYTE_FIELD | 8069 #undef NOBARRIER_WRITE_BYTE_FIELD |
8051 | 8070 |
8052 } // namespace internal | 8071 } // namespace internal |
8053 } // namespace v8 | 8072 } // namespace v8 |
8054 | 8073 |
8055 #endif // V8_OBJECTS_INL_H_ | 8074 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |