Chromium Code Reviews| 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 3018 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3029 return function_data()->IsFunctionTemplateInfo(); | 3029 return function_data()->IsFunctionTemplateInfo(); |
| 3030 } | 3030 } |
| 3031 | 3031 |
| 3032 | 3032 |
| 3033 FunctionTemplateInfo* SharedFunctionInfo::get_api_func_data() { | 3033 FunctionTemplateInfo* SharedFunctionInfo::get_api_func_data() { |
| 3034 ASSERT(IsApiFunction()); | 3034 ASSERT(IsApiFunction()); |
| 3035 return FunctionTemplateInfo::cast(function_data()); | 3035 return FunctionTemplateInfo::cast(function_data()); |
| 3036 } | 3036 } |
| 3037 | 3037 |
| 3038 | 3038 |
| 3039 bool SharedFunctionInfo::HasCustomCallGenerator() { | 3039 bool SharedFunctionInfo::HasBuiltinFunctionId() { |
| 3040 return function_data()->IsSmi(); | 3040 return function_data()->IsSmi(); |
| 3041 } | 3041 } |
| 3042 | 3042 |
| 3043 | 3043 |
| 3044 MathFunctionId SharedFunctionInfo::math_function_id() { | 3044 bool SharedFunctionInfo::IsBuiltinMathFunction() { |
| 3045 return static_cast<MathFunctionId>( | 3045 return HasBuiltinFunctionId() && builtin_function_id() >= kMathFloor; |
|
Erik Corry
2010/12/13 14:08:17
Let's have a real name for this, like kFirstMathFu
Vitaly Repeshko
2010/12/14 18:55:33
Done.
| |
| 3046 (compiler_hints() >> kMathFunctionShift) & kMathFunctionMask); | |
| 3047 } | 3046 } |
| 3048 | 3047 |
| 3049 | 3048 |
| 3050 void SharedFunctionInfo::set_math_function_id(int math_fn) { | 3049 BuiltinFunctionId SharedFunctionInfo::builtin_function_id() { |
| 3051 ASSERT(math_fn <= max_math_id_number()); | 3050 ASSERT(HasBuiltinFunctionId()); |
| 3052 set_compiler_hints(compiler_hints() | | 3051 return static_cast<BuiltinFunctionId>(Smi::cast(function_data())->value()); |
| 3053 ((math_fn & kMathFunctionMask) << kMathFunctionShift)); | |
| 3054 } | 3052 } |
| 3055 | 3053 |
| 3056 | 3054 |
| 3057 int SharedFunctionInfo::custom_call_generator_id() { | |
| 3058 ASSERT(HasCustomCallGenerator()); | |
| 3059 return Smi::cast(function_data())->value(); | |
| 3060 } | |
| 3061 | |
| 3062 | |
| 3063 int SharedFunctionInfo::code_age() { | 3055 int SharedFunctionInfo::code_age() { |
| 3064 return (compiler_hints() >> kCodeAgeShift) & kCodeAgeMask; | 3056 return (compiler_hints() >> kCodeAgeShift) & kCodeAgeMask; |
| 3065 } | 3057 } |
| 3066 | 3058 |
| 3067 | 3059 |
| 3068 void SharedFunctionInfo::set_code_age(int code_age) { | 3060 void SharedFunctionInfo::set_code_age(int code_age) { |
| 3069 set_compiler_hints(compiler_hints() | | 3061 set_compiler_hints(compiler_hints() | |
| 3070 ((code_age & kCodeAgeMask) << kCodeAgeShift)); | 3062 ((code_age & kCodeAgeMask) << kCodeAgeShift)); |
| 3071 } | 3063 } |
| 3072 | 3064 |
| (...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3852 #undef WRITE_INT_FIELD | 3844 #undef WRITE_INT_FIELD |
| 3853 #undef READ_SHORT_FIELD | 3845 #undef READ_SHORT_FIELD |
| 3854 #undef WRITE_SHORT_FIELD | 3846 #undef WRITE_SHORT_FIELD |
| 3855 #undef READ_BYTE_FIELD | 3847 #undef READ_BYTE_FIELD |
| 3856 #undef WRITE_BYTE_FIELD | 3848 #undef WRITE_BYTE_FIELD |
| 3857 | 3849 |
| 3858 | 3850 |
| 3859 } } // namespace v8::internal | 3851 } } // namespace v8::internal |
| 3860 | 3852 |
| 3861 #endif // V8_OBJECTS_INL_H_ | 3853 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |