OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
11 // with the distribution. | 11 // with the distribution. |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 V(NORMALIZED_MAP_CACHE_INDEX, NormalizedMapCache, normalized_map_cache) \ | 99 V(NORMALIZED_MAP_CACHE_INDEX, NormalizedMapCache, normalized_map_cache) \ |
100 V(RUNTIME_CONTEXT_INDEX, Context, runtime_context) \ | 100 V(RUNTIME_CONTEXT_INDEX, Context, runtime_context) \ |
101 V(CALL_AS_FUNCTION_DELEGATE_INDEX, JSFunction, call_as_function_delegate) \ | 101 V(CALL_AS_FUNCTION_DELEGATE_INDEX, JSFunction, call_as_function_delegate) \ |
102 V(CALL_AS_CONSTRUCTOR_DELEGATE_INDEX, JSFunction, \ | 102 V(CALL_AS_CONSTRUCTOR_DELEGATE_INDEX, JSFunction, \ |
103 call_as_constructor_delegate) \ | 103 call_as_constructor_delegate) \ |
104 V(SCRIPT_FUNCTION_INDEX, JSFunction, script_function) \ | 104 V(SCRIPT_FUNCTION_INDEX, JSFunction, script_function) \ |
105 V(OPAQUE_REFERENCE_FUNCTION_INDEX, JSFunction, opaque_reference_function) \ | 105 V(OPAQUE_REFERENCE_FUNCTION_INDEX, JSFunction, opaque_reference_function) \ |
106 V(CONTEXT_EXTENSION_FUNCTION_INDEX, JSFunction, context_extension_function) \ | 106 V(CONTEXT_EXTENSION_FUNCTION_INDEX, JSFunction, context_extension_function) \ |
107 V(OUT_OF_MEMORY_INDEX, Object, out_of_memory) \ | 107 V(OUT_OF_MEMORY_INDEX, Object, out_of_memory) \ |
108 V(MAP_CACHE_INDEX, Object, map_cache) \ | 108 V(MAP_CACHE_INDEX, Object, map_cache) \ |
109 V(CONTEXT_DATA_INDEX, Object, data) | 109 V(CONTEXT_DATA_INDEX, Object, data) \ |
| 110 V(ALLOW_CODE_GEN_FROM_STRINGS_INDEX, Object, allow_code_gen_from_strings) |
110 | 111 |
111 // JSFunctions are pairs (context, function code), sometimes also called | 112 // JSFunctions are pairs (context, function code), sometimes also called |
112 // closures. A Context object is used to represent function contexts and | 113 // closures. A Context object is used to represent function contexts and |
113 // dynamically pushed 'with' contexts (or 'scopes' in ECMA-262 speak). | 114 // dynamically pushed 'with' contexts (or 'scopes' in ECMA-262 speak). |
114 // | 115 // |
115 // At runtime, the contexts build a stack in parallel to the execution | 116 // At runtime, the contexts build a stack in parallel to the execution |
116 // stack, with the top-most context being the current context. All contexts | 117 // stack, with the top-most context being the current context. All contexts |
117 // have the following slots: | 118 // have the following slots: |
118 // | 119 // |
119 // [ closure ] This is the current function. It is the same for all | 120 // [ closure ] This is the current function. It is the same for all |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 NORMALIZED_MAP_CACHE_INDEX, | 230 NORMALIZED_MAP_CACHE_INDEX, |
230 RUNTIME_CONTEXT_INDEX, | 231 RUNTIME_CONTEXT_INDEX, |
231 CALL_AS_FUNCTION_DELEGATE_INDEX, | 232 CALL_AS_FUNCTION_DELEGATE_INDEX, |
232 CALL_AS_CONSTRUCTOR_DELEGATE_INDEX, | 233 CALL_AS_CONSTRUCTOR_DELEGATE_INDEX, |
233 SCRIPT_FUNCTION_INDEX, | 234 SCRIPT_FUNCTION_INDEX, |
234 OPAQUE_REFERENCE_FUNCTION_INDEX, | 235 OPAQUE_REFERENCE_FUNCTION_INDEX, |
235 CONTEXT_EXTENSION_FUNCTION_INDEX, | 236 CONTEXT_EXTENSION_FUNCTION_INDEX, |
236 OUT_OF_MEMORY_INDEX, | 237 OUT_OF_MEMORY_INDEX, |
237 MAP_CACHE_INDEX, | 238 MAP_CACHE_INDEX, |
238 CONTEXT_DATA_INDEX, | 239 CONTEXT_DATA_INDEX, |
| 240 ALLOW_CODE_GEN_FROM_STRINGS_INDEX, |
239 | 241 |
240 // Properties from here are treated as weak references by the full GC. | 242 // Properties from here are treated as weak references by the full GC. |
241 // Scavenge treats them as strong references. | 243 // Scavenge treats them as strong references. |
242 OPTIMIZED_FUNCTIONS_LIST, // Weak. | 244 OPTIMIZED_FUNCTIONS_LIST, // Weak. |
243 NEXT_CONTEXT_LINK, // Weak. | 245 NEXT_CONTEXT_LINK, // Weak. |
244 | 246 |
245 // Total number of slots. | 247 // Total number of slots. |
246 GLOBAL_CONTEXT_SLOTS, | 248 GLOBAL_CONTEXT_SLOTS, |
247 | 249 |
248 FIRST_WEAK_SLOT = OPTIMIZED_FUNCTIONS_LIST | 250 FIRST_WEAK_SLOT = OPTIMIZED_FUNCTIONS_LIST |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 #ifdef DEBUG | 375 #ifdef DEBUG |
374 // Bootstrapping-aware type checks. | 376 // Bootstrapping-aware type checks. |
375 static bool IsBootstrappingOrContext(Object* object); | 377 static bool IsBootstrappingOrContext(Object* object); |
376 static bool IsBootstrappingOrGlobalObject(Object* object); | 378 static bool IsBootstrappingOrGlobalObject(Object* object); |
377 #endif | 379 #endif |
378 }; | 380 }; |
379 | 381 |
380 } } // namespace v8::internal | 382 } } // namespace v8::internal |
381 | 383 |
382 #endif // V8_CONTEXTS_H_ | 384 #endif // V8_CONTEXTS_H_ |
OLD | NEW |