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 5689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5700 void SharedFunctionInfo::set_optimization_disabled(bool disable) { | 5700 void SharedFunctionInfo::set_optimization_disabled(bool disable) { |
5701 set_compiler_hints(BooleanBit::set(compiler_hints(), | 5701 set_compiler_hints(BooleanBit::set(compiler_hints(), |
5702 kOptimizationDisabled, | 5702 kOptimizationDisabled, |
5703 disable)); | 5703 disable)); |
5704 } | 5704 } |
5705 | 5705 |
5706 | 5706 |
5707 LanguageMode SharedFunctionInfo::language_mode() { | 5707 LanguageMode SharedFunctionInfo::language_mode() { |
5708 STATIC_ASSERT(LANGUAGE_END == 3); | 5708 STATIC_ASSERT(LANGUAGE_END == 3); |
5709 return construct_language_mode( | 5709 return construct_language_mode( |
5710 BooleanBit::get(compiler_hints(), kStrictModeFunction), | 5710 BooleanBit::get(compiler_hints(), kStrictModeFunction)); |
5711 BooleanBit::get(compiler_hints(), kStrongModeFunction)); | |
5712 } | 5711 } |
5713 | 5712 |
5714 | 5713 |
5715 void SharedFunctionInfo::set_language_mode(LanguageMode language_mode) { | 5714 void SharedFunctionInfo::set_language_mode(LanguageMode language_mode) { |
5716 STATIC_ASSERT(LANGUAGE_END == 3); | 5715 STATIC_ASSERT(LANGUAGE_END == 3); |
5717 // We only allow language mode transitions that set the same language mode | 5716 // We only allow language mode transitions that set the same language mode |
5718 // again or go up in the chain: | 5717 // again or go up in the chain: |
5719 DCHECK(is_sloppy(this->language_mode()) || is_strict(language_mode)); | 5718 DCHECK(is_sloppy(this->language_mode()) || is_strict(language_mode)); |
5720 int hints = compiler_hints(); | 5719 int hints = compiler_hints(); |
5721 hints = BooleanBit::set(hints, kStrictModeFunction, is_strict(language_mode)); | 5720 hints = BooleanBit::set(hints, kStrictModeFunction, is_strict(language_mode)); |
5722 hints = BooleanBit::set(hints, kStrongModeFunction, is_strong(language_mode)); | |
5723 set_compiler_hints(hints); | 5721 set_compiler_hints(hints); |
5724 } | 5722 } |
5725 | 5723 |
5726 | 5724 |
5727 FunctionKind SharedFunctionInfo::kind() { | 5725 FunctionKind SharedFunctionInfo::kind() { |
5728 return FunctionKindBits::decode(compiler_hints()); | 5726 return FunctionKindBits::decode(compiler_hints()); |
5729 } | 5727 } |
5730 | 5728 |
5731 | 5729 |
5732 void SharedFunctionInfo::set_kind(FunctionKind kind) { | 5730 void SharedFunctionInfo::set_kind(FunctionKind kind) { |
(...skipping 2024 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7757 #undef WRITE_INT64_FIELD | 7755 #undef WRITE_INT64_FIELD |
7758 #undef READ_BYTE_FIELD | 7756 #undef READ_BYTE_FIELD |
7759 #undef WRITE_BYTE_FIELD | 7757 #undef WRITE_BYTE_FIELD |
7760 #undef NOBARRIER_READ_BYTE_FIELD | 7758 #undef NOBARRIER_READ_BYTE_FIELD |
7761 #undef NOBARRIER_WRITE_BYTE_FIELD | 7759 #undef NOBARRIER_WRITE_BYTE_FIELD |
7762 | 7760 |
7763 } // namespace internal | 7761 } // namespace internal |
7764 } // namespace v8 | 7762 } // namespace v8 |
7765 | 7763 |
7766 #endif // V8_OBJECTS_INL_H_ | 7764 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |