Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1163)

Side by Side Diff: src/objects-inl.h

Issue 9958062: Change ASSERT(kind() == FUNCTION) to ASSERT_EQ(FUNCTION, kind()). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 2986 matching lines...) Expand 10 before | Expand all | Expand 10 after
2997 2997
2998 void Code::set_is_pregenerated(bool value) { 2998 void Code::set_is_pregenerated(bool value) {
2999 ASSERT(kind() == STUB); 2999 ASSERT(kind() == STUB);
3000 Flags f = flags(); 3000 Flags f = flags();
3001 f = static_cast<Flags>(IsPregeneratedField::update(f, value)); 3001 f = static_cast<Flags>(IsPregeneratedField::update(f, value));
3002 set_flags(f); 3002 set_flags(f);
3003 } 3003 }
3004 3004
3005 3005
3006 bool Code::optimizable() { 3006 bool Code::optimizable() {
3007 ASSERT(kind() == FUNCTION); 3007 ASSERT_EQ(FUNCTION, kind());
3008 return READ_BYTE_FIELD(this, kOptimizableOffset) == 1; 3008 return READ_BYTE_FIELD(this, kOptimizableOffset) == 1;
3009 } 3009 }
3010 3010
3011 3011
3012 void Code::set_optimizable(bool value) { 3012 void Code::set_optimizable(bool value) {
3013 ASSERT(kind() == FUNCTION); 3013 ASSERT_EQ(FUNCTION, kind());
3014 WRITE_BYTE_FIELD(this, kOptimizableOffset, value ? 1 : 0); 3014 WRITE_BYTE_FIELD(this, kOptimizableOffset, value ? 1 : 0);
3015 } 3015 }
3016 3016
3017 3017
3018 bool Code::has_deoptimization_support() { 3018 bool Code::has_deoptimization_support() {
3019 ASSERT(kind() == FUNCTION); 3019 ASSERT_EQ(FUNCTION, kind());
3020 byte flags = READ_BYTE_FIELD(this, kFullCodeFlags); 3020 byte flags = READ_BYTE_FIELD(this, kFullCodeFlags);
3021 return FullCodeFlagsHasDeoptimizationSupportField::decode(flags); 3021 return FullCodeFlagsHasDeoptimizationSupportField::decode(flags);
3022 } 3022 }
3023 3023
3024 3024
3025 void Code::set_has_deoptimization_support(bool value) { 3025 void Code::set_has_deoptimization_support(bool value) {
3026 ASSERT(kind() == FUNCTION); 3026 ASSERT_EQ(FUNCTION, kind());
3027 byte flags = READ_BYTE_FIELD(this, kFullCodeFlags); 3027 byte flags = READ_BYTE_FIELD(this, kFullCodeFlags);
3028 flags = FullCodeFlagsHasDeoptimizationSupportField::update(flags, value); 3028 flags = FullCodeFlagsHasDeoptimizationSupportField::update(flags, value);
3029 WRITE_BYTE_FIELD(this, kFullCodeFlags, flags); 3029 WRITE_BYTE_FIELD(this, kFullCodeFlags, flags);
3030 } 3030 }
3031 3031
3032 3032
3033 bool Code::has_debug_break_slots() { 3033 bool Code::has_debug_break_slots() {
3034 ASSERT(kind() == FUNCTION); 3034 ASSERT_EQ(FUNCTION, kind());
3035 byte flags = READ_BYTE_FIELD(this, kFullCodeFlags); 3035 byte flags = READ_BYTE_FIELD(this, kFullCodeFlags);
3036 return FullCodeFlagsHasDebugBreakSlotsField::decode(flags); 3036 return FullCodeFlagsHasDebugBreakSlotsField::decode(flags);
3037 } 3037 }
3038 3038
3039 3039
3040 void Code::set_has_debug_break_slots(bool value) { 3040 void Code::set_has_debug_break_slots(bool value) {
3041 ASSERT(kind() == FUNCTION); 3041 ASSERT_EQ(FUNCTION, kind());
3042 byte flags = READ_BYTE_FIELD(this, kFullCodeFlags); 3042 byte flags = READ_BYTE_FIELD(this, kFullCodeFlags);
3043 flags = FullCodeFlagsHasDebugBreakSlotsField::update(flags, value); 3043 flags = FullCodeFlagsHasDebugBreakSlotsField::update(flags, value);
3044 WRITE_BYTE_FIELD(this, kFullCodeFlags, flags); 3044 WRITE_BYTE_FIELD(this, kFullCodeFlags, flags);
3045 } 3045 }
3046 3046
3047 3047
3048 bool Code::is_compiled_optimizable() { 3048 bool Code::is_compiled_optimizable() {
3049 ASSERT(kind() == FUNCTION); 3049 ASSERT_EQ(FUNCTION, kind());
3050 byte flags = READ_BYTE_FIELD(this, kFullCodeFlags); 3050 byte flags = READ_BYTE_FIELD(this, kFullCodeFlags);
3051 return FullCodeFlagsIsCompiledOptimizable::decode(flags); 3051 return FullCodeFlagsIsCompiledOptimizable::decode(flags);
3052 } 3052 }
3053 3053
3054 3054
3055 void Code::set_compiled_optimizable(bool value) { 3055 void Code::set_compiled_optimizable(bool value) {
3056 ASSERT(kind() == FUNCTION); 3056 ASSERT_EQ(FUNCTION, kind());
3057 byte flags = READ_BYTE_FIELD(this, kFullCodeFlags); 3057 byte flags = READ_BYTE_FIELD(this, kFullCodeFlags);
3058 flags = FullCodeFlagsIsCompiledOptimizable::update(flags, value); 3058 flags = FullCodeFlagsIsCompiledOptimizable::update(flags, value);
3059 WRITE_BYTE_FIELD(this, kFullCodeFlags, flags); 3059 WRITE_BYTE_FIELD(this, kFullCodeFlags, flags);
3060 } 3060 }
3061 3061
3062 3062
3063 int Code::allow_osr_at_loop_nesting_level() { 3063 int Code::allow_osr_at_loop_nesting_level() {
3064 ASSERT(kind() == FUNCTION); 3064 ASSERT_EQ(FUNCTION, kind());
3065 return READ_BYTE_FIELD(this, kAllowOSRAtLoopNestingLevelOffset); 3065 return READ_BYTE_FIELD(this, kAllowOSRAtLoopNestingLevelOffset);
3066 } 3066 }
3067 3067
3068 3068
3069 void Code::set_allow_osr_at_loop_nesting_level(int level) { 3069 void Code::set_allow_osr_at_loop_nesting_level(int level) {
3070 ASSERT(kind() == FUNCTION); 3070 ASSERT_EQ(FUNCTION, kind());
3071 ASSERT(level >= 0 && level <= kMaxLoopNestingMarker); 3071 ASSERT(level >= 0 && level <= kMaxLoopNestingMarker);
3072 WRITE_BYTE_FIELD(this, kAllowOSRAtLoopNestingLevelOffset, level); 3072 WRITE_BYTE_FIELD(this, kAllowOSRAtLoopNestingLevelOffset, level);
3073 } 3073 }
3074 3074
3075 3075
3076 int Code::profiler_ticks() { 3076 int Code::profiler_ticks() {
3077 ASSERT(kind() == FUNCTION); 3077 ASSERT_EQ(FUNCTION, kind());
3078 return READ_BYTE_FIELD(this, kProfilerTicksOffset); 3078 return READ_BYTE_FIELD(this, kProfilerTicksOffset);
3079 } 3079 }
3080 3080
3081 3081
3082 void Code::set_profiler_ticks(int ticks) { 3082 void Code::set_profiler_ticks(int ticks) {
3083 ASSERT(kind() == FUNCTION); 3083 ASSERT_EQ(FUNCTION, kind());
3084 ASSERT(ticks < 256); 3084 ASSERT(ticks < 256);
3085 WRITE_BYTE_FIELD(this, kProfilerTicksOffset, ticks); 3085 WRITE_BYTE_FIELD(this, kProfilerTicksOffset, ticks);
3086 } 3086 }
3087 3087
3088 3088
3089 unsigned Code::stack_slots() { 3089 unsigned Code::stack_slots() {
3090 ASSERT(kind() == OPTIMIZED_FUNCTION); 3090 ASSERT(kind() == OPTIMIZED_FUNCTION);
3091 return READ_UINT32_FIELD(this, kStackSlotsOffset); 3091 return READ_UINT32_FIELD(this, kStackSlotsOffset);
3092 } 3092 }
3093 3093
(...skipping 11 matching lines...) Expand all
3105 3105
3106 3106
3107 void Code::set_safepoint_table_offset(unsigned offset) { 3107 void Code::set_safepoint_table_offset(unsigned offset) {
3108 ASSERT(kind() == OPTIMIZED_FUNCTION); 3108 ASSERT(kind() == OPTIMIZED_FUNCTION);
3109 ASSERT(IsAligned(offset, static_cast<unsigned>(kIntSize))); 3109 ASSERT(IsAligned(offset, static_cast<unsigned>(kIntSize)));
3110 WRITE_UINT32_FIELD(this, kSafepointTableOffsetOffset, offset); 3110 WRITE_UINT32_FIELD(this, kSafepointTableOffsetOffset, offset);
3111 } 3111 }
3112 3112
3113 3113
3114 unsigned Code::stack_check_table_offset() { 3114 unsigned Code::stack_check_table_offset() {
3115 ASSERT(kind() == FUNCTION); 3115 ASSERT_EQ(FUNCTION, kind());
3116 return READ_UINT32_FIELD(this, kStackCheckTableOffsetOffset); 3116 return READ_UINT32_FIELD(this, kStackCheckTableOffsetOffset);
3117 } 3117 }
3118 3118
3119 3119
3120 void Code::set_stack_check_table_offset(unsigned offset) { 3120 void Code::set_stack_check_table_offset(unsigned offset) {
3121 ASSERT(kind() == FUNCTION); 3121 ASSERT_EQ(FUNCTION, kind());
3122 ASSERT(IsAligned(offset, static_cast<unsigned>(kIntSize))); 3122 ASSERT(IsAligned(offset, static_cast<unsigned>(kIntSize)));
3123 WRITE_UINT32_FIELD(this, kStackCheckTableOffsetOffset, offset); 3123 WRITE_UINT32_FIELD(this, kStackCheckTableOffsetOffset, offset);
3124 } 3124 }
3125 3125
3126 3126
3127 CheckType Code::check_type() { 3127 CheckType Code::check_type() {
3128 ASSERT(is_call_stub() || is_keyed_call_stub()); 3128 ASSERT(is_call_stub() || is_keyed_call_stub());
3129 byte type = READ_BYTE_FIELD(this, kCheckTypeOffset); 3129 byte type = READ_BYTE_FIELD(this, kCheckTypeOffset);
3130 return static_cast<CheckType>(type); 3130 return static_cast<CheckType>(type);
3131 } 3131 }
(...skipping 1794 matching lines...) Expand 10 before | Expand all | Expand 10 after
4926 #undef WRITE_UINT32_FIELD 4926 #undef WRITE_UINT32_FIELD
4927 #undef READ_SHORT_FIELD 4927 #undef READ_SHORT_FIELD
4928 #undef WRITE_SHORT_FIELD 4928 #undef WRITE_SHORT_FIELD
4929 #undef READ_BYTE_FIELD 4929 #undef READ_BYTE_FIELD
4930 #undef WRITE_BYTE_FIELD 4930 #undef WRITE_BYTE_FIELD
4931 4931
4932 4932
4933 } } // namespace v8::internal 4933 } } // namespace v8::internal
4934 4934
4935 #endif // V8_OBJECTS_INL_H_ 4935 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698