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

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

Issue 8344082: Replace boolean indications of strict mode by an enum value. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Some fixes and adapted the preparser. Created 9 years, 2 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
OLDNEW
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 3552 matching lines...) Expand 10 before | Expand all | Expand 10 after
3563 kOptimizationDisabled, 3563 kOptimizationDisabled,
3564 disable)); 3564 disable));
3565 // If disabling optimizations we reflect that in the code object so 3565 // If disabling optimizations we reflect that in the code object so
3566 // it will not be counted as optimizable code. 3566 // it will not be counted as optimizable code.
3567 if ((code()->kind() == Code::FUNCTION) && disable) { 3567 if ((code()->kind() == Code::FUNCTION) && disable) {
3568 code()->set_optimizable(false); 3568 code()->set_optimizable(false);
3569 } 3569 }
3570 } 3570 }
3571 3571
3572 3572
3573 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, strict_mode, 3573 StrictModeFlag SharedFunctionInfo::strict_mode_flag() {
3574 kStrictModeFunction) 3574 return BooleanBit::get(compiler_hints(), kStrictModeFunction)
3575 ? kStrictMode : kNonStrictMode;
3576 }
3577
3578
3579 void SharedFunctionInfo::set_strict_mode_flag(StrictModeFlag strict_mode_flag) {
3580 ASSERT(strict_mode_flag == kStrictMode ||
3581 strict_mode_flag == kNonStrictMode);
3582 bool value = strict_mode_flag == kStrictMode;
3583 set_compiler_hints(
3584 BooleanBit::set(compiler_hints(), kStrictModeFunction, value));
3585 }
3586
3587
3588 BOOL_GETTER(SharedFunctionInfo, compiler_hints, strict_mode,
3589 kStrictModeFunction)
3575 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, native, kNative) 3590 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, native, kNative)
3576 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, 3591 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints,
3577 name_should_print_as_anonymous, 3592 name_should_print_as_anonymous,
3578 kNameShouldPrintAsAnonymous) 3593 kNameShouldPrintAsAnonymous)
3579 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, bound, kBoundFunction) 3594 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, bound, kBoundFunction)
3580 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, is_anonymous, kIsAnonymous) 3595 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, is_anonymous, kIsAnonymous)
3581 3596
3582 ACCESSORS(CodeCache, default_cache, FixedArray, kDefaultCacheOffset) 3597 ACCESSORS(CodeCache, default_cache, FixedArray, kDefaultCacheOffset)
3583 ACCESSORS(CodeCache, normal_type_cache, Object, kNormalTypeCacheOffset) 3598 ACCESSORS(CodeCache, normal_type_cache, Object, kNormalTypeCacheOffset)
3584 3599
(...skipping 1109 matching lines...) Expand 10 before | Expand all | Expand 10 after
4694 #undef WRITE_INT_FIELD 4709 #undef WRITE_INT_FIELD
4695 #undef READ_SHORT_FIELD 4710 #undef READ_SHORT_FIELD
4696 #undef WRITE_SHORT_FIELD 4711 #undef WRITE_SHORT_FIELD
4697 #undef READ_BYTE_FIELD 4712 #undef READ_BYTE_FIELD
4698 #undef WRITE_BYTE_FIELD 4713 #undef WRITE_BYTE_FIELD
4699 4714
4700 4715
4701 } } // namespace v8::internal 4716 } } // namespace v8::internal
4702 4717
4703 #endif // V8_OBJECTS_INL_H_ 4718 #endif // V8_OBJECTS_INL_H_
OLDNEW
« src/compiler.cc ('K') | « src/objects.cc ('k') | src/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698