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

Side by Side Diff: src/objects.h

Issue 11663005: Adapt Danno's Track Allocation Info idea to fast literals. When allocating a literal array, (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Always use in ICs, and moved feature behind a flag Created 7 years, 12 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
OLDNEW
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 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 \ 284 \
285 V(ACCESSOR_INFO_TYPE) \ 285 V(ACCESSOR_INFO_TYPE) \
286 V(ACCESSOR_PAIR_TYPE) \ 286 V(ACCESSOR_PAIR_TYPE) \
287 V(ACCESS_CHECK_INFO_TYPE) \ 287 V(ACCESS_CHECK_INFO_TYPE) \
288 V(INTERCEPTOR_INFO_TYPE) \ 288 V(INTERCEPTOR_INFO_TYPE) \
289 V(CALL_HANDLER_INFO_TYPE) \ 289 V(CALL_HANDLER_INFO_TYPE) \
290 V(FUNCTION_TEMPLATE_INFO_TYPE) \ 290 V(FUNCTION_TEMPLATE_INFO_TYPE) \
291 V(OBJECT_TEMPLATE_INFO_TYPE) \ 291 V(OBJECT_TEMPLATE_INFO_TYPE) \
292 V(SIGNATURE_INFO_TYPE) \ 292 V(SIGNATURE_INFO_TYPE) \
293 V(TYPE_SWITCH_INFO_TYPE) \ 293 V(TYPE_SWITCH_INFO_TYPE) \
294 V(ALLOCATION_SITE_INFO_TYPE) \
294 V(SCRIPT_TYPE) \ 295 V(SCRIPT_TYPE) \
295 V(CODE_CACHE_TYPE) \ 296 V(CODE_CACHE_TYPE) \
296 V(POLYMORPHIC_CODE_CACHE_TYPE) \ 297 V(POLYMORPHIC_CODE_CACHE_TYPE) \
297 V(TYPE_FEEDBACK_INFO_TYPE) \ 298 V(TYPE_FEEDBACK_INFO_TYPE) \
298 V(ALIASED_ARGUMENTS_ENTRY_TYPE) \ 299 V(ALIASED_ARGUMENTS_ENTRY_TYPE) \
299 \ 300 \
300 V(FIXED_ARRAY_TYPE) \ 301 V(FIXED_ARRAY_TYPE) \
301 V(FIXED_DOUBLE_ARRAY_TYPE) \ 302 V(FIXED_DOUBLE_ARRAY_TYPE) \
302 V(SHARED_FUNCTION_INFO_TYPE) \ 303 V(SHARED_FUNCTION_INFO_TYPE) \
303 \ 304 \
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 V(ACCESSOR_INFO, AccessorInfo, accessor_info) \ 438 V(ACCESSOR_INFO, AccessorInfo, accessor_info) \
438 V(ACCESSOR_PAIR, AccessorPair, accessor_pair) \ 439 V(ACCESSOR_PAIR, AccessorPair, accessor_pair) \
439 V(ACCESS_CHECK_INFO, AccessCheckInfo, access_check_info) \ 440 V(ACCESS_CHECK_INFO, AccessCheckInfo, access_check_info) \
440 V(INTERCEPTOR_INFO, InterceptorInfo, interceptor_info) \ 441 V(INTERCEPTOR_INFO, InterceptorInfo, interceptor_info) \
441 V(CALL_HANDLER_INFO, CallHandlerInfo, call_handler_info) \ 442 V(CALL_HANDLER_INFO, CallHandlerInfo, call_handler_info) \
442 V(FUNCTION_TEMPLATE_INFO, FunctionTemplateInfo, function_template_info) \ 443 V(FUNCTION_TEMPLATE_INFO, FunctionTemplateInfo, function_template_info) \
443 V(OBJECT_TEMPLATE_INFO, ObjectTemplateInfo, object_template_info) \ 444 V(OBJECT_TEMPLATE_INFO, ObjectTemplateInfo, object_template_info) \
444 V(SIGNATURE_INFO, SignatureInfo, signature_info) \ 445 V(SIGNATURE_INFO, SignatureInfo, signature_info) \
445 V(TYPE_SWITCH_INFO, TypeSwitchInfo, type_switch_info) \ 446 V(TYPE_SWITCH_INFO, TypeSwitchInfo, type_switch_info) \
446 V(SCRIPT, Script, script) \ 447 V(SCRIPT, Script, script) \
448 V(ALLOCATION_SITE_INFO, AllocationSiteInfo, allocation_site_info) \
447 V(CODE_CACHE, CodeCache, code_cache) \ 449 V(CODE_CACHE, CodeCache, code_cache) \
448 V(POLYMORPHIC_CODE_CACHE, PolymorphicCodeCache, polymorphic_code_cache) \ 450 V(POLYMORPHIC_CODE_CACHE, PolymorphicCodeCache, polymorphic_code_cache) \
449 V(TYPE_FEEDBACK_INFO, TypeFeedbackInfo, type_feedback_info) \ 451 V(TYPE_FEEDBACK_INFO, TypeFeedbackInfo, type_feedback_info) \
450 V(ALIASED_ARGUMENTS_ENTRY, AliasedArgumentsEntry, aliased_arguments_entry) 452 V(ALIASED_ARGUMENTS_ENTRY, AliasedArgumentsEntry, aliased_arguments_entry)
451 453
452 #ifdef ENABLE_DEBUGGER_SUPPORT 454 #ifdef ENABLE_DEBUGGER_SUPPORT
453 #define STRUCT_LIST_DEBUGGER(V) \ 455 #define STRUCT_LIST_DEBUGGER(V) \
454 V(DEBUG_INFO, DebugInfo, debug_info) \ 456 V(DEBUG_INFO, DebugInfo, debug_info) \
455 V(BREAK_POINT_INFO, BreakPointInfo, break_point_info) 457 V(BREAK_POINT_INFO, BreakPointInfo, break_point_info)
456 #else 458 #else
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 // Structs. 601 // Structs.
600 ACCESSOR_INFO_TYPE, 602 ACCESSOR_INFO_TYPE,
601 ACCESSOR_PAIR_TYPE, 603 ACCESSOR_PAIR_TYPE,
602 ACCESS_CHECK_INFO_TYPE, 604 ACCESS_CHECK_INFO_TYPE,
603 INTERCEPTOR_INFO_TYPE, 605 INTERCEPTOR_INFO_TYPE,
604 CALL_HANDLER_INFO_TYPE, 606 CALL_HANDLER_INFO_TYPE,
605 FUNCTION_TEMPLATE_INFO_TYPE, 607 FUNCTION_TEMPLATE_INFO_TYPE,
606 OBJECT_TEMPLATE_INFO_TYPE, 608 OBJECT_TEMPLATE_INFO_TYPE,
607 SIGNATURE_INFO_TYPE, 609 SIGNATURE_INFO_TYPE,
608 TYPE_SWITCH_INFO_TYPE, 610 TYPE_SWITCH_INFO_TYPE,
611 ALLOCATION_SITE_INFO_TYPE,
609 SCRIPT_TYPE, 612 SCRIPT_TYPE,
610 CODE_CACHE_TYPE, 613 CODE_CACHE_TYPE,
611 POLYMORPHIC_CODE_CACHE_TYPE, 614 POLYMORPHIC_CODE_CACHE_TYPE,
612 TYPE_FEEDBACK_INFO_TYPE, 615 TYPE_FEEDBACK_INFO_TYPE,
613 ALIASED_ARGUMENTS_ENTRY_TYPE, 616 ALIASED_ARGUMENTS_ENTRY_TYPE,
614 // The following two instance types are only used when ENABLE_DEBUGGER_SUPPORT 617 // The following two instance types are only used when ENABLE_DEBUGGER_SUPPORT
615 // is defined. However as include/v8.h contain some of the instance type 618 // is defined. However as include/v8.h contain some of the instance type
616 // constants always having them avoids them getting different numbers 619 // constants always having them avoids them getting different numbers
617 // depending on whether ENABLE_DEBUGGER_SUPPORT is defined or not. 620 // depending on whether ENABLE_DEBUGGER_SUPPORT is defined or not.
618 DEBUG_INFO_TYPE, 621 DEBUG_INFO_TYPE,
(...skipping 3535 matching lines...) Expand 10 before | Expand all | Expand 10 after
4154 static inline Object* RawUninitializedSentinel(Heap* heap); 4157 static inline Object* RawUninitializedSentinel(Heap* heap);
4155 4158
4156 // Casting. 4159 // Casting.
4157 static inline TypeFeedbackCells* cast(Object* obj); 4160 static inline TypeFeedbackCells* cast(Object* obj);
4158 4161
4159 static const int kForInFastCaseMarker = 0; 4162 static const int kForInFastCaseMarker = 0;
4160 static const int kForInSlowCaseMarker = 1; 4163 static const int kForInSlowCaseMarker = 1;
4161 }; 4164 };
4162 4165
4163 4166
4167
danno 2012/12/26 10:32:01 nit: remove whitespace change
mvstanton 2013/01/03 14:40:43 Done.
4168
4164 // Forward declaration. 4169 // Forward declaration.
4165 class SafepointEntry; 4170 class SafepointEntry;
4166 class TypeFeedbackInfo; 4171 class TypeFeedbackInfo;
4167 4172
4168 // Code describes objects with on-the-fly generated machine code. 4173 // Code describes objects with on-the-fly generated machine code.
4169 class Code: public HeapObject { 4174 class Code: public HeapObject {
4170 public: 4175 public:
4171 // Opaque data type for encapsulating code flags like kind, inline 4176 // Opaque data type for encapsulating code flags like kind, inline
4172 // cache state, and arguments count. 4177 // cache state, and arguments count.
4173 // FLAGS_MIN_VALUE and FLAGS_MAX_VALUE are specified to ensure that 4178 // FLAGS_MIN_VALUE and FLAGS_MAX_VALUE are specified to ensure that
(...skipping 2707 matching lines...) Expand 10 before | Expand all | Expand 10 after
6881 class ICsWithTypeInfoCountField: public BitField<int, 0, 6886 class ICsWithTypeInfoCountField: public BitField<int, 0,
6882 kSmiValueSize - kTypeChangeChecksumBits> {}; // NOLINT 6887 kSmiValueSize - kTypeChangeChecksumBits> {}; // NOLINT
6883 class InlinedTypeChangeChecksum: public BitField<int, 6888 class InlinedTypeChangeChecksum: public BitField<int,
6884 kSmiValueSize - kTypeChangeChecksumBits, 6889 kSmiValueSize - kTypeChangeChecksumBits,
6885 kTypeChangeChecksumBits> {}; // NOLINT 6890 kTypeChangeChecksumBits> {}; // NOLINT
6886 6891
6887 DISALLOW_IMPLICIT_CONSTRUCTORS(TypeFeedbackInfo); 6892 DISALLOW_IMPLICIT_CONSTRUCTORS(TypeFeedbackInfo);
6888 }; 6893 };
6889 6894
6890 6895
6896 class AllocationSiteInfo: public Struct {
6897 public:
6898 DECL_ACCESSORS(payload, Object)
6899
6900 static inline AllocationSiteInfo* cast(Object* obj);
6901
6902 #ifdef OBJECT_PRINT
6903 inline void AllocationSiteInfoPrint() {
6904 AllocationSiteInfoPrint(stdout);
6905 }
6906 void AllocationSiteInfoPrint(FILE* out);
6907 #endif
6908 #ifdef DEBUG
6909 void AllocationSiteInfoVerify();
6910 #endif
6911
6912 static const int kPayloadOffset = HeapObject::kHeaderSize;
6913 static const int kSize = kPayloadOffset + kPointerSize;
6914
6915 private:
6916 DISALLOW_IMPLICIT_CONSTRUCTORS(AllocationSiteInfo);
6917 };
6918
6919
6891 // Representation of a slow alias as part of a non-strict arguments objects. 6920 // Representation of a slow alias as part of a non-strict arguments objects.
6892 // For fast aliases (if HasNonStrictArgumentsElements()): 6921 // For fast aliases (if HasNonStrictArgumentsElements()):
6893 // - the parameter map contains an index into the context 6922 // - the parameter map contains an index into the context
6894 // - all attributes of the element have default values 6923 // - all attributes of the element have default values
6895 // For slow aliases (if HasDictionaryArgumentsElements()): 6924 // For slow aliases (if HasDictionaryArgumentsElements()):
6896 // - the parameter map contains no fast alias mapping (i.e. the hole) 6925 // - the parameter map contains no fast alias mapping (i.e. the hole)
6897 // - this struct (in the slow backing store) contains an index into the context 6926 // - this struct (in the slow backing store) contains an index into the context
6898 // - all attributes are available as part if the property details 6927 // - all attributes are available as part if the property details
6899 class AliasedArgumentsEntry: public Struct { 6928 class AliasedArgumentsEntry: public Struct {
6900 public: 6929 public:
(...skipping 1997 matching lines...) Expand 10 before | Expand all | Expand 10 after
8898 } else { 8927 } else {
8899 value &= ~(1 << bit_position); 8928 value &= ~(1 << bit_position);
8900 } 8929 }
8901 return value; 8930 return value;
8902 } 8931 }
8903 }; 8932 };
8904 8933
8905 } } // namespace v8::internal 8934 } } // namespace v8::internal
8906 8935
8907 #endif // V8_OBJECTS_H_ 8936 #endif // V8_OBJECTS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698