| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 V(MAKE_MESSAGE_FUN_INDEX, JSFunction, make_message_fun) \ | 88 V(MAKE_MESSAGE_FUN_INDEX, JSFunction, make_message_fun) \ |
| 89 V(GET_STACK_TRACE_LINE_INDEX, JSFunction, get_stack_trace_line_fun) \ | 89 V(GET_STACK_TRACE_LINE_INDEX, JSFunction, get_stack_trace_line_fun) \ |
| 90 V(CONFIGURE_GLOBAL_INDEX, JSFunction, configure_global_fun) \ | 90 V(CONFIGURE_GLOBAL_INDEX, JSFunction, configure_global_fun) \ |
| 91 V(FUNCTION_CACHE_INDEX, JSObject, function_cache) \ | 91 V(FUNCTION_CACHE_INDEX, JSObject, function_cache) \ |
| 92 V(RUNTIME_CONTEXT_INDEX, Context, runtime_context) \ | 92 V(RUNTIME_CONTEXT_INDEX, Context, runtime_context) \ |
| 93 V(CALL_AS_FUNCTION_DELEGATE_INDEX, JSFunction, call_as_function_delegate) \ | 93 V(CALL_AS_FUNCTION_DELEGATE_INDEX, JSFunction, call_as_function_delegate) \ |
| 94 V(CALL_AS_CONSTRUCTOR_DELEGATE_INDEX, JSFunction, \ | 94 V(CALL_AS_CONSTRUCTOR_DELEGATE_INDEX, JSFunction, \ |
| 95 call_as_constructor_delegate) \ | 95 call_as_constructor_delegate) \ |
| 96 V(EMPTY_SCRIPT_INDEX, Script, empty_script) \ | 96 V(EMPTY_SCRIPT_INDEX, Script, empty_script) \ |
| 97 V(SCRIPT_FUNCTION_INDEX, JSFunction, script_function) \ | 97 V(SCRIPT_FUNCTION_INDEX, JSFunction, script_function) \ |
| 98 V(OPAQUE_REFERENCE_FUNCTION_INDEX, JSFunction, opaque_reference_function) \ |
| 98 V(CONTEXT_EXTENSION_FUNCTION_INDEX, JSFunction, context_extension_function) \ | 99 V(CONTEXT_EXTENSION_FUNCTION_INDEX, JSFunction, context_extension_function) \ |
| 99 V(OUT_OF_MEMORY_INDEX, Object, out_of_memory) \ | 100 V(OUT_OF_MEMORY_INDEX, Object, out_of_memory) \ |
| 100 V(MAP_CACHE_INDEX, Object, map_cache) \ | 101 V(MAP_CACHE_INDEX, Object, map_cache) \ |
| 101 V(CONTEXT_DATA_INDEX, Object, data) | 102 V(CONTEXT_DATA_INDEX, Object, data) |
| 102 | 103 |
| 103 // JSFunctions are pairs (context, function code), sometimes also called | 104 // JSFunctions are pairs (context, function code), sometimes also called |
| 104 // closures. A Context object is used to represent function contexts and | 105 // closures. A Context object is used to represent function contexts and |
| 105 // dynamically pushed 'with' contexts (or 'scopes' in ECMA-262 speak). | 106 // dynamically pushed 'with' contexts (or 'scopes' in ECMA-262 speak). |
| 106 // | 107 // |
| 107 // At runtime, the contexts build a stack in parallel to the execution | 108 // At runtime, the contexts build a stack in parallel to the execution |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 MESSAGE_LISTENERS_INDEX, | 210 MESSAGE_LISTENERS_INDEX, |
| 210 MAKE_MESSAGE_FUN_INDEX, | 211 MAKE_MESSAGE_FUN_INDEX, |
| 211 GET_STACK_TRACE_LINE_INDEX, | 212 GET_STACK_TRACE_LINE_INDEX, |
| 212 CONFIGURE_GLOBAL_INDEX, | 213 CONFIGURE_GLOBAL_INDEX, |
| 213 FUNCTION_CACHE_INDEX, | 214 FUNCTION_CACHE_INDEX, |
| 214 RUNTIME_CONTEXT_INDEX, | 215 RUNTIME_CONTEXT_INDEX, |
| 215 CALL_AS_FUNCTION_DELEGATE_INDEX, | 216 CALL_AS_FUNCTION_DELEGATE_INDEX, |
| 216 CALL_AS_CONSTRUCTOR_DELEGATE_INDEX, | 217 CALL_AS_CONSTRUCTOR_DELEGATE_INDEX, |
| 217 EMPTY_SCRIPT_INDEX, | 218 EMPTY_SCRIPT_INDEX, |
| 218 SCRIPT_FUNCTION_INDEX, | 219 SCRIPT_FUNCTION_INDEX, |
| 220 OPAQUE_REFERENCE_FUNCTION_INDEX, |
| 219 CONTEXT_EXTENSION_FUNCTION_INDEX, | 221 CONTEXT_EXTENSION_FUNCTION_INDEX, |
| 220 OUT_OF_MEMORY_INDEX, | 222 OUT_OF_MEMORY_INDEX, |
| 221 MAP_CACHE_INDEX, | 223 MAP_CACHE_INDEX, |
| 222 CONTEXT_DATA_INDEX, | 224 CONTEXT_DATA_INDEX, |
| 223 GLOBAL_CONTEXT_SLOTS | 225 GLOBAL_CONTEXT_SLOTS |
| 224 }; | 226 }; |
| 225 | 227 |
| 226 // Direct slot access. | 228 // Direct slot access. |
| 227 JSFunction* closure() { return JSFunction::cast(get(CLOSURE_INDEX)); } | 229 JSFunction* closure() { return JSFunction::cast(get(CLOSURE_INDEX)); } |
| 228 void set_closure(JSFunction* closure) { set(CLOSURE_INDEX, closure); } | 230 void set_closure(JSFunction* closure) { set(CLOSURE_INDEX, closure); } |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 #ifdef DEBUG | 337 #ifdef DEBUG |
| 336 // Bootstrapping-aware type checks. | 338 // Bootstrapping-aware type checks. |
| 337 static bool IsBootstrappingOrContext(Object* object); | 339 static bool IsBootstrappingOrContext(Object* object); |
| 338 static bool IsBootstrappingOrGlobalObject(Object* object); | 340 static bool IsBootstrappingOrGlobalObject(Object* object); |
| 339 #endif | 341 #endif |
| 340 }; | 342 }; |
| 341 | 343 |
| 342 } } // namespace v8::internal | 344 } } // namespace v8::internal |
| 343 | 345 |
| 344 #endif // V8_CONTEXTS_H_ | 346 #endif // V8_CONTEXTS_H_ |
| OLD | NEW |