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

Unified Diff: src/objects-inl.h

Issue 894683003: Introduce LanguageMode, drop StrictMode. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebased (w/ conflicts) 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
« no previous file with comments | « src/objects.cc ('k') | src/parser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index 1dde60df546fc85ec110f2a5f5ef47381589dd99..1bf74bea4303b8c7db3e7511ba4731d654b12cf0 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -1197,10 +1197,10 @@ MaybeHandle<Object> JSProxy::SetElementWithHandler(Handle<JSProxy> proxy,
Handle<JSReceiver> receiver,
uint32_t index,
Handle<Object> value,
- StrictMode strict_mode) {
+ LanguageMode language_mode) {
Isolate* isolate = proxy->GetIsolate();
Handle<String> name = isolate->factory()->Uint32ToString(index);
- return SetPropertyWithHandler(proxy, receiver, name, value, strict_mode);
+ return SetPropertyWithHandler(proxy, receiver, name, value, language_mode);
}
@@ -5804,17 +5804,20 @@ void SharedFunctionInfo::set_optimization_disabled(bool disable) {
}
-StrictMode SharedFunctionInfo::strict_mode() {
+LanguageMode SharedFunctionInfo::language_mode() {
+ STATIC_ASSERT(LANGUAGE_END == 2);
return BooleanBit::get(compiler_hints(), kStrictModeFunction)
? STRICT : SLOPPY;
}
-void SharedFunctionInfo::set_strict_mode(StrictMode strict_mode) {
- // We only allow mode transitions from sloppy to strict.
- DCHECK(this->strict_mode() == SLOPPY || this->strict_mode() == strict_mode);
+void SharedFunctionInfo::set_language_mode(LanguageMode language_mode) {
+ STATIC_ASSERT(LANGUAGE_END == 2);
+ // 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, strict_mode == STRICT);
+ hints = BooleanBit::set(hints, kStrictModeFunction, is_strict(language_mode));
set_compiler_hints(hints);
}
« no previous file with comments | « src/objects.cc ('k') | src/parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698