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

Unified Diff: src/factory.cc

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/execution.cc ('k') | src/full-codegen.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/factory.cc
diff --git a/src/factory.cc b/src/factory.cc
index 8226a0e5d7f0e92dfe4775a327fee2776b16a55e..7f6b81115875591cd320a3010902fee6bedf7110 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -1258,7 +1258,7 @@ Handle<JSFunction> Factory::NewFunction(Handle<Map> map,
MaybeHandle<Code> code) {
Handle<Context> context(isolate()->native_context());
Handle<SharedFunctionInfo> info = NewSharedFunctionInfo(name, code);
- DCHECK((info->strict_mode() == SLOPPY) &&
+ DCHECK(is_sloppy(info->language_mode()) &&
(map.is_identical_to(isolate()->sloppy_function_map()) ||
map.is_identical_to(
isolate()->sloppy_function_without_prototype_map()) ||
@@ -1369,7 +1369,8 @@ Handle<JSFunction> Factory::NewFunctionFromSharedFunctionInfo(
Handle<SharedFunctionInfo> info,
Handle<Context> context,
PretenureFlag pretenure) {
- int map_index = Context::FunctionMapIndex(info->strict_mode(), info->kind());
+ int map_index =
+ Context::FunctionMapIndex(info->language_mode(), info->kind());
Handle<Map> map(Map::cast(context->native_context()->get(map_index)));
Handle<JSFunction> result = NewFunction(map, info, context, pretenure);
@@ -2219,7 +2220,7 @@ Handle<DebugInfo> Factory::NewDebugInfo(Handle<SharedFunctionInfo> shared) {
Handle<JSObject> Factory::NewArgumentsObject(Handle<JSFunction> callee,
int length) {
- bool strict_mode_callee = callee->shared()->strict_mode() == STRICT;
+ bool strict_mode_callee = is_strict(callee->shared()->language_mode());
Handle<Map> map = strict_mode_callee ? isolate()->strict_arguments_map()
: isolate()->sloppy_arguments_map();
« no previous file with comments | « src/execution.cc ('k') | src/full-codegen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698