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

Unified Diff: src/contexts.h

Issue 1027283004: [es6] do not add caller/arguments to ES6 function definitions (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Remove unneeded bits Created 5 years, 9 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
Index: src/contexts.h
diff --git a/src/contexts.h b/src/contexts.h
index 3b4b7992c099bbc5f7393fc37d7fa5549284e119..a334fbecb1c2c13a88b8d2b8d94d26a036255608 100644
--- a/src/contexts.h
+++ b/src/contexts.h
@@ -122,12 +122,15 @@ enum BindingFlags {
uint8_clamped_array_external_map) \
V(DATA_VIEW_FUN_INDEX, JSFunction, data_view_fun) \
V(SLOPPY_FUNCTION_MAP_INDEX, Map, sloppy_function_map) \
+ V(PLAIN_FUNCTION_MAP_INDEX, Map, plain_function_map) \
V(SLOPPY_FUNCTION_WITH_READONLY_PROTOTYPE_MAP_INDEX, Map, \
sloppy_function_with_readonly_prototype_map) \
V(STRICT_FUNCTION_MAP_INDEX, Map, strict_function_map) \
V(STRONG_FUNCTION_MAP_INDEX, Map, strong_function_map) \
V(SLOPPY_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX, Map, \
sloppy_function_without_prototype_map) \
+ V(PLAIN_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX, Map, \
+ plain_function_without_prototype_map) \
V(STRICT_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX, Map, \
strict_function_without_prototype_map) \
V(STRONG_CONSTRUCTOR_MAP_INDEX, Map, strong_constructor_map) \
@@ -176,8 +179,7 @@ enum BindingFlags {
V(NATIVE_OBJECT_GET_NOTIFIER_INDEX, JSFunction, native_object_get_notifier) \
V(NATIVE_OBJECT_NOTIFIER_PERFORM_CHANGE, JSFunction, \
native_object_notifier_perform_change) \
- V(SLOPPY_GENERATOR_FUNCTION_MAP_INDEX, Map, sloppy_generator_function_map) \
- V(STRICT_GENERATOR_FUNCTION_MAP_INDEX, Map, strict_generator_function_map) \
+ V(GENERATOR_FUNCTION_MAP_INDEX, Map, generator_function_map) \
V(STRONG_GENERATOR_FUNCTION_MAP_INDEX, Map, strong_generator_function_map) \
V(GENERATOR_OBJECT_PROTOTYPE_MAP_INDEX, Map, generator_object_prototype_map) \
V(ITERATOR_RESULT_MAP_INDEX, Map, iterator_result_map) \
@@ -320,10 +322,12 @@ class Context: public FixedArray {
STRICT_ARGUMENTS_MAP_INDEX,
REGEXP_RESULT_MAP_INDEX,
SLOPPY_FUNCTION_MAP_INDEX,
+ PLAIN_FUNCTION_MAP_INDEX,
SLOPPY_FUNCTION_WITH_READONLY_PROTOTYPE_MAP_INDEX,
STRICT_FUNCTION_MAP_INDEX,
STRONG_FUNCTION_MAP_INDEX,
SLOPPY_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX,
+ PLAIN_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX,
STRICT_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX,
STRONG_CONSTRUCTOR_MAP_INDEX,
BOUND_FUNCTION_MAP_INDEX,
@@ -409,8 +413,7 @@ class Context: public FixedArray {
NATIVE_OBJECT_OBSERVE_INDEX,
NATIVE_OBJECT_GET_NOTIFIER_INDEX,
NATIVE_OBJECT_NOTIFIER_PERFORM_CHANGE,
- SLOPPY_GENERATOR_FUNCTION_MAP_INDEX,
- STRICT_GENERATOR_FUNCTION_MAP_INDEX,
+ GENERATOR_FUNCTION_MAP_INDEX,
STRONG_GENERATOR_FUNCTION_MAP_INDEX,
GENERATOR_OBJECT_PROTOTYPE_MAP_INDEX,
ITERATOR_RESULT_MAP_INDEX,
@@ -576,19 +579,22 @@ class Context: public FixedArray {
static int FunctionMapIndex(LanguageMode language_mode, FunctionKind kind) {
if (IsGeneratorFunction(kind)) {
- return is_strong(language_mode) ? STRONG_GENERATOR_FUNCTION_MAP_INDEX :
- is_strict(language_mode) ? STRICT_GENERATOR_FUNCTION_MAP_INDEX
- : SLOPPY_GENERATOR_FUNCTION_MAP_INDEX;
+ return is_strong(language_mode) ? STRONG_GENERATOR_FUNCTION_MAP_INDEX
+ : GENERATOR_FUNCTION_MAP_INDEX;
}
if (IsConstructor(kind)) {
- return is_strong(language_mode) ? STRONG_CONSTRUCTOR_MAP_INDEX :
- is_strict(language_mode) ? STRICT_FUNCTION_MAP_INDEX
- : SLOPPY_FUNCTION_MAP_INDEX;
+ return is_strong(language_mode) ? STRONG_CONSTRUCTOR_MAP_INDEX
+ : PLAIN_FUNCTION_MAP_INDEX;
}
- if (IsArrowFunction(kind) || IsConciseMethod(kind) ||
- IsAccessorFunction(kind)) {
+ if (IsArrowFunction(kind) || IsConciseMethod(kind)) {
+ return is_strong(language_mode)
+ ? STRONG_FUNCTION_MAP_INDEX
+ : PLAIN_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX;
+ }
+
+ if (IsAccessorFunction(kind)) {
return is_strong(language_mode) ? STRONG_FUNCTION_MAP_INDEX :
is_strict(language_mode) ?
STRICT_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX :

Powered by Google App Engine
This is Rietveld 408576698