OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 V(CALL_AS_FUNCTION_DELEGATE_INDEX, JSFunction, call_as_function_delegate) \ | 147 V(CALL_AS_FUNCTION_DELEGATE_INDEX, JSFunction, call_as_function_delegate) \ |
148 V(CALL_AS_CONSTRUCTOR_DELEGATE_INDEX, JSFunction, \ | 148 V(CALL_AS_CONSTRUCTOR_DELEGATE_INDEX, JSFunction, \ |
149 call_as_constructor_delegate) \ | 149 call_as_constructor_delegate) \ |
150 V(SCRIPT_FUNCTION_INDEX, JSFunction, script_function) \ | 150 V(SCRIPT_FUNCTION_INDEX, JSFunction, script_function) \ |
151 V(OPAQUE_REFERENCE_FUNCTION_INDEX, JSFunction, opaque_reference_function) \ | 151 V(OPAQUE_REFERENCE_FUNCTION_INDEX, JSFunction, opaque_reference_function) \ |
152 V(CONTEXT_EXTENSION_FUNCTION_INDEX, JSFunction, context_extension_function) \ | 152 V(CONTEXT_EXTENSION_FUNCTION_INDEX, JSFunction, context_extension_function) \ |
153 V(OUT_OF_MEMORY_INDEX, Object, out_of_memory) \ | 153 V(OUT_OF_MEMORY_INDEX, Object, out_of_memory) \ |
154 V(MAP_CACHE_INDEX, Object, map_cache) \ | 154 V(MAP_CACHE_INDEX, Object, map_cache) \ |
155 V(CONTEXT_DATA_INDEX, Object, data) \ | 155 V(CONTEXT_DATA_INDEX, Object, data) \ |
156 V(ALLOW_CODE_GEN_FROM_STRINGS_INDEX, Object, allow_code_gen_from_strings) \ | 156 V(ALLOW_CODE_GEN_FROM_STRINGS_INDEX, Object, allow_code_gen_from_strings) \ |
157 V(ERROR_MESSAGE_FOR_CODE_GEN_FROM_STRINGS_INDEX, Object, \ | |
158 error_message_for_code_gen_from_strings) \ | |
159 V(TO_COMPLETE_PROPERTY_DESCRIPTOR_INDEX, JSFunction, \ | 157 V(TO_COMPLETE_PROPERTY_DESCRIPTOR_INDEX, JSFunction, \ |
160 to_complete_property_descriptor) \ | 158 to_complete_property_descriptor) \ |
161 V(DERIVED_HAS_TRAP_INDEX, JSFunction, derived_has_trap) \ | 159 V(DERIVED_HAS_TRAP_INDEX, JSFunction, derived_has_trap) \ |
162 V(DERIVED_GET_TRAP_INDEX, JSFunction, derived_get_trap) \ | 160 V(DERIVED_GET_TRAP_INDEX, JSFunction, derived_get_trap) \ |
163 V(DERIVED_SET_TRAP_INDEX, JSFunction, derived_set_trap) \ | 161 V(DERIVED_SET_TRAP_INDEX, JSFunction, derived_set_trap) \ |
164 V(PROXY_ENUMERATE, JSFunction, proxy_enumerate) \ | 162 V(PROXY_ENUMERATE, JSFunction, proxy_enumerate) \ |
165 V(RANDOM_SEED_INDEX, ByteArray, random_seed) | 163 V(RANDOM_SEED_INDEX, ByteArray, random_seed) |
166 | 164 |
167 // JSFunctions are pairs (context, function code), sometimes also called | 165 // JSFunctions are pairs (context, function code), sometimes also called |
168 // closures. A Context object is used to represent function contexts and | 166 // closures. A Context object is used to represent function contexts and |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 NORMALIZED_MAP_CACHE_INDEX, | 274 NORMALIZED_MAP_CACHE_INDEX, |
277 RUNTIME_CONTEXT_INDEX, | 275 RUNTIME_CONTEXT_INDEX, |
278 CALL_AS_FUNCTION_DELEGATE_INDEX, | 276 CALL_AS_FUNCTION_DELEGATE_INDEX, |
279 CALL_AS_CONSTRUCTOR_DELEGATE_INDEX, | 277 CALL_AS_CONSTRUCTOR_DELEGATE_INDEX, |
280 SCRIPT_FUNCTION_INDEX, | 278 SCRIPT_FUNCTION_INDEX, |
281 OPAQUE_REFERENCE_FUNCTION_INDEX, | 279 OPAQUE_REFERENCE_FUNCTION_INDEX, |
282 CONTEXT_EXTENSION_FUNCTION_INDEX, | 280 CONTEXT_EXTENSION_FUNCTION_INDEX, |
283 OUT_OF_MEMORY_INDEX, | 281 OUT_OF_MEMORY_INDEX, |
284 CONTEXT_DATA_INDEX, | 282 CONTEXT_DATA_INDEX, |
285 ALLOW_CODE_GEN_FROM_STRINGS_INDEX, | 283 ALLOW_CODE_GEN_FROM_STRINGS_INDEX, |
286 ERROR_MESSAGE_FOR_CODE_GEN_FROM_STRINGS_INDEX, | |
287 TO_COMPLETE_PROPERTY_DESCRIPTOR_INDEX, | 284 TO_COMPLETE_PROPERTY_DESCRIPTOR_INDEX, |
288 DERIVED_HAS_TRAP_INDEX, | 285 DERIVED_HAS_TRAP_INDEX, |
289 DERIVED_GET_TRAP_INDEX, | 286 DERIVED_GET_TRAP_INDEX, |
290 DERIVED_SET_TRAP_INDEX, | 287 DERIVED_SET_TRAP_INDEX, |
291 PROXY_ENUMERATE, | 288 PROXY_ENUMERATE, |
292 RANDOM_SEED_INDEX, | 289 RANDOM_SEED_INDEX, |
293 | 290 |
294 // Properties from here are treated as weak references by the full GC. | 291 // Properties from here are treated as weak references by the full GC. |
295 // Scavenge treats them as strong references. | 292 // Scavenge treats them as strong references. |
296 OPTIMIZED_FUNCTIONS_LIST, // Weak. | 293 OPTIMIZED_FUNCTIONS_LIST, // Weak. |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 | 374 |
378 // Mark the native context with out of memory. | 375 // Mark the native context with out of memory. |
379 inline void mark_out_of_memory(); | 376 inline void mark_out_of_memory(); |
380 | 377 |
381 // A native context hold a list of all functions which have been optimized. | 378 // A native context hold a list of all functions which have been optimized. |
382 void AddOptimizedFunction(JSFunction* function); | 379 void AddOptimizedFunction(JSFunction* function); |
383 void RemoveOptimizedFunction(JSFunction* function); | 380 void RemoveOptimizedFunction(JSFunction* function); |
384 Object* OptimizedFunctionsListHead(); | 381 Object* OptimizedFunctionsListHead(); |
385 void ClearOptimizedFunctions(); | 382 void ClearOptimizedFunctions(); |
386 | 383 |
387 Handle<Object> ErrorMessageForCodeGenerationFromStrings(); | |
388 | |
389 #define NATIVE_CONTEXT_FIELD_ACCESSORS(index, type, name) \ | 384 #define NATIVE_CONTEXT_FIELD_ACCESSORS(index, type, name) \ |
390 void set_##name(type* value) { \ | 385 void set_##name(type* value) { \ |
391 ASSERT(IsNativeContext()); \ | 386 ASSERT(IsNativeContext()); \ |
392 set(index, value); \ | 387 set(index, value); \ |
393 } \ | 388 } \ |
394 type* name() { \ | 389 type* name() { \ |
395 ASSERT(IsNativeContext()); \ | 390 ASSERT(IsNativeContext()); \ |
396 return type::cast(get(index)); \ | 391 return type::cast(get(index)); \ |
397 } | 392 } |
398 NATIVE_CONTEXT_FIELDS(NATIVE_CONTEXT_FIELD_ACCESSORS) | 393 NATIVE_CONTEXT_FIELDS(NATIVE_CONTEXT_FIELD_ACCESSORS) |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
444 #ifdef DEBUG | 439 #ifdef DEBUG |
445 // Bootstrapping-aware type checks. | 440 // Bootstrapping-aware type checks. |
446 static bool IsBootstrappingOrValidParentContext(Object* object, Context* kid); | 441 static bool IsBootstrappingOrValidParentContext(Object* object, Context* kid); |
447 static bool IsBootstrappingOrGlobalObject(Object* object); | 442 static bool IsBootstrappingOrGlobalObject(Object* object); |
448 #endif | 443 #endif |
449 }; | 444 }; |
450 | 445 |
451 } } // namespace v8::internal | 446 } } // namespace v8::internal |
452 | 447 |
453 #endif // V8_CONTEXTS_H_ | 448 #endif // V8_CONTEXTS_H_ |
OLD | NEW |