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 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
484 V(EXTERNAL_STRING_TYPE, \ | 484 V(EXTERNAL_STRING_TYPE, \ |
485 ExternalTwoByteString::kSize, \ | 485 ExternalTwoByteString::kSize, \ |
486 external_string, \ | 486 external_string, \ |
487 ExternalString) \ | 487 ExternalString) \ |
488 V(EXTERNAL_ASCII_STRING_TYPE, \ | 488 V(EXTERNAL_ASCII_STRING_TYPE, \ |
489 ExternalAsciiString::kSize, \ | 489 ExternalAsciiString::kSize, \ |
490 external_ascii_string, \ | 490 external_ascii_string, \ |
491 ExternalAsciiString) \ | 491 ExternalAsciiString) \ |
492 V(EXTERNAL_STRING_WITH_ONE_BYTE_DATA_TYPE, \ | 492 V(EXTERNAL_STRING_WITH_ONE_BYTE_DATA_TYPE, \ |
493 ExternalTwoByteString::kSize, \ | 493 ExternalTwoByteString::kSize, \ |
494 external_string_with_one_bytei_data, \ | 494 external_string_with_one_byte_data, \ |
495 ExternalStringWithOneByteData) \ | 495 ExternalStringWithOneByteData) \ |
496 V(SHORT_EXTERNAL_STRING_TYPE, \ | 496 V(SHORT_EXTERNAL_STRING_TYPE, \ |
497 ExternalTwoByteString::kShortSize, \ | 497 ExternalTwoByteString::kShortSize, \ |
498 short_external_string, \ | 498 short_external_string, \ |
499 ShortExternalString) \ | 499 ShortExternalString) \ |
500 V(SHORT_EXTERNAL_ASCII_STRING_TYPE, \ | 500 V(SHORT_EXTERNAL_ASCII_STRING_TYPE, \ |
501 ExternalAsciiString::kShortSize, \ | 501 ExternalAsciiString::kShortSize, \ |
502 short_external_ascii_string, \ | 502 short_external_ascii_string, \ |
503 ShortExternalAsciiString) \ | 503 ShortExternalAsciiString) \ |
504 V(SHORT_EXTERNAL_STRING_WITH_ONE_BYTE_DATA_TYPE, \ | 504 V(SHORT_EXTERNAL_STRING_WITH_ONE_BYTE_DATA_TYPE, \ |
(...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1202 V(kInlinedRuntimeFunctionFastAsciiArrayJoin, \ | 1202 V(kInlinedRuntimeFunctionFastAsciiArrayJoin, \ |
1203 "Inlined runtime function: FastAsciiArrayJoin") \ | 1203 "Inlined runtime function: FastAsciiArrayJoin") \ |
1204 V(kInlinedRuntimeFunctionGeneratorNext, \ | 1204 V(kInlinedRuntimeFunctionGeneratorNext, \ |
1205 "Inlined runtime function: GeneratorNext") \ | 1205 "Inlined runtime function: GeneratorNext") \ |
1206 V(kInlinedRuntimeFunctionGeneratorThrow, \ | 1206 V(kInlinedRuntimeFunctionGeneratorThrow, \ |
1207 "Inlined runtime function: GeneratorThrow") \ | 1207 "Inlined runtime function: GeneratorThrow") \ |
1208 V(kInlinedRuntimeFunctionGetFromCache, \ | 1208 V(kInlinedRuntimeFunctionGetFromCache, \ |
1209 "Inlined runtime function: GetFromCache") \ | 1209 "Inlined runtime function: GetFromCache") \ |
1210 V(kInlinedRuntimeFunctionIsNonNegativeSmi, \ | 1210 V(kInlinedRuntimeFunctionIsNonNegativeSmi, \ |
1211 "Inlined runtime function: IsNonNegativeSmi") \ | 1211 "Inlined runtime function: IsNonNegativeSmi") \ |
1212 V(kInlinedRuntimeFunctionIsRegExpEquivalent, \ | |
1213 "Inlined runtime function: IsRegExpEquivalent") \ | |
1214 V(kInlinedRuntimeFunctionIsStringWrapperSafeForDefaultValueOf, \ | 1212 V(kInlinedRuntimeFunctionIsStringWrapperSafeForDefaultValueOf, \ |
1215 "Inlined runtime function: IsStringWrapperSafeForDefaultValueOf") \ | 1213 "Inlined runtime function: IsStringWrapperSafeForDefaultValueOf") \ |
1216 V(kInliningBailedOut, "Inlining bailed out") \ | 1214 V(kInliningBailedOut, "Inlining bailed out") \ |
1217 V(kInputGPRIsExpectedToHaveUpper32Cleared, \ | 1215 V(kInputGPRIsExpectedToHaveUpper32Cleared, \ |
1218 "Input GPR is expected to have upper32 cleared") \ | 1216 "Input GPR is expected to have upper32 cleared") \ |
1219 V(kInputStringTooLong, "Input string too long") \ | 1217 V(kInputStringTooLong, "Input string too long") \ |
1220 V(kInstanceofStubUnexpectedCallSiteCacheCheck, \ | 1218 V(kInstanceofStubUnexpectedCallSiteCacheCheck, \ |
1221 "InstanceofStub unexpected call site cache (check)") \ | 1219 "InstanceofStub unexpected call site cache (check)") \ |
1222 V(kInstanceofStubUnexpectedCallSiteCacheCmp1, \ | 1220 V(kInstanceofStubUnexpectedCallSiteCacheCmp1, \ |
1223 "InstanceofStub unexpected call site cache (cmp 1)") \ | 1221 "InstanceofStub unexpected call site cache (cmp 1)") \ |
(...skipping 3707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4931 | 4929 |
4932 template <class Traits> | 4930 template <class Traits> |
4933 class FixedTypedArray: public FixedTypedArrayBase { | 4931 class FixedTypedArray: public FixedTypedArrayBase { |
4934 public: | 4932 public: |
4935 typedef typename Traits::ElementType ElementType; | 4933 typedef typename Traits::ElementType ElementType; |
4936 static const InstanceType kInstanceType = Traits::kInstanceType; | 4934 static const InstanceType kInstanceType = Traits::kInstanceType; |
4937 | 4935 |
4938 // Casting: | 4936 // Casting: |
4939 static inline FixedTypedArray<Traits>* cast(Object* obj); | 4937 static inline FixedTypedArray<Traits>* cast(Object* obj); |
4940 | 4938 |
| 4939 static inline int ElementOffset(int index) { |
| 4940 return kDataOffset + index * sizeof(ElementType); |
| 4941 } |
| 4942 |
4941 static inline int SizeFor(int length) { | 4943 static inline int SizeFor(int length) { |
4942 return kDataOffset + length * sizeof(ElementType); | 4944 return ElementOffset(length); |
4943 } | 4945 } |
4944 | 4946 |
4945 inline ElementType get_scalar(int index); | 4947 inline ElementType get_scalar(int index); |
4946 MUST_USE_RESULT inline MaybeObject* get(int index); | 4948 MUST_USE_RESULT inline MaybeObject* get(int index); |
4947 inline void set(int index, ElementType value); | 4949 inline void set(int index, ElementType value); |
4948 | 4950 |
4949 // This accessor applies the correct conversion from Smi, HeapNumber | 4951 // This accessor applies the correct conversion from Smi, HeapNumber |
4950 // and undefined. | 4952 // and undefined. |
4951 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value); | 4953 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value); |
4952 | 4954 |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5167 V(FUNCTION) \ | 5169 V(FUNCTION) \ |
5168 V(OPTIMIZED_FUNCTION) \ | 5170 V(OPTIMIZED_FUNCTION) \ |
5169 V(STUB) \ | 5171 V(STUB) \ |
5170 V(HANDLER) \ | 5172 V(HANDLER) \ |
5171 V(BUILTIN) \ | 5173 V(BUILTIN) \ |
5172 V(REGEXP) | 5174 V(REGEXP) |
5173 | 5175 |
5174 #define IC_KIND_LIST(V) \ | 5176 #define IC_KIND_LIST(V) \ |
5175 V(LOAD_IC) \ | 5177 V(LOAD_IC) \ |
5176 V(KEYED_LOAD_IC) \ | 5178 V(KEYED_LOAD_IC) \ |
5177 V(CALL_IC) \ | |
5178 V(KEYED_CALL_IC) \ | |
5179 V(STORE_IC) \ | 5179 V(STORE_IC) \ |
5180 V(KEYED_STORE_IC) \ | 5180 V(KEYED_STORE_IC) \ |
5181 V(BINARY_OP_IC) \ | 5181 V(BINARY_OP_IC) \ |
5182 V(COMPARE_IC) \ | 5182 V(COMPARE_IC) \ |
5183 V(COMPARE_NIL_IC) \ | 5183 V(COMPARE_NIL_IC) \ |
5184 V(TO_BOOLEAN_IC) | 5184 V(TO_BOOLEAN_IC) |
5185 | 5185 |
5186 #define CODE_KIND_LIST(V) \ | 5186 #define CODE_KIND_LIST(V) \ |
5187 NON_IC_KIND_LIST(V) \ | 5187 NON_IC_KIND_LIST(V) \ |
5188 IC_KIND_LIST(V) | 5188 IC_KIND_LIST(V) |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5293 inline int arguments_count(); // Only valid for call IC stubs. | 5293 inline int arguments_count(); // Only valid for call IC stubs. |
5294 | 5294 |
5295 // Testers for IC stub kinds. | 5295 // Testers for IC stub kinds. |
5296 inline bool is_inline_cache_stub(); | 5296 inline bool is_inline_cache_stub(); |
5297 inline bool is_debug_stub(); | 5297 inline bool is_debug_stub(); |
5298 inline bool is_handler() { return kind() == HANDLER; } | 5298 inline bool is_handler() { return kind() == HANDLER; } |
5299 inline bool is_load_stub() { return kind() == LOAD_IC; } | 5299 inline bool is_load_stub() { return kind() == LOAD_IC; } |
5300 inline bool is_keyed_load_stub() { return kind() == KEYED_LOAD_IC; } | 5300 inline bool is_keyed_load_stub() { return kind() == KEYED_LOAD_IC; } |
5301 inline bool is_store_stub() { return kind() == STORE_IC; } | 5301 inline bool is_store_stub() { return kind() == STORE_IC; } |
5302 inline bool is_keyed_store_stub() { return kind() == KEYED_STORE_IC; } | 5302 inline bool is_keyed_store_stub() { return kind() == KEYED_STORE_IC; } |
5303 inline bool is_call_stub() { return kind() == CALL_IC; } | |
5304 inline bool is_keyed_call_stub() { return kind() == KEYED_CALL_IC; } | |
5305 inline bool is_binary_op_stub() { return kind() == BINARY_OP_IC; } | 5303 inline bool is_binary_op_stub() { return kind() == BINARY_OP_IC; } |
5306 inline bool is_compare_ic_stub() { return kind() == COMPARE_IC; } | 5304 inline bool is_compare_ic_stub() { return kind() == COMPARE_IC; } |
5307 inline bool is_compare_nil_ic_stub() { return kind() == COMPARE_NIL_IC; } | 5305 inline bool is_compare_nil_ic_stub() { return kind() == COMPARE_NIL_IC; } |
5308 inline bool is_to_boolean_ic_stub() { return kind() == TO_BOOLEAN_IC; } | 5306 inline bool is_to_boolean_ic_stub() { return kind() == TO_BOOLEAN_IC; } |
5309 inline bool is_keyed_stub(); | 5307 inline bool is_keyed_stub(); |
5310 | 5308 |
5311 inline void set_raw_kind_specific_flags1(int value); | 5309 inline void set_raw_kind_specific_flags1(int value); |
5312 inline void set_raw_kind_specific_flags2(int value); | 5310 inline void set_raw_kind_specific_flags2(int value); |
5313 | 5311 |
5314 // [major_key]: For kind STUB or BINARY_OP_IC, the major key. | 5312 // [major_key]: For kind STUB or BINARY_OP_IC, the major key. |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5363 inline void set_safepoint_table_offset(unsigned offset); | 5361 inline void set_safepoint_table_offset(unsigned offset); |
5364 | 5362 |
5365 // [back_edge_table_start]: For kind FUNCTION, the offset in the | 5363 // [back_edge_table_start]: For kind FUNCTION, the offset in the |
5366 // instruction stream where the back edge table starts. | 5364 // instruction stream where the back edge table starts. |
5367 inline unsigned back_edge_table_offset(); | 5365 inline unsigned back_edge_table_offset(); |
5368 inline void set_back_edge_table_offset(unsigned offset); | 5366 inline void set_back_edge_table_offset(unsigned offset); |
5369 | 5367 |
5370 inline bool back_edges_patched_for_osr(); | 5368 inline bool back_edges_patched_for_osr(); |
5371 inline void set_back_edges_patched_for_osr(bool value); | 5369 inline void set_back_edges_patched_for_osr(bool value); |
5372 | 5370 |
5373 // [check type]: For kind CALL_IC, tells how to check if the | |
5374 // receiver is valid for the given call. | |
5375 inline CheckType check_type(); | |
5376 inline void set_check_type(CheckType value); | |
5377 | |
5378 // [to_boolean_foo]: For kind TO_BOOLEAN_IC tells what state the stub is in. | 5371 // [to_boolean_foo]: For kind TO_BOOLEAN_IC tells what state the stub is in. |
5379 inline byte to_boolean_state(); | 5372 inline byte to_boolean_state(); |
5380 | 5373 |
5381 // [has_function_cache]: For kind STUB tells whether there is a function | 5374 // [has_function_cache]: For kind STUB tells whether there is a function |
5382 // cache is passed to the stub. | 5375 // cache is passed to the stub. |
5383 inline bool has_function_cache(); | 5376 inline bool has_function_cache(); |
5384 inline void set_has_function_cache(bool flag); | 5377 inline void set_has_function_cache(bool flag); |
5385 | 5378 |
5386 | 5379 |
5387 // [marked_for_deoptimization]: For kind OPTIMIZED_FUNCTION tells whether | 5380 // [marked_for_deoptimization]: For kind OPTIMIZED_FUNCTION tells whether |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5594 | 5587 |
5595 static const int kHeaderPaddingStart = kConstantPoolOffset + kIntSize; | 5588 static const int kHeaderPaddingStart = kConstantPoolOffset + kIntSize; |
5596 | 5589 |
5597 // Add padding to align the instruction start following right after | 5590 // Add padding to align the instruction start following right after |
5598 // the Code object header. | 5591 // the Code object header. |
5599 static const int kHeaderSize = | 5592 static const int kHeaderSize = |
5600 (kHeaderPaddingStart + kCodeAlignmentMask) & ~kCodeAlignmentMask; | 5593 (kHeaderPaddingStart + kCodeAlignmentMask) & ~kCodeAlignmentMask; |
5601 | 5594 |
5602 // Byte offsets within kKindSpecificFlags1Offset. | 5595 // Byte offsets within kKindSpecificFlags1Offset. |
5603 static const int kOptimizableOffset = kKindSpecificFlags1Offset; | 5596 static const int kOptimizableOffset = kKindSpecificFlags1Offset; |
5604 static const int kCheckTypeOffset = kKindSpecificFlags1Offset; | |
5605 | 5597 |
5606 static const int kFullCodeFlags = kOptimizableOffset + 1; | 5598 static const int kFullCodeFlags = kOptimizableOffset + 1; |
5607 class FullCodeFlagsHasDeoptimizationSupportField: | 5599 class FullCodeFlagsHasDeoptimizationSupportField: |
5608 public BitField<bool, 0, 1> {}; // NOLINT | 5600 public BitField<bool, 0, 1> {}; // NOLINT |
5609 class FullCodeFlagsHasDebugBreakSlotsField: public BitField<bool, 1, 1> {}; | 5601 class FullCodeFlagsHasDebugBreakSlotsField: public BitField<bool, 1, 1> {}; |
5610 class FullCodeFlagsIsCompiledOptimizable: public BitField<bool, 2, 1> {}; | 5602 class FullCodeFlagsIsCompiledOptimizable: public BitField<bool, 2, 1> {}; |
5611 | 5603 |
5612 static const int kAllowOSRAtLoopNestingLevelOffset = kFullCodeFlags + 1; | 5604 static const int kAllowOSRAtLoopNestingLevelOffset = kFullCodeFlags + 1; |
5613 static const int kProfilerTicksOffset = kAllowOSRAtLoopNestingLevelOffset + 1; | 5605 static const int kProfilerTicksOffset = kAllowOSRAtLoopNestingLevelOffset + 1; |
5614 | 5606 |
(...skipping 5195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10810 } else { | 10802 } else { |
10811 value &= ~(1 << bit_position); | 10803 value &= ~(1 << bit_position); |
10812 } | 10804 } |
10813 return value; | 10805 return value; |
10814 } | 10806 } |
10815 }; | 10807 }; |
10816 | 10808 |
10817 } } // namespace v8::internal | 10809 } } // namespace v8::internal |
10818 | 10810 |
10819 #endif // V8_OBJECTS_H_ | 10811 #endif // V8_OBJECTS_H_ |
OLD | NEW |