Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(173)

Side by Side Diff: src/contexts.h

Issue 7060010: Merge bleeding edge into the GC branch up to 7948. The asserts (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/gc/
Patch Set: Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/compiler.cc ('k') | src/contexts.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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...) Expand 10 before | Expand all | Expand 10 after
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...) Expand 10 before | Expand all | Expand 10 after
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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 346
345 // Determine if a local variable with the given name exists in a 347 // Determine if a local variable with the given name exists in a
346 // context. Do not consider context extension objects. This is 348 // context. Do not consider context extension objects. This is
347 // used for compiling code using eval. If the context surrounding 349 // used for compiling code using eval. If the context surrounding
348 // the eval call does not have a local variable with this name and 350 // the eval call does not have a local variable with this name and
349 // does not contain a with statement the property is global unless 351 // does not contain a with statement the property is global unless
350 // it is shadowed by a property in an extension object introduced by 352 // it is shadowed by a property in an extension object introduced by
351 // eval. 353 // eval.
352 bool GlobalIfNotShadowedByEval(Handle<String> name); 354 bool GlobalIfNotShadowedByEval(Handle<String> name);
353 355
356 // Determine if any function scope in the context call eval and if
357 // any of those calls are in non-strict mode.
358 void ComputeEvalScopeInfo(bool* outer_scope_calls_eval,
359 bool* outer_scope_calls_non_strict_eval);
360
354 // Code generation support. 361 // Code generation support.
355 static int SlotOffset(int index) { 362 static int SlotOffset(int index) {
356 return kHeaderSize + index * kPointerSize - kHeapObjectTag; 363 return kHeaderSize + index * kPointerSize - kHeapObjectTag;
357 } 364 }
358 365
359 static const int kSize = kHeaderSize + GLOBAL_CONTEXT_SLOTS * kPointerSize; 366 static const int kSize = kHeaderSize + GLOBAL_CONTEXT_SLOTS * kPointerSize;
360 367
361 // GC support. 368 // GC support.
362 typedef FixedBodyDescriptor< 369 typedef FixedBodyDescriptor<
363 kHeaderSize, kSize, kSize> ScavengeBodyDescriptor; 370 kHeaderSize, kSize, kSize> ScavengeBodyDescriptor;
(...skipping 11 matching lines...) Expand all
375 #ifdef DEBUG 382 #ifdef DEBUG
376 // Bootstrapping-aware type checks. 383 // Bootstrapping-aware type checks.
377 static bool IsBootstrappingOrContext(Object* object); 384 static bool IsBootstrappingOrContext(Object* object);
378 static bool IsBootstrappingOrGlobalObject(Object* object); 385 static bool IsBootstrappingOrGlobalObject(Object* object);
379 #endif 386 #endif
380 }; 387 };
381 388
382 } } // namespace v8::internal 389 } } // namespace v8::internal
383 390
384 #endif // V8_CONTEXTS_H_ 391 #endif // V8_CONTEXTS_H_
OLDNEW
« no previous file with comments | « src/compiler.cc ('k') | src/contexts.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698