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

Unified Diff: src/compiler.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, 11 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/compilation-cache.cc ('k') | src/compiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler.h
diff --git a/src/compiler.h b/src/compiler.h
index e3b6afa6f91a278475adcf9d545fa9fdcdafb8f3..d1a16b055ddd0fe8d92b803e285bc8fac81064e8 100644
--- a/src/compiler.h
+++ b/src/compiler.h
@@ -108,7 +108,8 @@ class CompilationInfo {
bool is_eval() const { return GetFlag(kEval); }
bool is_global() const { return GetFlag(kGlobal); }
bool is_module() const { return GetFlag(kModule); }
- StrictMode strict_mode() const {
+ LanguageMode language_mode() const {
+ STATIC_ASSERT(LANGUAGE_END == 2);
return GetFlag(kStrictMode) ? STRICT : SLOPPY;
}
FunctionLiteral* function() const { return function_; }
@@ -165,8 +166,9 @@ class CompilationInfo {
bool this_has_uses() { return GetFlag(kThisHasUses); }
- void SetStrictMode(StrictMode strict_mode) {
- SetFlag(kStrictMode, strict_mode == STRICT);
+ void SetLanguageMode(LanguageMode language_mode) {
+ STATIC_ASSERT(LANGUAGE_END == 2);
+ SetFlag(kStrictMode, language_mode & STRICT);
}
void MarkAsNative() { SetFlag(kNative); }
@@ -715,7 +717,7 @@ class Compiler : public AllStatic {
// Compile a String source within a context for eval.
MUST_USE_RESULT static MaybeHandle<JSFunction> GetFunctionFromEval(
Handle<String> source, Handle<SharedFunctionInfo> outer_info,
- Handle<Context> context, StrictMode strict_mode,
+ Handle<Context> context, LanguageMode language_mode,
ParseRestriction restriction, int scope_position);
// Compile a String source within a context.
« no previous file with comments | « src/compilation-cache.cc ('k') | src/compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698