OLD | NEW |
1 // Copyright 2011 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 |
(...skipping 89 matching lines...) Loading... |
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 V(ALLOW_CODE_GEN_FROM_STRINGS_INDEX, Object, allow_code_gen_from_strings) \ |
| 111 V(DERIVED_GET_TRAP_INDEX, JSFunction, derived_get_trap) |
111 | 112 |
112 // JSFunctions are pairs (context, function code), sometimes also called | 113 // JSFunctions are pairs (context, function code), sometimes also called |
113 // closures. A Context object is used to represent function contexts and | 114 // closures. A Context object is used to represent function contexts and |
114 // dynamically pushed 'with' contexts (or 'scopes' in ECMA-262 speak). | 115 // dynamically pushed 'with' contexts (or 'scopes' in ECMA-262 speak). |
115 // | 116 // |
116 // At runtime, the contexts build a stack in parallel to the execution | 117 // At runtime, the contexts build a stack in parallel to the execution |
117 // stack, with the top-most context being the current context. All contexts | 118 // stack, with the top-most context being the current context. All contexts |
118 // have the following slots: | 119 // have the following slots: |
119 // | 120 // |
120 // [ closure ] This is the current function. It is the same for all | 121 // [ closure ] This is the current function. It is the same for all |
(...skipping 110 matching lines...) Loading... |
231 RUNTIME_CONTEXT_INDEX, | 232 RUNTIME_CONTEXT_INDEX, |
232 CALL_AS_FUNCTION_DELEGATE_INDEX, | 233 CALL_AS_FUNCTION_DELEGATE_INDEX, |
233 CALL_AS_CONSTRUCTOR_DELEGATE_INDEX, | 234 CALL_AS_CONSTRUCTOR_DELEGATE_INDEX, |
234 SCRIPT_FUNCTION_INDEX, | 235 SCRIPT_FUNCTION_INDEX, |
235 OPAQUE_REFERENCE_FUNCTION_INDEX, | 236 OPAQUE_REFERENCE_FUNCTION_INDEX, |
236 CONTEXT_EXTENSION_FUNCTION_INDEX, | 237 CONTEXT_EXTENSION_FUNCTION_INDEX, |
237 OUT_OF_MEMORY_INDEX, | 238 OUT_OF_MEMORY_INDEX, |
238 MAP_CACHE_INDEX, | 239 MAP_CACHE_INDEX, |
239 CONTEXT_DATA_INDEX, | 240 CONTEXT_DATA_INDEX, |
240 ALLOW_CODE_GEN_FROM_STRINGS_INDEX, | 241 ALLOW_CODE_GEN_FROM_STRINGS_INDEX, |
| 242 DERIVED_GET_TRAP_INDEX, |
241 | 243 |
242 // Properties from here are treated as weak references by the full GC. | 244 // Properties from here are treated as weak references by the full GC. |
243 // Scavenge treats them as strong references. | 245 // Scavenge treats them as strong references. |
244 OPTIMIZED_FUNCTIONS_LIST, // Weak. | 246 OPTIMIZED_FUNCTIONS_LIST, // Weak. |
245 NEXT_CONTEXT_LINK, // Weak. | 247 NEXT_CONTEXT_LINK, // Weak. |
246 | 248 |
247 // Total number of slots. | 249 // Total number of slots. |
248 GLOBAL_CONTEXT_SLOTS, | 250 GLOBAL_CONTEXT_SLOTS, |
249 | 251 |
250 FIRST_WEAK_SLOT = OPTIMIZED_FUNCTIONS_LIST | 252 FIRST_WEAK_SLOT = OPTIMIZED_FUNCTIONS_LIST |
(...skipping 129 matching lines...) Loading... |
380 #ifdef DEBUG | 382 #ifdef DEBUG |
381 // Bootstrapping-aware type checks. | 383 // Bootstrapping-aware type checks. |
382 static bool IsBootstrappingOrContext(Object* object); | 384 static bool IsBootstrappingOrContext(Object* object); |
383 static bool IsBootstrappingOrGlobalObject(Object* object); | 385 static bool IsBootstrappingOrGlobalObject(Object* object); |
384 #endif | 386 #endif |
385 }; | 387 }; |
386 | 388 |
387 } } // namespace v8::internal | 389 } } // namespace v8::internal |
388 | 390 |
389 #endif // V8_CONTEXTS_H_ | 391 #endif // V8_CONTEXTS_H_ |
OLD | NEW |