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

Unified Diff: src/contexts.h

Issue 477263002: ES6: Add support for method shorthand in object literals (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 4 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 63c9955b9791aa95b7d32b51e240d1774a489a19..29a6dc03c6ddef86d4b3a1cbf08c193e6ed84bc1 100644
--- a/src/contexts.h
+++ b/src/contexts.h
@@ -551,14 +551,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 (IsGeneratorFunction(kind)) {
+ return strict_mode == SLOPPY ? SLOPPY_GENERATOR_FUNCTION_MAP_INDEX
+ : STRICT_GENERATOR_FUNCTION_MAP_INDEX;
+ }
+
+ if (IsConciseMethod(kind)) {
+ 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;

Powered by Google App Engine
This is Rietveld 408576698