| 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 2871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2882 | 2882 |
| 2883 BOOL_ACCESSORS(FunctionTemplateInfo, flag, hidden_prototype, | 2883 BOOL_ACCESSORS(FunctionTemplateInfo, flag, hidden_prototype, |
| 2884 kHiddenPrototypeBit) | 2884 kHiddenPrototypeBit) |
| 2885 BOOL_ACCESSORS(FunctionTemplateInfo, flag, undetectable, kUndetectableBit) | 2885 BOOL_ACCESSORS(FunctionTemplateInfo, flag, undetectable, kUndetectableBit) |
| 2886 BOOL_ACCESSORS(FunctionTemplateInfo, flag, needs_access_check, | 2886 BOOL_ACCESSORS(FunctionTemplateInfo, flag, needs_access_check, |
| 2887 kNeedsAccessCheckBit) | 2887 kNeedsAccessCheckBit) |
| 2888 BOOL_ACCESSORS(SharedFunctionInfo, start_position_and_type, is_expression, | 2888 BOOL_ACCESSORS(SharedFunctionInfo, start_position_and_type, is_expression, |
| 2889 kIsExpressionBit) | 2889 kIsExpressionBit) |
| 2890 BOOL_ACCESSORS(SharedFunctionInfo, start_position_and_type, is_toplevel, | 2890 BOOL_ACCESSORS(SharedFunctionInfo, start_position_and_type, is_toplevel, |
| 2891 kIsTopLevelBit) | 2891 kIsTopLevelBit) |
| 2892 BOOL_GETTER(SharedFunctionInfo, compiler_hints, | 2892 BOOL_GETTER(SharedFunctionInfo, |
| 2893 compiler_hints, |
| 2893 has_only_simple_this_property_assignments, | 2894 has_only_simple_this_property_assignments, |
| 2894 kHasOnlySimpleThisPropertyAssignments) | 2895 kHasOnlySimpleThisPropertyAssignments) |
| 2895 BOOL_ACCESSORS(SharedFunctionInfo, | 2896 BOOL_ACCESSORS(SharedFunctionInfo, |
| 2896 compiler_hints, | 2897 compiler_hints, |
| 2897 try_full_codegen, | 2898 try_full_codegen, |
| 2898 kTryFullCodegen) | 2899 kTryFullCodegen) |
| 2899 BOOL_ACCESSORS(SharedFunctionInfo, | 2900 BOOL_ACCESSORS(SharedFunctionInfo, |
| 2900 compiler_hints, | 2901 compiler_hints, |
| 2901 allows_lazy_compilation, | 2902 allows_lazy_compilation, |
| 2902 kAllowLazyCompilation) | 2903 kAllowLazyCompilation) |
| 2904 BOOL_ACCESSORS(SharedFunctionInfo, |
| 2905 compiler_hints, |
| 2906 uses_arguments, |
| 2907 kUsesArguments) |
| 2903 | 2908 |
| 2904 | 2909 |
| 2905 #if V8_HOST_ARCH_32_BIT | 2910 #if V8_HOST_ARCH_32_BIT |
| 2906 SMI_ACCESSORS(SharedFunctionInfo, length, kLengthOffset) | 2911 SMI_ACCESSORS(SharedFunctionInfo, length, kLengthOffset) |
| 2907 SMI_ACCESSORS(SharedFunctionInfo, formal_parameter_count, | 2912 SMI_ACCESSORS(SharedFunctionInfo, formal_parameter_count, |
| 2908 kFormalParameterCountOffset) | 2913 kFormalParameterCountOffset) |
| 2909 SMI_ACCESSORS(SharedFunctionInfo, expected_nof_properties, | 2914 SMI_ACCESSORS(SharedFunctionInfo, expected_nof_properties, |
| 2910 kExpectedNofPropertiesOffset) | 2915 kExpectedNofPropertiesOffset) |
| 2911 SMI_ACCESSORS(SharedFunctionInfo, num_literals, kNumLiteralsOffset) | 2916 SMI_ACCESSORS(SharedFunctionInfo, num_literals, kNumLiteralsOffset) |
| 2912 SMI_ACCESSORS(SharedFunctionInfo, start_position_and_type, | 2917 SMI_ACCESSORS(SharedFunctionInfo, start_position_and_type, |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2976 return READ_BYTE_FIELD(this, kConstructionCountOffset); | 2981 return READ_BYTE_FIELD(this, kConstructionCountOffset); |
| 2977 } | 2982 } |
| 2978 | 2983 |
| 2979 | 2984 |
| 2980 void SharedFunctionInfo::set_construction_count(int value) { | 2985 void SharedFunctionInfo::set_construction_count(int value) { |
| 2981 ASSERT(0 <= value && value < 256); | 2986 ASSERT(0 <= value && value < 256); |
| 2982 WRITE_BYTE_FIELD(this, kConstructionCountOffset, static_cast<byte>(value)); | 2987 WRITE_BYTE_FIELD(this, kConstructionCountOffset, static_cast<byte>(value)); |
| 2983 } | 2988 } |
| 2984 | 2989 |
| 2985 | 2990 |
| 2986 bool SharedFunctionInfo::live_objects_may_exist() { | 2991 BOOL_ACCESSORS(SharedFunctionInfo, |
| 2987 return (compiler_hints() & (1 << kLiveObjectsMayExist)) != 0; | 2992 compiler_hints, |
| 2988 } | 2993 live_objects_may_exist, |
| 2989 | 2994 kLiveObjectsMayExist) |
| 2990 | |
| 2991 void SharedFunctionInfo::set_live_objects_may_exist(bool value) { | |
| 2992 if (value) { | |
| 2993 set_compiler_hints(compiler_hints() | (1 << kLiveObjectsMayExist)); | |
| 2994 } else { | |
| 2995 set_compiler_hints(compiler_hints() & ~(1 << kLiveObjectsMayExist)); | |
| 2996 } | |
| 2997 } | |
| 2998 | 2995 |
| 2999 | 2996 |
| 3000 bool SharedFunctionInfo::IsInobjectSlackTrackingInProgress() { | 2997 bool SharedFunctionInfo::IsInobjectSlackTrackingInProgress() { |
| 3001 return initial_map() != Heap::undefined_value(); | 2998 return initial_map() != Heap::undefined_value(); |
| 3002 } | 2999 } |
| 3003 | 3000 |
| 3004 | 3001 |
| 3005 bool SharedFunctionInfo::optimization_disabled() { | 3002 BOOL_GETTER(SharedFunctionInfo, |
| 3006 return BooleanBit::get(compiler_hints(), kOptimizationDisabled); | 3003 compiler_hints, |
| 3007 } | 3004 optimization_disabled, |
| 3005 kOptimizationDisabled) |
| 3008 | 3006 |
| 3009 | 3007 |
| 3010 void SharedFunctionInfo::set_optimization_disabled(bool disable) { | 3008 void SharedFunctionInfo::set_optimization_disabled(bool disable) { |
| 3011 set_compiler_hints(BooleanBit::set(compiler_hints(), | 3009 set_compiler_hints(BooleanBit::set(compiler_hints(), |
| 3012 kOptimizationDisabled, | 3010 kOptimizationDisabled, |
| 3013 disable)); | 3011 disable)); |
| 3014 // If disabling optimizations we reflect that in the code object so | 3012 // If disabling optimizations we reflect that in the code object so |
| 3015 // it will not be counted as optimizable code. | 3013 // it will not be counted as optimizable code. |
| 3016 if ((code()->kind() == Code::FUNCTION) && disable) { | 3014 if ((code()->kind() == Code::FUNCTION) && disable) { |
| 3017 code()->set_optimizable(false); | 3015 code()->set_optimizable(false); |
| 3018 } | 3016 } |
| 3019 } | 3017 } |
| 3020 | 3018 |
| 3021 | 3019 |
| 3022 bool SharedFunctionInfo::strict_mode() { | 3020 BOOL_ACCESSORS(SharedFunctionInfo, |
| 3023 return BooleanBit::get(compiler_hints(), kStrictModeFunction); | 3021 compiler_hints, |
| 3024 } | 3022 strict_mode, |
| 3025 | 3023 kStrictModeFunction) |
| 3026 | |
| 3027 void SharedFunctionInfo::set_strict_mode(bool value) { | |
| 3028 set_compiler_hints(BooleanBit::set(compiler_hints(), | |
| 3029 kStrictModeFunction, | |
| 3030 value)); | |
| 3031 } | |
| 3032 | 3024 |
| 3033 | 3025 |
| 3034 ACCESSORS(CodeCache, default_cache, FixedArray, kDefaultCacheOffset) | 3026 ACCESSORS(CodeCache, default_cache, FixedArray, kDefaultCacheOffset) |
| 3035 ACCESSORS(CodeCache, normal_type_cache, Object, kNormalTypeCacheOffset) | 3027 ACCESSORS(CodeCache, normal_type_cache, Object, kNormalTypeCacheOffset) |
| 3036 | 3028 |
| 3037 bool Script::HasValidSource() { | 3029 bool Script::HasValidSource() { |
| 3038 Object* src = this->source(); | 3030 Object* src = this->source(); |
| 3039 if (!src->IsString()) return true; | 3031 if (!src->IsString()) return true; |
| 3040 String* src_str = String::cast(src); | 3032 String* src_str = String::cast(src); |
| 3041 if (!StringShape(src_str).IsExternal()) return true; | 3033 if (!StringShape(src_str).IsExternal()) return true; |
| (...skipping 894 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3936 #undef WRITE_INT_FIELD | 3928 #undef WRITE_INT_FIELD |
| 3937 #undef READ_SHORT_FIELD | 3929 #undef READ_SHORT_FIELD |
| 3938 #undef WRITE_SHORT_FIELD | 3930 #undef WRITE_SHORT_FIELD |
| 3939 #undef READ_BYTE_FIELD | 3931 #undef READ_BYTE_FIELD |
| 3940 #undef WRITE_BYTE_FIELD | 3932 #undef WRITE_BYTE_FIELD |
| 3941 | 3933 |
| 3942 | 3934 |
| 3943 } } // namespace v8::internal | 3935 } } // namespace v8::internal |
| 3944 | 3936 |
| 3945 #endif // V8_OBJECTS_INL_H_ | 3937 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |