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 6066 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6077 void SharedFunctionInfo::set_bytecode_array(BytecodeArray* bytecode) { | 6077 void SharedFunctionInfo::set_bytecode_array(BytecodeArray* bytecode) { |
6078 DCHECK(function_data()->IsUndefined(GetIsolate())); | 6078 DCHECK(function_data()->IsUndefined(GetIsolate())); |
6079 set_function_data(bytecode); | 6079 set_function_data(bytecode); |
6080 } | 6080 } |
6081 | 6081 |
6082 void SharedFunctionInfo::ClearBytecodeArray() { | 6082 void SharedFunctionInfo::ClearBytecodeArray() { |
6083 DCHECK(function_data()->IsUndefined(GetIsolate()) || HasBytecodeArray()); | 6083 DCHECK(function_data()->IsUndefined(GetIsolate()) || HasBytecodeArray()); |
6084 set_function_data(GetHeap()->undefined_value()); | 6084 set_function_data(GetHeap()->undefined_value()); |
6085 } | 6085 } |
6086 | 6086 |
| 6087 bool SharedFunctionInfo::HasAsmWasmData() { |
| 6088 return function_data()->IsFixedArray(); |
| 6089 } |
| 6090 |
| 6091 FixedArray* SharedFunctionInfo::asm_wasm_data() { |
| 6092 DCHECK(HasAsmWasmData()); |
| 6093 return FixedArray::cast(function_data()); |
| 6094 } |
| 6095 |
| 6096 void SharedFunctionInfo::set_asm_wasm_data(FixedArray* data) { |
| 6097 DCHECK(function_data()->IsUndefined(GetIsolate()) || HasAsmWasmData()); |
| 6098 set_function_data(data); |
| 6099 } |
| 6100 |
| 6101 void SharedFunctionInfo::ClearAsmWasmData() { |
| 6102 DCHECK(function_data()->IsUndefined(GetIsolate()) || HasAsmWasmData()); |
| 6103 set_function_data(GetHeap()->undefined_value()); |
| 6104 } |
| 6105 |
6087 bool SharedFunctionInfo::HasBuiltinFunctionId() { | 6106 bool SharedFunctionInfo::HasBuiltinFunctionId() { |
6088 return function_identifier()->IsSmi(); | 6107 return function_identifier()->IsSmi(); |
6089 } | 6108 } |
6090 | 6109 |
6091 BuiltinFunctionId SharedFunctionInfo::builtin_function_id() { | 6110 BuiltinFunctionId SharedFunctionInfo::builtin_function_id() { |
6092 DCHECK(HasBuiltinFunctionId()); | 6111 DCHECK(HasBuiltinFunctionId()); |
6093 return static_cast<BuiltinFunctionId>( | 6112 return static_cast<BuiltinFunctionId>( |
6094 Smi::cast(function_identifier())->value()); | 6113 Smi::cast(function_identifier())->value()); |
6095 } | 6114 } |
6096 | 6115 |
(...skipping 1965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8062 #undef WRITE_INT64_FIELD | 8081 #undef WRITE_INT64_FIELD |
8063 #undef READ_BYTE_FIELD | 8082 #undef READ_BYTE_FIELD |
8064 #undef WRITE_BYTE_FIELD | 8083 #undef WRITE_BYTE_FIELD |
8065 #undef NOBARRIER_READ_BYTE_FIELD | 8084 #undef NOBARRIER_READ_BYTE_FIELD |
8066 #undef NOBARRIER_WRITE_BYTE_FIELD | 8085 #undef NOBARRIER_WRITE_BYTE_FIELD |
8067 | 8086 |
8068 } // namespace internal | 8087 } // namespace internal |
8069 } // namespace v8 | 8088 } // namespace v8 |
8070 | 8089 |
8071 #endif // V8_OBJECTS_INL_H_ | 8090 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |