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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 V(OPAQUE_REFERENCE_FUNCTION_INDEX, JSFunction, opaque_reference_function) \ | 131 V(OPAQUE_REFERENCE_FUNCTION_INDEX, JSFunction, opaque_reference_function) \ |
132 V(CONTEXT_EXTENSION_FUNCTION_INDEX, JSFunction, context_extension_function) \ | 132 V(CONTEXT_EXTENSION_FUNCTION_INDEX, JSFunction, context_extension_function) \ |
133 V(OUT_OF_MEMORY_INDEX, Object, out_of_memory) \ | 133 V(OUT_OF_MEMORY_INDEX, Object, out_of_memory) \ |
134 V(MAP_CACHE_INDEX, Object, map_cache) \ | 134 V(MAP_CACHE_INDEX, Object, map_cache) \ |
135 V(CONTEXT_DATA_INDEX, Object, data) \ | 135 V(CONTEXT_DATA_INDEX, Object, data) \ |
136 V(ALLOW_CODE_GEN_FROM_STRINGS_INDEX, Object, allow_code_gen_from_strings) \ | 136 V(ALLOW_CODE_GEN_FROM_STRINGS_INDEX, Object, allow_code_gen_from_strings) \ |
137 V(TO_COMPLETE_PROPERTY_DESCRIPTOR_INDEX, JSFunction, \ | 137 V(TO_COMPLETE_PROPERTY_DESCRIPTOR_INDEX, JSFunction, \ |
138 to_complete_property_descriptor) \ | 138 to_complete_property_descriptor) \ |
139 V(DERIVED_HAS_TRAP_INDEX, JSFunction, derived_has_trap) \ | 139 V(DERIVED_HAS_TRAP_INDEX, JSFunction, derived_has_trap) \ |
140 V(DERIVED_GET_TRAP_INDEX, JSFunction, derived_get_trap) \ | 140 V(DERIVED_GET_TRAP_INDEX, JSFunction, derived_get_trap) \ |
141 V(DERIVED_SET_TRAP_INDEX, JSFunction, derived_set_trap) | 141 V(DERIVED_SET_TRAP_INDEX, JSFunction, derived_set_trap) \ |
| 142 V(RANDOM_SEED_INDEX, ByteArray, random_seed) |
142 | 143 |
143 // JSFunctions are pairs (context, function code), sometimes also called | 144 // JSFunctions are pairs (context, function code), sometimes also called |
144 // closures. A Context object is used to represent function contexts and | 145 // closures. A Context object is used to represent function contexts and |
145 // dynamically pushed 'with' contexts (or 'scopes' in ECMA-262 speak). | 146 // dynamically pushed 'with' contexts (or 'scopes' in ECMA-262 speak). |
146 // | 147 // |
147 // At runtime, the contexts build a stack in parallel to the execution | 148 // At runtime, the contexts build a stack in parallel to the execution |
148 // stack, with the top-most context being the current context. All contexts | 149 // stack, with the top-most context being the current context. All contexts |
149 // have the following slots: | 150 // have the following slots: |
150 // | 151 // |
151 // [ closure ] This is the current function. It is the same for all | 152 // [ closure ] This is the current function. It is the same for all |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 SCRIPT_FUNCTION_INDEX, | 252 SCRIPT_FUNCTION_INDEX, |
252 OPAQUE_REFERENCE_FUNCTION_INDEX, | 253 OPAQUE_REFERENCE_FUNCTION_INDEX, |
253 CONTEXT_EXTENSION_FUNCTION_INDEX, | 254 CONTEXT_EXTENSION_FUNCTION_INDEX, |
254 OUT_OF_MEMORY_INDEX, | 255 OUT_OF_MEMORY_INDEX, |
255 CONTEXT_DATA_INDEX, | 256 CONTEXT_DATA_INDEX, |
256 ALLOW_CODE_GEN_FROM_STRINGS_INDEX, | 257 ALLOW_CODE_GEN_FROM_STRINGS_INDEX, |
257 TO_COMPLETE_PROPERTY_DESCRIPTOR_INDEX, | 258 TO_COMPLETE_PROPERTY_DESCRIPTOR_INDEX, |
258 DERIVED_HAS_TRAP_INDEX, | 259 DERIVED_HAS_TRAP_INDEX, |
259 DERIVED_GET_TRAP_INDEX, | 260 DERIVED_GET_TRAP_INDEX, |
260 DERIVED_SET_TRAP_INDEX, | 261 DERIVED_SET_TRAP_INDEX, |
| 262 RANDOM_SEED_INDEX, |
261 | 263 |
262 // Properties from here are treated as weak references by the full GC. | 264 // Properties from here are treated as weak references by the full GC. |
263 // Scavenge treats them as strong references. | 265 // Scavenge treats them as strong references. |
264 OPTIMIZED_FUNCTIONS_LIST, // Weak. | 266 OPTIMIZED_FUNCTIONS_LIST, // Weak. |
265 MAP_CACHE_INDEX, // Weak. | 267 MAP_CACHE_INDEX, // Weak. |
266 NEXT_CONTEXT_LINK, // Weak. | 268 NEXT_CONTEXT_LINK, // Weak. |
267 | 269 |
268 // Total number of slots. | 270 // Total number of slots. |
269 GLOBAL_CONTEXT_SLOTS, | 271 GLOBAL_CONTEXT_SLOTS, |
270 | 272 |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 #ifdef DEBUG | 413 #ifdef DEBUG |
412 // Bootstrapping-aware type checks. | 414 // Bootstrapping-aware type checks. |
413 static bool IsBootstrappingOrContext(Object* object); | 415 static bool IsBootstrappingOrContext(Object* object); |
414 static bool IsBootstrappingOrGlobalObject(Object* object); | 416 static bool IsBootstrappingOrGlobalObject(Object* object); |
415 #endif | 417 #endif |
416 }; | 418 }; |
417 | 419 |
418 } } // namespace v8::internal | 420 } } // namespace v8::internal |
419 | 421 |
420 #endif // V8_CONTEXTS_H_ | 422 #endif // V8_CONTEXTS_H_ |
OLD | NEW |