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

Unified Diff: src/objects-inl.h

Issue 898983002: Add strong mode. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index 1bf74bea4303b8c7db3e7511ba4731d654b12cf0..b5a53dca21ef47e2cdeac3fd3a0cea719c5d0f28 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -5805,19 +5805,21 @@ void SharedFunctionInfo::set_optimization_disabled(bool disable) {
LanguageMode SharedFunctionInfo::language_mode() {
- STATIC_ASSERT(LANGUAGE_END == 2);
- return BooleanBit::get(compiler_hints(), kStrictModeFunction)
- ? STRICT : SLOPPY;
+ STATIC_ASSERT(LANGUAGE_END == 3);
+ return construct_language_mode(
+ BooleanBit::get(compiler_hints(), kStrictModeFunction),
+ BooleanBit::get(compiler_hints(), kSaneModeFunction));
}
void SharedFunctionInfo::set_language_mode(LanguageMode language_mode) {
- STATIC_ASSERT(LANGUAGE_END == 2);
+ STATIC_ASSERT(LANGUAGE_END == 3);
// We only allow language mode transitions that set the same language mode
// again or go up in the chain:
DCHECK(is_sloppy(this->language_mode()) || is_strict(language_mode));
int hints = compiler_hints();
hints = BooleanBit::set(hints, kStrictModeFunction, is_strict(language_mode));
+ hints = BooleanBit::set(hints, kSaneModeFunction, is_sane(language_mode));
set_compiler_hints(hints);
}

Powered by Google App Engine
This is Rietveld 408576698