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 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 V(ACCESSOR_PAIR, AccessorPair, accessor_pair) \ | 432 V(ACCESSOR_PAIR, AccessorPair, accessor_pair) \ |
433 V(ACCESS_CHECK_INFO, AccessCheckInfo, access_check_info) \ | 433 V(ACCESS_CHECK_INFO, AccessCheckInfo, access_check_info) \ |
434 V(INTERCEPTOR_INFO, InterceptorInfo, interceptor_info) \ | 434 V(INTERCEPTOR_INFO, InterceptorInfo, interceptor_info) \ |
435 V(CALL_HANDLER_INFO, CallHandlerInfo, call_handler_info) \ | 435 V(CALL_HANDLER_INFO, CallHandlerInfo, call_handler_info) \ |
436 V(FUNCTION_TEMPLATE_INFO, FunctionTemplateInfo, function_template_info) \ | 436 V(FUNCTION_TEMPLATE_INFO, FunctionTemplateInfo, function_template_info) \ |
437 V(OBJECT_TEMPLATE_INFO, ObjectTemplateInfo, object_template_info) \ | 437 V(OBJECT_TEMPLATE_INFO, ObjectTemplateInfo, object_template_info) \ |
438 V(SIGNATURE_INFO, SignatureInfo, signature_info) \ | 438 V(SIGNATURE_INFO, SignatureInfo, signature_info) \ |
439 V(TYPE_SWITCH_INFO, TypeSwitchInfo, type_switch_info) \ | 439 V(TYPE_SWITCH_INFO, TypeSwitchInfo, type_switch_info) \ |
440 V(SCRIPT, Script, script) \ | 440 V(SCRIPT, Script, script) \ |
441 V(CODE_CACHE, CodeCache, code_cache) \ | 441 V(CODE_CACHE, CodeCache, code_cache) \ |
442 V(POLYMORPHIC_CODE_CACHE, PolymorphicCodeCache, polymorphic_code_cache) | 442 V(POLYMORPHIC_CODE_CACHE, PolymorphicCodeCache, polymorphic_code_cache) \ |
| 443 V(TYPE_FEEDBACK_INFO, TypeFeedbackInfo, type_feedback_info) |
443 | 444 |
444 #ifdef ENABLE_DEBUGGER_SUPPORT | 445 #ifdef ENABLE_DEBUGGER_SUPPORT |
445 #define STRUCT_LIST_DEBUGGER(V) \ | 446 #define STRUCT_LIST_DEBUGGER(V) \ |
446 V(DEBUG_INFO, DebugInfo, debug_info) \ | 447 V(DEBUG_INFO, DebugInfo, debug_info) \ |
447 V(BREAK_POINT_INFO, BreakPointInfo, break_point_info) | 448 V(BREAK_POINT_INFO, BreakPointInfo, break_point_info) |
448 #else | 449 #else |
449 #define STRUCT_LIST_DEBUGGER(V) | 450 #define STRUCT_LIST_DEBUGGER(V) |
450 #endif | 451 #endif |
451 | 452 |
452 #define STRUCT_LIST(V) \ | 453 #define STRUCT_LIST(V) \ |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
587 ACCESS_CHECK_INFO_TYPE, | 588 ACCESS_CHECK_INFO_TYPE, |
588 INTERCEPTOR_INFO_TYPE, | 589 INTERCEPTOR_INFO_TYPE, |
589 CALL_HANDLER_INFO_TYPE, | 590 CALL_HANDLER_INFO_TYPE, |
590 FUNCTION_TEMPLATE_INFO_TYPE, | 591 FUNCTION_TEMPLATE_INFO_TYPE, |
591 OBJECT_TEMPLATE_INFO_TYPE, | 592 OBJECT_TEMPLATE_INFO_TYPE, |
592 SIGNATURE_INFO_TYPE, | 593 SIGNATURE_INFO_TYPE, |
593 TYPE_SWITCH_INFO_TYPE, | 594 TYPE_SWITCH_INFO_TYPE, |
594 SCRIPT_TYPE, | 595 SCRIPT_TYPE, |
595 CODE_CACHE_TYPE, | 596 CODE_CACHE_TYPE, |
596 POLYMORPHIC_CODE_CACHE_TYPE, | 597 POLYMORPHIC_CODE_CACHE_TYPE, |
| 598 TYPE_FEEDBACK_INFO_TYPE, |
597 // The following two instance types are only used when ENABLE_DEBUGGER_SUPPORT | 599 // The following two instance types are only used when ENABLE_DEBUGGER_SUPPORT |
598 // is defined. However as include/v8.h contain some of the instance type | 600 // is defined. However as include/v8.h contain some of the instance type |
599 // constants always having them avoids them getting different numbers | 601 // constants always having them avoids them getting different numbers |
600 // depending on whether ENABLE_DEBUGGER_SUPPORT is defined or not. | 602 // depending on whether ENABLE_DEBUGGER_SUPPORT is defined or not. |
601 DEBUG_INFO_TYPE, | 603 DEBUG_INFO_TYPE, |
602 BREAK_POINT_INFO_TYPE, | 604 BREAK_POINT_INFO_TYPE, |
603 | 605 |
604 FIXED_ARRAY_TYPE, | 606 FIXED_ARRAY_TYPE, |
605 SHARED_FUNCTION_INFO_TYPE, | 607 SHARED_FUNCTION_INFO_TYPE, |
606 | 608 |
(...skipping 3418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4025 // garbage collection (e.g., for patching the cache). | 4027 // garbage collection (e.g., for patching the cache). |
4026 static inline Object* RawUninitializedSentinel(Heap* heap); | 4028 static inline Object* RawUninitializedSentinel(Heap* heap); |
4027 | 4029 |
4028 // Casting. | 4030 // Casting. |
4029 static inline TypeFeedbackCells* cast(Object* obj); | 4031 static inline TypeFeedbackCells* cast(Object* obj); |
4030 }; | 4032 }; |
4031 | 4033 |
4032 | 4034 |
4033 // Forward declaration. | 4035 // Forward declaration. |
4034 class SafepointEntry; | 4036 class SafepointEntry; |
| 4037 class TypeFeedbackInfo; |
4035 | 4038 |
4036 // Code describes objects with on-the-fly generated machine code. | 4039 // Code describes objects with on-the-fly generated machine code. |
4037 class Code: public HeapObject { | 4040 class Code: public HeapObject { |
4038 public: | 4041 public: |
4039 // Opaque data type for encapsulating code flags like kind, inline | 4042 // Opaque data type for encapsulating code flags like kind, inline |
4040 // cache state, and arguments count. | 4043 // cache state, and arguments count. |
4041 // FLAGS_MIN_VALUE and FLAGS_MAX_VALUE are specified to ensure that | 4044 // FLAGS_MIN_VALUE and FLAGS_MAX_VALUE are specified to ensure that |
4042 // enumeration type has correct value range (see Issue 830 for more details). | 4045 // enumeration type has correct value range (see Issue 830 for more details). |
4043 enum Flags { | 4046 enum Flags { |
4044 FLAGS_MIN_VALUE = kMinInt, | 4047 FLAGS_MIN_VALUE = kMinInt, |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4096 // [relocation_info]: Code relocation information | 4099 // [relocation_info]: Code relocation information |
4097 DECL_ACCESSORS(relocation_info, ByteArray) | 4100 DECL_ACCESSORS(relocation_info, ByteArray) |
4098 void InvalidateRelocation(); | 4101 void InvalidateRelocation(); |
4099 | 4102 |
4100 // [handler_table]: Fixed array containing offsets of exception handlers. | 4103 // [handler_table]: Fixed array containing offsets of exception handlers. |
4101 DECL_ACCESSORS(handler_table, FixedArray) | 4104 DECL_ACCESSORS(handler_table, FixedArray) |
4102 | 4105 |
4103 // [deoptimization_data]: Array containing data for deopt. | 4106 // [deoptimization_data]: Array containing data for deopt. |
4104 DECL_ACCESSORS(deoptimization_data, FixedArray) | 4107 DECL_ACCESSORS(deoptimization_data, FixedArray) |
4105 | 4108 |
4106 // [type_feedback_cells]: Array containing cache cells used for type feedback. | 4109 // [type_feedback_info]: Struct containing type feedback information. |
4107 DECL_ACCESSORS(type_feedback_cells, TypeFeedbackCells) | 4110 // Will contain either a TypeFeedbackInfo object, or undefined. |
| 4111 DECL_ACCESSORS(type_feedback_info, Object) |
4108 | 4112 |
4109 // [gc_metadata]: Field used to hold GC related metadata. The contents of this | 4113 // [gc_metadata]: Field used to hold GC related metadata. The contents of this |
4110 // field does not have to be traced during garbage collection since | 4114 // field does not have to be traced during garbage collection since |
4111 // it is only used by the garbage collector itself. | 4115 // it is only used by the garbage collector itself. |
4112 DECL_ACCESSORS(gc_metadata, Object) | 4116 DECL_ACCESSORS(gc_metadata, Object) |
4113 | 4117 |
4114 // Unchecked accessors to be used during GC. | 4118 // Unchecked accessors to be used during GC. |
4115 inline ByteArray* unchecked_relocation_info(); | 4119 inline ByteArray* unchecked_relocation_info(); |
4116 inline FixedArray* unchecked_deoptimization_data(); | 4120 inline FixedArray* unchecked_deoptimization_data(); |
4117 | 4121 |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4348 // Max loop nesting marker used to postpose OSR. We don't take loop | 4352 // Max loop nesting marker used to postpose OSR. We don't take loop |
4349 // nesting that is deeper than 5 levels into account. | 4353 // nesting that is deeper than 5 levels into account. |
4350 static const int kMaxLoopNestingMarker = 6; | 4354 static const int kMaxLoopNestingMarker = 6; |
4351 | 4355 |
4352 // Layout description. | 4356 // Layout description. |
4353 static const int kInstructionSizeOffset = HeapObject::kHeaderSize; | 4357 static const int kInstructionSizeOffset = HeapObject::kHeaderSize; |
4354 static const int kRelocationInfoOffset = kInstructionSizeOffset + kIntSize; | 4358 static const int kRelocationInfoOffset = kInstructionSizeOffset + kIntSize; |
4355 static const int kHandlerTableOffset = kRelocationInfoOffset + kPointerSize; | 4359 static const int kHandlerTableOffset = kRelocationInfoOffset + kPointerSize; |
4356 static const int kDeoptimizationDataOffset = | 4360 static const int kDeoptimizationDataOffset = |
4357 kHandlerTableOffset + kPointerSize; | 4361 kHandlerTableOffset + kPointerSize; |
4358 static const int kTypeFeedbackCellsOffset = | 4362 static const int kTypeFeedbackInfoOffset = |
4359 kDeoptimizationDataOffset + kPointerSize; | 4363 kDeoptimizationDataOffset + kPointerSize; |
4360 static const int kGCMetadataOffset = kTypeFeedbackCellsOffset + kPointerSize; | 4364 static const int kGCMetadataOffset = kTypeFeedbackInfoOffset + kPointerSize; |
4361 static const int kFlagsOffset = kGCMetadataOffset + kPointerSize; | 4365 static const int kFlagsOffset = kGCMetadataOffset + kPointerSize; |
4362 | 4366 |
4363 static const int kKindSpecificFlagsOffset = kFlagsOffset + kIntSize; | 4367 static const int kKindSpecificFlagsOffset = kFlagsOffset + kIntSize; |
4364 static const int kKindSpecificFlagsSize = 2 * kIntSize; | 4368 static const int kKindSpecificFlagsSize = 2 * kIntSize; |
4365 | 4369 |
4366 static const int kHeaderPaddingStart = kKindSpecificFlagsOffset + | 4370 static const int kHeaderPaddingStart = kKindSpecificFlagsOffset + |
4367 kKindSpecificFlagsSize; | 4371 kKindSpecificFlagsSize; |
4368 | 4372 |
4369 // Add padding to align the instruction start following right after | 4373 // Add padding to align the instruction start following right after |
4370 // the Code object header. | 4374 // the Code object header. |
(...skipping 1983 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6354 Code* code); | 6358 Code* code); |
6355 | 6359 |
6356 static inline PolymorphicCodeCacheHashTable* cast(Object* obj); | 6360 static inline PolymorphicCodeCacheHashTable* cast(Object* obj); |
6357 | 6361 |
6358 static const int kInitialSize = 64; | 6362 static const int kInitialSize = 64; |
6359 private: | 6363 private: |
6360 DISALLOW_IMPLICIT_CONSTRUCTORS(PolymorphicCodeCacheHashTable); | 6364 DISALLOW_IMPLICIT_CONSTRUCTORS(PolymorphicCodeCacheHashTable); |
6361 }; | 6365 }; |
6362 | 6366 |
6363 | 6367 |
| 6368 class TypeFeedbackInfo: public Struct { |
| 6369 public: |
| 6370 inline int ic_total_count(); |
| 6371 inline void set_ic_total_count(int count); |
| 6372 |
| 6373 inline int ic_with_typeinfo_count(); |
| 6374 inline void set_ic_with_typeinfo_count(int count); |
| 6375 |
| 6376 DECL_ACCESSORS(type_feedback_cells, TypeFeedbackCells) |
| 6377 |
| 6378 static inline TypeFeedbackInfo* cast(Object* obj); |
| 6379 |
| 6380 #ifdef OBJECT_PRINT |
| 6381 inline void TypeFeedbackInfoPrint() { |
| 6382 TypeFeedbackInfoPrint(stdout); |
| 6383 } |
| 6384 void TypeFeedbackInfoPrint(FILE* out); |
| 6385 #endif |
| 6386 #ifdef DEBUG |
| 6387 void TypeFeedbackInfoVerify(); |
| 6388 #endif |
| 6389 |
| 6390 static const int kIcTotalCountOffset = HeapObject::kHeaderSize; |
| 6391 static const int kIcWithTypeinfoCountOffset = |
| 6392 kIcTotalCountOffset + kPointerSize; |
| 6393 static const int kTypeFeedbackCellsOffset = |
| 6394 kIcWithTypeinfoCountOffset + kPointerSize; |
| 6395 static const int kSize = kTypeFeedbackCellsOffset + kPointerSize; |
| 6396 |
| 6397 private: |
| 6398 DISALLOW_IMPLICIT_CONSTRUCTORS(TypeFeedbackInfo); |
| 6399 }; |
| 6400 |
| 6401 |
6364 enum AllowNullsFlag {ALLOW_NULLS, DISALLOW_NULLS}; | 6402 enum AllowNullsFlag {ALLOW_NULLS, DISALLOW_NULLS}; |
6365 enum RobustnessFlag {ROBUST_STRING_TRAVERSAL, FAST_STRING_TRAVERSAL}; | 6403 enum RobustnessFlag {ROBUST_STRING_TRAVERSAL, FAST_STRING_TRAVERSAL}; |
6366 | 6404 |
6367 | 6405 |
6368 class StringHasher { | 6406 class StringHasher { |
6369 public: | 6407 public: |
6370 explicit inline StringHasher(int length, uint32_t seed); | 6408 explicit inline StringHasher(int length, uint32_t seed); |
6371 | 6409 |
6372 // Returns true if the hash of this string can be computed without | 6410 // Returns true if the hash of this string can be computed without |
6373 // looking at the contents. | 6411 // looking at the contents. |
(...skipping 1925 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8299 } else { | 8337 } else { |
8300 value &= ~(1 << bit_position); | 8338 value &= ~(1 << bit_position); |
8301 } | 8339 } |
8302 return value; | 8340 return value; |
8303 } | 8341 } |
8304 }; | 8342 }; |
8305 | 8343 |
8306 } } // namespace v8::internal | 8344 } } // namespace v8::internal |
8307 | 8345 |
8308 #endif // V8_OBJECTS_H_ | 8346 #endif // V8_OBJECTS_H_ |
OLD | NEW |