OLD | NEW |
---|---|
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 3452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3463 kOptimizationDisabled, | 3463 kOptimizationDisabled, |
3464 disable)); | 3464 disable)); |
3465 // If disabling optimizations we reflect that in the code object so | 3465 // If disabling optimizations we reflect that in the code object so |
3466 // it will not be counted as optimizable code. | 3466 // it will not be counted as optimizable code. |
3467 if ((code()->kind() == Code::FUNCTION) && disable) { | 3467 if ((code()->kind() == Code::FUNCTION) && disable) { |
3468 code()->set_optimizable(false); | 3468 code()->set_optimizable(false); |
3469 } | 3469 } |
3470 } | 3470 } |
3471 | 3471 |
3472 | 3472 |
3473 StrictModeFlag SharedFunctionInfo::strict_mode_flag() { | 3473 LanguageMode SharedFunctionInfo::language_mode() { |
3474 return BooleanBit::get(compiler_hints(), kStrictModeFunction) | 3474 int hints = compiler_hints(); |
3475 ? kStrictMode : kNonStrictMode; | 3475 if (BooleanBit::get(hints, kExtendedModeFunction)) { |
3476 ASSERT(BooleanBit::get(hints, kStrictModeFunction)); | |
3477 return EXTENDED_MODE; | |
3478 } | |
3479 return BooleanBit::get(hints, kStrictModeFunction) | |
3480 ? STRICT_MODE : CLASSIC_MODE; | |
3476 } | 3481 } |
3477 | 3482 |
3478 | 3483 |
3479 void SharedFunctionInfo::set_strict_mode_flag(StrictModeFlag strict_mode_flag) { | 3484 void SharedFunctionInfo::set_language_mode(LanguageMode language_mode) { |
3480 ASSERT(strict_mode_flag == kStrictMode || | 3485 int hints = compiler_hints(); |
3481 strict_mode_flag == kNonStrictMode); | 3486 hints = BooleanBit::set( |
3482 bool value = strict_mode_flag == kStrictMode; | 3487 hints, kStrictModeFunction, language_mode != CLASSIC_MODE); |
3483 set_compiler_hints( | 3488 hints = BooleanBit::set( |
3484 BooleanBit::set(compiler_hints(), kStrictModeFunction, value)); | 3489 hints, kExtendedModeFunction, language_mode == EXTENDED_MODE); |
3490 set_compiler_hints(hints); | |
3485 } | 3491 } |
3486 | 3492 |
3487 | 3493 |
3488 BOOL_GETTER(SharedFunctionInfo, compiler_hints, strict_mode, | 3494 bool SharedFunctionInfo::is_classic_mode() { |
3495 return !is_strict_or_extended_mode(); | |
3496 } | |
3497 | |
3498 | |
3499 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.
| |
3489 kStrictModeFunction) | 3500 kStrictModeFunction) |
3501 BOOL_GETTER(SharedFunctionInfo, compiler_hints, is_extended_mode, | |
3502 kExtendedModeFunction) | |
3490 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, native, kNative) | 3503 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, native, kNative) |
3491 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, | 3504 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, |
3492 name_should_print_as_anonymous, | 3505 name_should_print_as_anonymous, |
3493 kNameShouldPrintAsAnonymous) | 3506 kNameShouldPrintAsAnonymous) |
3494 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, bound, kBoundFunction) | 3507 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, bound, kBoundFunction) |
3495 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, is_anonymous, kIsAnonymous) | 3508 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, is_anonymous, kIsAnonymous) |
3496 | 3509 |
3497 ACCESSORS(CodeCache, default_cache, FixedArray, kDefaultCacheOffset) | 3510 ACCESSORS(CodeCache, default_cache, FixedArray, kDefaultCacheOffset) |
3498 ACCESSORS(CodeCache, normal_type_cache, Object, kNormalTypeCacheOffset) | 3511 ACCESSORS(CodeCache, normal_type_cache, Object, kNormalTypeCacheOffset) |
3499 | 3512 |
(...skipping 1107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4607 #undef WRITE_INT_FIELD | 4620 #undef WRITE_INT_FIELD |
4608 #undef READ_SHORT_FIELD | 4621 #undef READ_SHORT_FIELD |
4609 #undef WRITE_SHORT_FIELD | 4622 #undef WRITE_SHORT_FIELD |
4610 #undef READ_BYTE_FIELD | 4623 #undef READ_BYTE_FIELD |
4611 #undef WRITE_BYTE_FIELD | 4624 #undef WRITE_BYTE_FIELD |
4612 | 4625 |
4613 | 4626 |
4614 } } // namespace v8::internal | 4627 } } // namespace v8::internal |
4615 | 4628 |
4616 #endif // V8_OBJECTS_INL_H_ | 4629 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |