Chromium Code Reviews| Index: src/objects-inl.h |
| diff --git a/src/objects-inl.h b/src/objects-inl.h |
| index 55a3b2ff40d247e73d1c7fdf1d1c8d7c9751d708..3d44da6a41010afcc0947779d345445fa54fd96c 100644 |
| --- a/src/objects-inl.h |
| +++ b/src/objects-inl.h |
| @@ -3470,23 +3470,36 @@ void SharedFunctionInfo::set_optimization_disabled(bool disable) { |
| } |
| -StrictModeFlag SharedFunctionInfo::strict_mode_flag() { |
| - return BooleanBit::get(compiler_hints(), kStrictModeFunction) |
| - ? kStrictMode : kNonStrictMode; |
| +LanguageMode SharedFunctionInfo::language_mode() { |
| + int hints = compiler_hints(); |
| + if (BooleanBit::get(hints, kExtendedModeFunction)) { |
| + ASSERT(BooleanBit::get(hints, kStrictModeFunction)); |
| + return EXTENDED_MODE; |
| + } |
| + return BooleanBit::get(hints, kStrictModeFunction) |
| + ? STRICT_MODE : CLASSIC_MODE; |
| +} |
| + |
| + |
| +void SharedFunctionInfo::set_language_mode(LanguageMode language_mode) { |
| + int hints = compiler_hints(); |
| + hints = BooleanBit::set( |
| + hints, kStrictModeFunction, language_mode != CLASSIC_MODE); |
| + hints = BooleanBit::set( |
| + hints, kExtendedModeFunction, language_mode == EXTENDED_MODE); |
| + set_compiler_hints(hints); |
| } |
| -void SharedFunctionInfo::set_strict_mode_flag(StrictModeFlag strict_mode_flag) { |
| - ASSERT(strict_mode_flag == kStrictMode || |
| - strict_mode_flag == kNonStrictMode); |
| - bool value = strict_mode_flag == kStrictMode; |
| - set_compiler_hints( |
| - BooleanBit::set(compiler_hints(), kStrictModeFunction, value)); |
| +bool SharedFunctionInfo::is_classic_mode() { |
| + return !is_strict_or_extended_mode(); |
| } |
| -BOOL_GETTER(SharedFunctionInfo, compiler_hints, strict_mode, |
| +BOOL_GETTER(SharedFunctionInfo, compiler_hints, is_strict_or_extended_mode, |
|
rossberg
2011/11/08 15:02:46
And here.
Steven
2011/11/08 16:13:49
Done.
|
| kStrictModeFunction) |
| +BOOL_GETTER(SharedFunctionInfo, compiler_hints, is_extended_mode, |
| + kExtendedModeFunction) |
| BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, native, kNative) |
| BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, |
| name_should_print_as_anonymous, |