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

Unified Diff: src/compiler.cc

Issue 1949013002: [compiler] Remove dangerous language mode accessors. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 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/compiler.h ('k') | src/compiler/js-inlining.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler.cc
diff --git a/src/compiler.cc b/src/compiler.cc
index 73eeba09cf96e96cc417aaccf1cdb87e46a6f62d..057067168aba2548ec488289d61fa1a9f6081574 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -54,7 +54,6 @@ PARSE_INFO_GETTER(bool, is_eval)
PARSE_INFO_GETTER(bool, is_native)
PARSE_INFO_GETTER(bool, is_module)
PARSE_INFO_GETTER(FunctionLiteral*, literal)
-PARSE_INFO_GETTER_WITH_DEFAULT(LanguageMode, language_mode, STRICT)
PARSE_INFO_GETTER_WITH_DEFAULT(Scope*, scope, nullptr)
PARSE_INFO_GETTER_WITH_DEFAULT(Handle<Context>, context,
Handle<Context>::null())
@@ -270,7 +269,7 @@ StackFrame::Type CompilationInfo::GetOutputStackFrameType() const {
}
bool CompilationInfo::ExpectsJSReceiverAsReceiver() {
- return is_sloppy(language_mode()) && !is_native();
+ return is_sloppy(parse_info()->language_mode()) && !is_native();
}
#if DEBUG
@@ -1527,7 +1526,7 @@ Handle<SharedFunctionInfo> Compiler::GetSharedFunctionInfoForScript(
}
parse_info.set_language_mode(
- static_cast<LanguageMode>(info.language_mode() | language_mode));
+ static_cast<LanguageMode>(parse_info.language_mode() | language_mode));
result = CompileToplevel(&info);
if (extension == NULL && !result.is_null()) {
compilation_cache->PutScript(source, context, language_mode, result);
« no previous file with comments | « src/compiler.h ('k') | src/compiler/js-inlining.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698