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 5705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5716 void SharedFunctionInfo::set_optimization_disabled(bool disable) { | 5716 void SharedFunctionInfo::set_optimization_disabled(bool disable) { |
5717 set_compiler_hints(BooleanBit::set(compiler_hints(), | 5717 set_compiler_hints(BooleanBit::set(compiler_hints(), |
5718 kOptimizationDisabled, | 5718 kOptimizationDisabled, |
5719 disable)); | 5719 disable)); |
5720 } | 5720 } |
5721 | 5721 |
5722 | 5722 |
5723 LanguageMode SharedFunctionInfo::language_mode() { | 5723 LanguageMode SharedFunctionInfo::language_mode() { |
5724 STATIC_ASSERT(LANGUAGE_END == 3); | 5724 STATIC_ASSERT(LANGUAGE_END == 3); |
5725 return construct_language_mode( | 5725 return construct_language_mode( |
5726 BooleanBit::get(compiler_hints(), kStrictModeFunction), | 5726 BooleanBit::get(compiler_hints(), kStrictModeFunction)); |
5727 BooleanBit::get(compiler_hints(), kStrongModeFunction)); | |
5728 } | 5727 } |
5729 | 5728 |
5730 | 5729 |
5731 void SharedFunctionInfo::set_language_mode(LanguageMode language_mode) { | 5730 void SharedFunctionInfo::set_language_mode(LanguageMode language_mode) { |
5732 STATIC_ASSERT(LANGUAGE_END == 3); | 5731 STATIC_ASSERT(LANGUAGE_END == 3); |
5733 // We only allow language mode transitions that set the same language mode | 5732 // We only allow language mode transitions that set the same language mode |
5734 // again or go up in the chain: | 5733 // again or go up in the chain: |
5735 DCHECK(is_sloppy(this->language_mode()) || is_strict(language_mode)); | 5734 DCHECK(is_sloppy(this->language_mode()) || is_strict(language_mode)); |
5736 int hints = compiler_hints(); | 5735 int hints = compiler_hints(); |
5737 hints = BooleanBit::set(hints, kStrictModeFunction, is_strict(language_mode)); | 5736 hints = BooleanBit::set(hints, kStrictModeFunction, is_strict(language_mode)); |
5738 hints = BooleanBit::set(hints, kStrongModeFunction, is_strong(language_mode)); | |
5739 set_compiler_hints(hints); | 5737 set_compiler_hints(hints); |
5740 } | 5738 } |
5741 | 5739 |
5742 | 5740 |
5743 FunctionKind SharedFunctionInfo::kind() { | 5741 FunctionKind SharedFunctionInfo::kind() { |
5744 return FunctionKindBits::decode(compiler_hints()); | 5742 return FunctionKindBits::decode(compiler_hints()); |
5745 } | 5743 } |
5746 | 5744 |
5747 | 5745 |
5748 void SharedFunctionInfo::set_kind(FunctionKind kind) { | 5746 void SharedFunctionInfo::set_kind(FunctionKind kind) { |
(...skipping 2024 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7773 #undef WRITE_INT64_FIELD | 7771 #undef WRITE_INT64_FIELD |
7774 #undef READ_BYTE_FIELD | 7772 #undef READ_BYTE_FIELD |
7775 #undef WRITE_BYTE_FIELD | 7773 #undef WRITE_BYTE_FIELD |
7776 #undef NOBARRIER_READ_BYTE_FIELD | 7774 #undef NOBARRIER_READ_BYTE_FIELD |
7777 #undef NOBARRIER_WRITE_BYTE_FIELD | 7775 #undef NOBARRIER_WRITE_BYTE_FIELD |
7778 | 7776 |
7779 } // namespace internal | 7777 } // namespace internal |
7780 } // namespace v8 | 7778 } // namespace v8 |
7781 | 7779 |
7782 #endif // V8_OBJECTS_INL_H_ | 7780 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |