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

Unified Diff: src/contexts.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/compiler/js-operator.cc ('k') | src/elements.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/contexts.h
diff --git a/src/contexts.h b/src/contexts.h
index cd3ff1421177fa9e41b691c5b0030ae91b195dfc..6510925526a5c0281054f484fb769a4ba7ac812f 100644
--- a/src/contexts.h
+++ b/src/contexts.h
@@ -572,20 +572,20 @@ class Context: public FixedArray {
return kHeaderSize + index * kPointerSize - kHeapObjectTag;
}
- static int FunctionMapIndex(StrictMode strict_mode, FunctionKind kind) {
+ static int FunctionMapIndex(LanguageMode language_mode, FunctionKind kind) {
if (IsGeneratorFunction(kind)) {
- return strict_mode == SLOPPY ? SLOPPY_GENERATOR_FUNCTION_MAP_INDEX
- : STRICT_GENERATOR_FUNCTION_MAP_INDEX;
+ return is_strict(language_mode) ? STRICT_GENERATOR_FUNCTION_MAP_INDEX
+ : SLOPPY_GENERATOR_FUNCTION_MAP_INDEX;
}
if (IsArrowFunction(kind) || IsConciseMethod(kind)) {
- return strict_mode == SLOPPY
- ? SLOPPY_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX
- : STRICT_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX;
+ return is_strict(language_mode)
+ ? STRICT_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX
+ : SLOPPY_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX;
}
- return strict_mode == SLOPPY ? SLOPPY_FUNCTION_MAP_INDEX
- : STRICT_FUNCTION_MAP_INDEX;
+ return is_strict(language_mode) ? STRICT_FUNCTION_MAP_INDEX
+ : SLOPPY_FUNCTION_MAP_INDEX;
}
static const int kSize = kHeaderSize + NATIVE_CONTEXT_SLOTS * kPointerSize;
« no previous file with comments | « src/compiler/js-operator.cc ('k') | src/elements.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698