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 5799 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5810 bool SharedFunctionInfo::IsApiFunction() { | 5810 bool SharedFunctionInfo::IsApiFunction() { |
5811 return function_data()->IsFunctionTemplateInfo(); | 5811 return function_data()->IsFunctionTemplateInfo(); |
5812 } | 5812 } |
5813 | 5813 |
5814 | 5814 |
5815 FunctionTemplateInfo* SharedFunctionInfo::get_api_func_data() { | 5815 FunctionTemplateInfo* SharedFunctionInfo::get_api_func_data() { |
5816 DCHECK(IsApiFunction()); | 5816 DCHECK(IsApiFunction()); |
5817 return FunctionTemplateInfo::cast(function_data()); | 5817 return FunctionTemplateInfo::cast(function_data()); |
5818 } | 5818 } |
5819 | 5819 |
5820 void SharedFunctionInfo::set_api_func_data(FunctionTemplateInfo* data) { | |
5821 DCHECK(function_data()->IsUndefined()); | |
5822 set_function_data(data); | |
5823 } | |
5820 | 5824 |
5821 bool SharedFunctionInfo::HasBuiltinFunctionId() { | 5825 bool SharedFunctionInfo::HasBuiltinFunctionId() { |
5822 return function_data()->IsSmi(); | 5826 return function_data()->IsSmi(); |
5823 } | 5827 } |
5824 | 5828 |
5825 | 5829 |
5826 BuiltinFunctionId SharedFunctionInfo::builtin_function_id() { | 5830 BuiltinFunctionId SharedFunctionInfo::builtin_function_id() { |
5827 DCHECK(HasBuiltinFunctionId()); | 5831 DCHECK(HasBuiltinFunctionId()); |
5828 return static_cast<BuiltinFunctionId>(Smi::cast(function_data())->value()); | 5832 return static_cast<BuiltinFunctionId>(Smi::cast(function_data())->value()); |
5829 } | 5833 } |
5830 | 5834 |
5835 void SharedFunctionInfo::set_builtin_function_id(BuiltinFunctionId id) { | |
5836 DCHECK(function_data()->IsUndefined()); | |
5837 set_function_data(Smi::FromInt(id)); | |
5838 } | |
5831 | 5839 |
5832 bool SharedFunctionInfo::HasBytecodeArray() { | 5840 bool SharedFunctionInfo::HasBytecodeArray() { |
5833 return function_data()->IsBytecodeArray(); | 5841 return function_data()->IsBytecodeArray(); |
5834 } | 5842 } |
5835 | 5843 |
5836 | 5844 |
5837 BytecodeArray* SharedFunctionInfo::bytecode_array() { | 5845 BytecodeArray* SharedFunctionInfo::bytecode_array() { |
5838 DCHECK(HasBytecodeArray()); | 5846 DCHECK(HasBytecodeArray()); |
5839 return BytecodeArray::cast(function_data()); | 5847 return BytecodeArray::cast(function_data()); |
5840 } | 5848 } |
5841 | 5849 |
5850 void SharedFunctionInfo::set_bytecode_array(Object* bytecode) { | |
5851 DCHECK(bytecode->IsBytecodeArray() || bytecode->IsUndefined()); | |
rmcilroy
2016/02/25 14:18:06
Is this ever set to undefined other than the test
Michael Starzinger
2016/02/25 14:43:43
Done. Only done in the test. Added the ClearByteco
| |
5852 DCHECK(function_data()->IsUndefined() || HasBytecodeArray()); | |
5853 set_function_data(bytecode); | |
5854 } | |
5842 | 5855 |
5843 int SharedFunctionInfo::ic_age() { | 5856 int SharedFunctionInfo::ic_age() { |
5844 return ICAgeBits::decode(counters()); | 5857 return ICAgeBits::decode(counters()); |
5845 } | 5858 } |
5846 | 5859 |
5847 | 5860 |
5848 void SharedFunctionInfo::set_ic_age(int ic_age) { | 5861 void SharedFunctionInfo::set_ic_age(int ic_age) { |
5849 set_counters(ICAgeBits::update(counters(), ic_age)); | 5862 set_counters(ICAgeBits::update(counters(), ic_age)); |
5850 } | 5863 } |
5851 | 5864 |
(...skipping 1830 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
7682 #undef WRITE_INT64_FIELD | 7695 #undef WRITE_INT64_FIELD |
7683 #undef READ_BYTE_FIELD | 7696 #undef READ_BYTE_FIELD |
7684 #undef WRITE_BYTE_FIELD | 7697 #undef WRITE_BYTE_FIELD |
7685 #undef NOBARRIER_READ_BYTE_FIELD | 7698 #undef NOBARRIER_READ_BYTE_FIELD |
7686 #undef NOBARRIER_WRITE_BYTE_FIELD | 7699 #undef NOBARRIER_WRITE_BYTE_FIELD |
7687 | 7700 |
7688 } // namespace internal | 7701 } // namespace internal |
7689 } // namespace v8 | 7702 } // namespace v8 |
7690 | 7703 |
7691 #endif // V8_OBJECTS_INL_H_ | 7704 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |