Index: src/contexts.h |
diff --git a/src/contexts.h b/src/contexts.h |
index 63c9955b9791aa95b7d32b51e240d1774a489a19..976e9e0f66530a0218e601a93a4685425acc42c5 100644 |
--- a/src/contexts.h |
+++ b/src/contexts.h |
@@ -8,6 +8,7 @@ |
#include "src/heap/heap.h" |
#include "src/objects.h" |
+ |
namespace v8 { |
namespace internal { |
@@ -551,14 +552,20 @@ class Context: public FixedArray { |
return kHeaderSize + index * kPointerSize - kHeapObjectTag; |
} |
- static int FunctionMapIndex(StrictMode strict_mode, bool is_generator) { |
- return is_generator |
- ? (strict_mode == SLOPPY |
- ? SLOPPY_GENERATOR_FUNCTION_MAP_INDEX |
- : STRICT_GENERATOR_FUNCTION_MAP_INDEX) |
- : (strict_mode == SLOPPY |
- ? SLOPPY_FUNCTION_MAP_INDEX |
- : STRICT_FUNCTION_MAP_INDEX); |
+ static int FunctionMapIndex(StrictMode strict_mode, FunctionKind kind) { |
+ if (kind == FunctionKind::kGeneratorFunction) { |
+ return strict_mode == SLOPPY ? SLOPPY_GENERATOR_FUNCTION_MAP_INDEX |
+ : STRICT_GENERATOR_FUNCTION_MAP_INDEX; |
+ } |
+ |
+ if (kind == FunctionKind::kConciseMethod) { |
+ return strict_mode == SLOPPY |
+ ? SLOPPY_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX |
+ : STRICT_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX; |
+ } |
+ |
+ return strict_mode == SLOPPY ? SLOPPY_FUNCTION_MAP_INDEX |
+ : STRICT_FUNCTION_MAP_INDEX; |
} |
static const int kSize = kHeaderSize + NATIVE_CONTEXT_SLOTS * kPointerSize; |