| 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 5993 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6004 void SharedFunctionInfo::set_bytecode_array(BytecodeArray* bytecode) { | 6004 void SharedFunctionInfo::set_bytecode_array(BytecodeArray* bytecode) { |
| 6005 DCHECK(function_data()->IsUndefined(GetIsolate())); | 6005 DCHECK(function_data()->IsUndefined(GetIsolate())); |
| 6006 set_function_data(bytecode); | 6006 set_function_data(bytecode); |
| 6007 } | 6007 } |
| 6008 | 6008 |
| 6009 void SharedFunctionInfo::ClearBytecodeArray() { | 6009 void SharedFunctionInfo::ClearBytecodeArray() { |
| 6010 DCHECK(function_data()->IsUndefined(GetIsolate()) || HasBytecodeArray()); | 6010 DCHECK(function_data()->IsUndefined(GetIsolate()) || HasBytecodeArray()); |
| 6011 set_function_data(GetHeap()->undefined_value()); | 6011 set_function_data(GetHeap()->undefined_value()); |
| 6012 } | 6012 } |
| 6013 | 6013 |
| 6014 bool SharedFunctionInfo::HasAsmWasmData() { |
| 6015 return function_data()->IsFixedArray(); |
| 6016 } |
| 6017 |
| 6018 FixedArray* SharedFunctionInfo::asm_wasm_data() { |
| 6019 DCHECK(HasAsmWasmData()); |
| 6020 return FixedArray::cast(function_data()); |
| 6021 } |
| 6022 |
| 6023 void SharedFunctionInfo::set_asm_wasm_data(FixedArray* data) { |
| 6024 DCHECK(function_data()->IsUndefined(GetIsolate()) || HasAsmWasmData()); |
| 6025 set_function_data(data); |
| 6026 } |
| 6027 |
| 6028 void SharedFunctionInfo::ClearAsmWasmData() { |
| 6029 DCHECK(function_data()->IsUndefined(GetIsolate()) || HasAsmWasmData()); |
| 6030 set_function_data(GetHeap()->undefined_value()); |
| 6031 } |
| 6032 |
| 6014 bool SharedFunctionInfo::HasBuiltinFunctionId() { | 6033 bool SharedFunctionInfo::HasBuiltinFunctionId() { |
| 6015 return function_identifier()->IsSmi(); | 6034 return function_identifier()->IsSmi(); |
| 6016 } | 6035 } |
| 6017 | 6036 |
| 6018 BuiltinFunctionId SharedFunctionInfo::builtin_function_id() { | 6037 BuiltinFunctionId SharedFunctionInfo::builtin_function_id() { |
| 6019 DCHECK(HasBuiltinFunctionId()); | 6038 DCHECK(HasBuiltinFunctionId()); |
| 6020 return static_cast<BuiltinFunctionId>( | 6039 return static_cast<BuiltinFunctionId>( |
| 6021 Smi::cast(function_identifier())->value()); | 6040 Smi::cast(function_identifier())->value()); |
| 6022 } | 6041 } |
| 6023 | 6042 |
| (...skipping 1933 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7957 #undef WRITE_INT64_FIELD | 7976 #undef WRITE_INT64_FIELD |
| 7958 #undef READ_BYTE_FIELD | 7977 #undef READ_BYTE_FIELD |
| 7959 #undef WRITE_BYTE_FIELD | 7978 #undef WRITE_BYTE_FIELD |
| 7960 #undef NOBARRIER_READ_BYTE_FIELD | 7979 #undef NOBARRIER_READ_BYTE_FIELD |
| 7961 #undef NOBARRIER_WRITE_BYTE_FIELD | 7980 #undef NOBARRIER_WRITE_BYTE_FIELD |
| 7962 | 7981 |
| 7963 } // namespace internal | 7982 } // namespace internal |
| 7964 } // namespace v8 | 7983 } // namespace v8 |
| 7965 | 7984 |
| 7966 #endif // V8_OBJECTS_INL_H_ | 7985 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |