| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 3117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3128 return function_data()->IsFunctionTemplateInfo(); | 3128 return function_data()->IsFunctionTemplateInfo(); |
| 3129 } | 3129 } |
| 3130 | 3130 |
| 3131 | 3131 |
| 3132 FunctionTemplateInfo* SharedFunctionInfo::get_api_func_data() { | 3132 FunctionTemplateInfo* SharedFunctionInfo::get_api_func_data() { |
| 3133 ASSERT(IsApiFunction()); | 3133 ASSERT(IsApiFunction()); |
| 3134 return FunctionTemplateInfo::cast(function_data()); | 3134 return FunctionTemplateInfo::cast(function_data()); |
| 3135 } | 3135 } |
| 3136 | 3136 |
| 3137 | 3137 |
| 3138 bool SharedFunctionInfo::HasCustomCallGenerator() { | 3138 bool SharedFunctionInfo::HasBuiltinFunctionId() { |
| 3139 return function_data()->IsSmi(); | 3139 return function_data()->IsSmi(); |
| 3140 } | 3140 } |
| 3141 | 3141 |
| 3142 | 3142 |
| 3143 MathFunctionId SharedFunctionInfo::math_function_id() { | 3143 bool SharedFunctionInfo::IsBuiltinMathFunction() { |
| 3144 return static_cast<MathFunctionId>( | 3144 return HasBuiltinFunctionId() && |
| 3145 (compiler_hints() >> kMathFunctionShift) & kMathFunctionMask); | 3145 builtin_function_id() >= kFirstMathFunctionId; |
| 3146 } | 3146 } |
| 3147 | 3147 |
| 3148 | 3148 |
| 3149 void SharedFunctionInfo::set_math_function_id(int math_fn) { | 3149 BuiltinFunctionId SharedFunctionInfo::builtin_function_id() { |
| 3150 ASSERT(math_fn <= max_math_id_number()); | 3150 ASSERT(HasBuiltinFunctionId()); |
| 3151 set_compiler_hints(compiler_hints() | | 3151 return static_cast<BuiltinFunctionId>(Smi::cast(function_data())->value()); |
| 3152 ((math_fn & kMathFunctionMask) << kMathFunctionShift)); | |
| 3153 } | |
| 3154 | |
| 3155 | |
| 3156 int SharedFunctionInfo::custom_call_generator_id() { | |
| 3157 ASSERT(HasCustomCallGenerator()); | |
| 3158 return Smi::cast(function_data())->value(); | |
| 3159 } | 3152 } |
| 3160 | 3153 |
| 3161 | 3154 |
| 3162 int SharedFunctionInfo::code_age() { | 3155 int SharedFunctionInfo::code_age() { |
| 3163 return (compiler_hints() >> kCodeAgeShift) & kCodeAgeMask; | 3156 return (compiler_hints() >> kCodeAgeShift) & kCodeAgeMask; |
| 3164 } | 3157 } |
| 3165 | 3158 |
| 3166 | 3159 |
| 3167 void SharedFunctionInfo::set_code_age(int code_age) { | 3160 void SharedFunctionInfo::set_code_age(int code_age) { |
| 3168 set_compiler_hints(compiler_hints() | | 3161 set_compiler_hints(compiler_hints() | |
| (...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4013 #undef WRITE_INT_FIELD | 4006 #undef WRITE_INT_FIELD |
| 4014 #undef READ_SHORT_FIELD | 4007 #undef READ_SHORT_FIELD |
| 4015 #undef WRITE_SHORT_FIELD | 4008 #undef WRITE_SHORT_FIELD |
| 4016 #undef READ_BYTE_FIELD | 4009 #undef READ_BYTE_FIELD |
| 4017 #undef WRITE_BYTE_FIELD | 4010 #undef WRITE_BYTE_FIELD |
| 4018 | 4011 |
| 4019 | 4012 |
| 4020 } } // namespace v8::internal | 4013 } } // namespace v8::internal |
| 4021 | 4014 |
| 4022 #endif // V8_OBJECTS_INL_H_ | 4015 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |