Index: src/contexts.h |
diff --git a/src/contexts.h b/src/contexts.h |
index 102d997fdf93db6151b197a2466025c79229f0a0..d8ecdc70339c14f66d9a88d647b888ffe4116603 100644 |
--- a/src/contexts.h |
+++ b/src/contexts.h |
@@ -369,6 +369,18 @@ class Context: public FixedArray { |
Object* OptimizedFunctionsListHead(); |
void ClearOptimizedFunctions(); |
+ static int GetContextMapIndexFromElementsKind( |
+ ElementsKind elements_kind) { |
+ if (elements_kind == FAST_DOUBLE_ELEMENTS) { |
+ return Context::DOUBLE_JS_ARRAY_MAP_INDEX; |
+ } else if (elements_kind == FAST_ELEMENTS) { |
+ return Context::OBJECT_JS_ARRAY_MAP_INDEX; |
+ } else { |
+ ASSERT(elements_kind == FAST_SMI_ONLY_ELEMENTS); |
+ return SMI_JS_ARRAY_MAP_INDEX; |
Michael Starzinger
2012/02/01 08:53:26
Can we prefix this with "Context::" as well for cl
danno
2012/02/06 14:13:14
Done.
|
+ } |
+ } |
+ |
#define GLOBAL_CONTEXT_FIELD_ACCESSORS(index, type, name) \ |
void set_##name(type* value) { \ |
ASSERT(IsGlobalContext()); \ |