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

Side by Side Diff: src/objects.h

Issue 502100: When promoting objects during a copying collection, promote all... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years 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/heap-inl.h ('k') | src/objects-debug.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 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 }; 197 };
198 198
199 199
200 // All Maps have a field instance_type containing a InstanceType. 200 // All Maps have a field instance_type containing a InstanceType.
201 // It describes the type of the instances. 201 // It describes the type of the instances.
202 // 202 //
203 // As an example, a JavaScript object is a heap object and its map 203 // As an example, a JavaScript object is a heap object and its map
204 // instance_type is JS_OBJECT_TYPE. 204 // instance_type is JS_OBJECT_TYPE.
205 // 205 //
206 // The names of the string instance types are intended to systematically 206 // The names of the string instance types are intended to systematically
207 // mirror their encoding in the instance_type field of the map. The length 207 // mirror their encoding in the instance_type field of the map. The default
208 // (SHORT, MEDIUM, or LONG) is always mentioned. The default encoding is 208 // encoding is considered TWO_BYTE. It is not mentioned in the name. ASCII
209 // considered TWO_BYTE. It is not mentioned in the name. ASCII encoding is 209 // encoding is mentioned explicitly in the name. Likewise, the default
210 // mentioned explicitly in the name. Likewise, the default representation is 210 // representation is considered sequential. It is not mentioned in the
211 // considered sequential. It is not mentioned in the name. The other 211 // name. The other representations (eg, CONS, EXTERNAL) are explicitly
212 // representations (eg, CONS, EXTERNAL) are explicitly mentioned. 212 // mentioned. Finally, the string is either a SYMBOL_TYPE (if it is a
213 // Finally, the string is either a SYMBOL_TYPE (if it is a symbol) or a 213 // symbol) or a STRING_TYPE (if it is not a symbol).
214 // STRING_TYPE (if it is not a symbol).
215 // 214 //
216 // NOTE: The following things are some that depend on the string types having 215 // NOTE: The following things are some that depend on the string types having
217 // instance_types that are less than those of all other types: 216 // instance_types that are less than those of all other types:
218 // HeapObject::Size, HeapObject::IterateBody, the typeof operator, and 217 // HeapObject::Size, HeapObject::IterateBody, the typeof operator, and
219 // Object::IsString. 218 // Object::IsString.
220 // 219 //
221 // NOTE: Everything following JS_VALUE_TYPE is considered a 220 // NOTE: Everything following JS_VALUE_TYPE is considered a
222 // JSObject for GC purposes. The first four entries here have typeof 221 // JSObject for GC purposes. The first four entries here have typeof
223 // 'object', whereas JS_FUNCTION_TYPE has typeof 'function'. 222 // 'object', whereas JS_FUNCTION_TYPE has typeof 'function'.
224 #define INSTANCE_TYPE_LIST_ALL(V) \ 223 #define INSTANCE_TYPE_LIST_ALL(V) \
225 V(SYMBOL_TYPE) \ 224 V(SYMBOL_TYPE) \
226 V(ASCII_SYMBOL_TYPE) \ 225 V(ASCII_SYMBOL_TYPE) \
227 V(CONS_SYMBOL_TYPE) \ 226 V(CONS_SYMBOL_TYPE) \
228 V(CONS_ASCII_SYMBOL_TYPE) \ 227 V(CONS_ASCII_SYMBOL_TYPE) \
229 V(EXTERNAL_SYMBOL_TYPE) \ 228 V(EXTERNAL_SYMBOL_TYPE) \
230 V(EXTERNAL_ASCII_SYMBOL_TYPE) \ 229 V(EXTERNAL_ASCII_SYMBOL_TYPE) \
231 V(STRING_TYPE) \ 230 V(STRING_TYPE) \
232 V(ASCII_STRING_TYPE) \ 231 V(ASCII_STRING_TYPE) \
233 V(CONS_STRING_TYPE) \ 232 V(CONS_STRING_TYPE) \
234 V(CONS_ASCII_STRING_TYPE) \ 233 V(CONS_ASCII_STRING_TYPE) \
235 V(EXTERNAL_STRING_TYPE) \ 234 V(EXTERNAL_STRING_TYPE) \
236 V(EXTERNAL_ASCII_STRING_TYPE) \ 235 V(EXTERNAL_ASCII_STRING_TYPE) \
237 V(PRIVATE_EXTERNAL_ASCII_STRING_TYPE) \ 236 V(PRIVATE_EXTERNAL_ASCII_STRING_TYPE) \
238 \ 237 \
239 V(MAP_TYPE) \ 238 V(MAP_TYPE) \
240 V(HEAP_NUMBER_TYPE) \
241 V(FIXED_ARRAY_TYPE) \
242 V(CODE_TYPE) \ 239 V(CODE_TYPE) \
243 V(JS_GLOBAL_PROPERTY_CELL_TYPE) \ 240 V(JS_GLOBAL_PROPERTY_CELL_TYPE) \
244 V(ODDBALL_TYPE) \ 241 V(ODDBALL_TYPE) \
242 \
243 V(HEAP_NUMBER_TYPE) \
245 V(PROXY_TYPE) \ 244 V(PROXY_TYPE) \
246 V(BYTE_ARRAY_TYPE) \ 245 V(BYTE_ARRAY_TYPE) \
247 V(PIXEL_ARRAY_TYPE) \ 246 V(PIXEL_ARRAY_TYPE) \
248 /* Note: the order of these external array */ \ 247 /* Note: the order of these external array */ \
249 /* types is relied upon in */ \ 248 /* types is relied upon in */ \
250 /* Object::IsExternalArray(). */ \ 249 /* Object::IsExternalArray(). */ \
251 V(EXTERNAL_BYTE_ARRAY_TYPE) \ 250 V(EXTERNAL_BYTE_ARRAY_TYPE) \
252 V(EXTERNAL_UNSIGNED_BYTE_ARRAY_TYPE) \ 251 V(EXTERNAL_UNSIGNED_BYTE_ARRAY_TYPE) \
253 V(EXTERNAL_SHORT_ARRAY_TYPE) \ 252 V(EXTERNAL_SHORT_ARRAY_TYPE) \
254 V(EXTERNAL_UNSIGNED_SHORT_ARRAY_TYPE) \ 253 V(EXTERNAL_UNSIGNED_SHORT_ARRAY_TYPE) \
255 V(EXTERNAL_INT_ARRAY_TYPE) \ 254 V(EXTERNAL_INT_ARRAY_TYPE) \
256 V(EXTERNAL_UNSIGNED_INT_ARRAY_TYPE) \ 255 V(EXTERNAL_UNSIGNED_INT_ARRAY_TYPE) \
257 V(EXTERNAL_FLOAT_ARRAY_TYPE) \ 256 V(EXTERNAL_FLOAT_ARRAY_TYPE) \
258 V(FILLER_TYPE) \ 257 V(FILLER_TYPE) \
259 \ 258 \
259 V(FIXED_ARRAY_TYPE) \
260 V(ACCESSOR_INFO_TYPE) \ 260 V(ACCESSOR_INFO_TYPE) \
261 V(ACCESS_CHECK_INFO_TYPE) \ 261 V(ACCESS_CHECK_INFO_TYPE) \
262 V(INTERCEPTOR_INFO_TYPE) \ 262 V(INTERCEPTOR_INFO_TYPE) \
263 V(SHARED_FUNCTION_INFO_TYPE) \ 263 V(SHARED_FUNCTION_INFO_TYPE) \
264 V(CALL_HANDLER_INFO_TYPE) \ 264 V(CALL_HANDLER_INFO_TYPE) \
265 V(FUNCTION_TEMPLATE_INFO_TYPE) \ 265 V(FUNCTION_TEMPLATE_INFO_TYPE) \
266 V(OBJECT_TEMPLATE_INFO_TYPE) \ 266 V(OBJECT_TEMPLATE_INFO_TYPE) \
267 V(SIGNATURE_INFO_TYPE) \ 267 V(SIGNATURE_INFO_TYPE) \
268 V(TYPE_SWITCH_INFO_TYPE) \ 268 V(TYPE_SWITCH_INFO_TYPE) \
269 V(SCRIPT_TYPE) \ 269 V(SCRIPT_TYPE) \
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 // shortcut them thereby avoiding turning symbols into strings. See 411 // shortcut them thereby avoiding turning symbols into strings. See
412 // heap.cc and mark-compact.cc. 412 // heap.cc and mark-compact.cc.
413 const uint32_t kShortcutTypeMask = 413 const uint32_t kShortcutTypeMask =
414 kIsNotStringMask | 414 kIsNotStringMask |
415 kIsSymbolMask | 415 kIsSymbolMask |
416 kStringRepresentationMask; 416 kStringRepresentationMask;
417 const uint32_t kShortcutTypeTag = kConsStringTag; 417 const uint32_t kShortcutTypeTag = kConsStringTag;
418 418
419 419
420 enum InstanceType { 420 enum InstanceType {
421 // String types.
421 SYMBOL_TYPE = kSymbolTag | kSeqStringTag, 422 SYMBOL_TYPE = kSymbolTag | kSeqStringTag,
422 ASCII_SYMBOL_TYPE = kAsciiStringTag | kSymbolTag | kSeqStringTag, 423 ASCII_SYMBOL_TYPE = kAsciiStringTag | kSymbolTag | kSeqStringTag,
423 CONS_SYMBOL_TYPE = kSymbolTag | kConsStringTag, 424 CONS_SYMBOL_TYPE = kSymbolTag | kConsStringTag,
424 CONS_ASCII_SYMBOL_TYPE = kAsciiStringTag | kSymbolTag | kConsStringTag, 425 CONS_ASCII_SYMBOL_TYPE = kAsciiStringTag | kSymbolTag | kConsStringTag,
425 EXTERNAL_SYMBOL_TYPE = kSymbolTag | kExternalStringTag, 426 EXTERNAL_SYMBOL_TYPE = kSymbolTag | kExternalStringTag,
426 EXTERNAL_ASCII_SYMBOL_TYPE = 427 EXTERNAL_ASCII_SYMBOL_TYPE =
427 kAsciiStringTag | kSymbolTag | kExternalStringTag, 428 kAsciiStringTag | kSymbolTag | kExternalStringTag,
428 STRING_TYPE = kSeqStringTag, 429 STRING_TYPE = kSeqStringTag,
429 ASCII_STRING_TYPE = kAsciiStringTag | kSeqStringTag, 430 ASCII_STRING_TYPE = kAsciiStringTag | kSeqStringTag,
430 CONS_STRING_TYPE = kConsStringTag, 431 CONS_STRING_TYPE = kConsStringTag,
431 CONS_ASCII_STRING_TYPE = kAsciiStringTag | kConsStringTag, 432 CONS_ASCII_STRING_TYPE = kAsciiStringTag | kConsStringTag,
432 EXTERNAL_STRING_TYPE = kExternalStringTag, 433 EXTERNAL_STRING_TYPE = kExternalStringTag,
433 EXTERNAL_ASCII_STRING_TYPE = kAsciiStringTag | kExternalStringTag, 434 EXTERNAL_ASCII_STRING_TYPE = kAsciiStringTag | kExternalStringTag,
434 PRIVATE_EXTERNAL_ASCII_STRING_TYPE = EXTERNAL_ASCII_STRING_TYPE, 435 PRIVATE_EXTERNAL_ASCII_STRING_TYPE = EXTERNAL_ASCII_STRING_TYPE,
435 436
436 MAP_TYPE = kNotStringTag, 437 // Objects allocated in their own spaces (never in new space).
437 HEAP_NUMBER_TYPE, 438 MAP_TYPE = kNotStringTag, // FIRST_NONSTRING_TYPE
438 FIXED_ARRAY_TYPE,
439 CODE_TYPE, 439 CODE_TYPE,
440 ODDBALL_TYPE, 440 ODDBALL_TYPE,
441 JS_GLOBAL_PROPERTY_CELL_TYPE, 441 JS_GLOBAL_PROPERTY_CELL_TYPE,
442
443 // "Data", objects that cannot contain non-map-word pointers to heap
444 // objects.
445 HEAP_NUMBER_TYPE,
442 PROXY_TYPE, 446 PROXY_TYPE,
443 BYTE_ARRAY_TYPE, 447 BYTE_ARRAY_TYPE,
444 PIXEL_ARRAY_TYPE, 448 PIXEL_ARRAY_TYPE,
445 EXTERNAL_BYTE_ARRAY_TYPE, 449 EXTERNAL_BYTE_ARRAY_TYPE, // FIRST_EXTERNAL_ARRAY_TYPE
446 EXTERNAL_UNSIGNED_BYTE_ARRAY_TYPE, 450 EXTERNAL_UNSIGNED_BYTE_ARRAY_TYPE,
447 EXTERNAL_SHORT_ARRAY_TYPE, 451 EXTERNAL_SHORT_ARRAY_TYPE,
448 EXTERNAL_UNSIGNED_SHORT_ARRAY_TYPE, 452 EXTERNAL_UNSIGNED_SHORT_ARRAY_TYPE,
449 EXTERNAL_INT_ARRAY_TYPE, 453 EXTERNAL_INT_ARRAY_TYPE,
450 EXTERNAL_UNSIGNED_INT_ARRAY_TYPE, 454 EXTERNAL_UNSIGNED_INT_ARRAY_TYPE,
451 EXTERNAL_FLOAT_ARRAY_TYPE, 455 EXTERNAL_FLOAT_ARRAY_TYPE, // LAST_EXTERNAL_ARRAY_TYPE
452 FILLER_TYPE, 456 FILLER_TYPE, // LAST_DATA_TYPE
453 SMI_TYPE,
454 457
458 // Structs.
455 ACCESSOR_INFO_TYPE, 459 ACCESSOR_INFO_TYPE,
456 ACCESS_CHECK_INFO_TYPE, 460 ACCESS_CHECK_INFO_TYPE,
457 INTERCEPTOR_INFO_TYPE, 461 INTERCEPTOR_INFO_TYPE,
458 SHARED_FUNCTION_INFO_TYPE,
459 CALL_HANDLER_INFO_TYPE, 462 CALL_HANDLER_INFO_TYPE,
460 FUNCTION_TEMPLATE_INFO_TYPE, 463 FUNCTION_TEMPLATE_INFO_TYPE,
461 OBJECT_TEMPLATE_INFO_TYPE, 464 OBJECT_TEMPLATE_INFO_TYPE,
462 SIGNATURE_INFO_TYPE, 465 SIGNATURE_INFO_TYPE,
463 TYPE_SWITCH_INFO_TYPE, 466 TYPE_SWITCH_INFO_TYPE,
467 SCRIPT_TYPE,
464 #ifdef ENABLE_DEBUGGER_SUPPORT 468 #ifdef ENABLE_DEBUGGER_SUPPORT
465 DEBUG_INFO_TYPE, 469 DEBUG_INFO_TYPE,
466 BREAK_POINT_INFO_TYPE, 470 BREAK_POINT_INFO_TYPE,
467 #endif 471 #endif
468 SCRIPT_TYPE,
469 472
470 JS_VALUE_TYPE, 473 FIXED_ARRAY_TYPE,
474 SHARED_FUNCTION_INFO_TYPE,
475
476 JS_VALUE_TYPE, // FIRST_JS_OBJECT_TYPE
471 JS_OBJECT_TYPE, 477 JS_OBJECT_TYPE,
472 JS_CONTEXT_EXTENSION_OBJECT_TYPE, 478 JS_CONTEXT_EXTENSION_OBJECT_TYPE,
473 JS_GLOBAL_OBJECT_TYPE, 479 JS_GLOBAL_OBJECT_TYPE,
474 JS_BUILTINS_OBJECT_TYPE, 480 JS_BUILTINS_OBJECT_TYPE,
475 JS_GLOBAL_PROXY_TYPE, 481 JS_GLOBAL_PROXY_TYPE,
476 JS_ARRAY_TYPE, 482 JS_ARRAY_TYPE,
477 JS_REGEXP_TYPE, 483 JS_REGEXP_TYPE, // LAST_JS_OBJECT_TYPE
478 484
479 JS_FUNCTION_TYPE, 485 JS_FUNCTION_TYPE,
480 486
481 // Pseudo-types 487 // Pseudo-types
488 FIRST_TYPE = 0x0,
489 LAST_TYPE = JS_FUNCTION_TYPE,
490 INVALID_TYPE = FIRST_TYPE - 1,
482 FIRST_NONSTRING_TYPE = MAP_TYPE, 491 FIRST_NONSTRING_TYPE = MAP_TYPE,
483 FIRST_TYPE = 0x0, 492 // Boundaries for testing for an external array.
484 INVALID_TYPE = FIRST_TYPE - 1, 493 FIRST_EXTERNAL_ARRAY_TYPE = EXTERNAL_BYTE_ARRAY_TYPE,
485 LAST_TYPE = JS_FUNCTION_TYPE, 494 LAST_EXTERNAL_ARRAY_TYPE = EXTERNAL_FLOAT_ARRAY_TYPE,
495 // Boundary for promotion to old data space/old pointer space.
496 LAST_DATA_TYPE = FILLER_TYPE,
486 // Boundaries for testing the type is a JavaScript "object". Note that 497 // Boundaries for testing the type is a JavaScript "object". Note that
487 // function objects are not counted as objects, even though they are 498 // function objects are not counted as objects, even though they are
488 // implemented as such; only values whose typeof is "object" are included. 499 // implemented as such; only values whose typeof is "object" are included.
489 FIRST_JS_OBJECT_TYPE = JS_VALUE_TYPE, 500 FIRST_JS_OBJECT_TYPE = JS_VALUE_TYPE,
490 LAST_JS_OBJECT_TYPE = JS_REGEXP_TYPE 501 LAST_JS_OBJECT_TYPE = JS_REGEXP_TYPE
491 }; 502 };
492 503
493 504
494 enum CompareResult { 505 enum CompareResult {
495 LESS = -1, 506 LESS = -1,
(...skipping 4376 matching lines...) Expand 10 before | Expand all | Expand 10 after
4872 } else { 4883 } else {
4873 value &= ~(1 << bit_position); 4884 value &= ~(1 << bit_position);
4874 } 4885 }
4875 return value; 4886 return value;
4876 } 4887 }
4877 }; 4888 };
4878 4889
4879 } } // namespace v8::internal 4890 } } // namespace v8::internal
4880 4891
4881 #endif // V8_OBJECTS_H_ 4892 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/heap-inl.h ('k') | src/objects-debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698