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

Unified Diff: src/contexts.h

Issue 13192004: arrange to create prototypes for generators (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Explicitly add constructor properties in generator.js Created 7 years, 8 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/code-stubs.h ('k') | src/factory.cc » ('j') | src/generator.js » ('J')
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 a0ba2f7eb5f577efed6e7da90a4f63dac0977d27..abeb8121cbf515cbf3ede188792fdc6306fcee77 100644
--- a/src/contexts.h
+++ b/src/contexts.h
@@ -165,6 +165,11 @@ enum BindingFlags {
V(PROXY_ENUMERATE_INDEX, JSFunction, proxy_enumerate) \
V(OBSERVERS_NOTIFY_CHANGE_INDEX, JSFunction, observers_notify_change) \
V(OBSERVERS_DELIVER_CHANGES_INDEX, JSFunction, observers_deliver_changes) \
+ V(GENERATOR_FUNCTION_MAP_INDEX, Map, generator_function_map) \
+ V(STRICT_MODE_GENERATOR_FUNCTION_MAP_INDEX, Map, \
+ strict_mode_generator_function_map) \
+ V(GENERATOR_OBJECT_PROTOTYPE_MAP_INDEX, Map, \
+ generator_object_prototype_map) \
V(RANDOM_SEED_INDEX, ByteArray, random_seed)
// JSFunctions are pairs (context, function code), sometimes also called
@@ -295,6 +300,9 @@ class Context: public FixedArray {
PROXY_ENUMERATE_INDEX,
OBSERVERS_NOTIFY_CHANGE_INDEX,
OBSERVERS_DELIVER_CHANGES_INDEX,
+ GENERATOR_FUNCTION_MAP_INDEX,
+ STRICT_MODE_GENERATOR_FUNCTION_MAP_INDEX,
+ GENERATOR_OBJECT_PROTOTYPE_MAP_INDEX,
RANDOM_SEED_INDEX,
// Properties from here are treated as weak references by the full GC.
@@ -439,6 +447,16 @@ class Context: public FixedArray {
return kHeaderSize + index * kPointerSize - kHeapObjectTag;
}
+ static int FunctionMapIndex(LanguageMode language_mode, bool is_generator) {
+ return is_generator
+ ? (language_mode == CLASSIC_MODE
+ ? GENERATOR_FUNCTION_MAP_INDEX
+ : STRICT_MODE_GENERATOR_FUNCTION_MAP_INDEX)
+ : (language_mode == CLASSIC_MODE
+ ? FUNCTION_MAP_INDEX
+ : STRICT_MODE_FUNCTION_MAP_INDEX);
+ }
+
static const int kSize = kHeaderSize + NATIVE_CONTEXT_SLOTS * kPointerSize;
// GC support.
« no previous file with comments | « src/code-stubs.h ('k') | src/factory.cc » ('j') | src/generator.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698