| 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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 STORE_AND_GROW_TRANSITION_SMI_TO_DOUBLE, | 172 STORE_AND_GROW_TRANSITION_SMI_TO_DOUBLE, |
| 173 STORE_AND_GROW_TRANSITION_DOUBLE_TO_OBJECT, | 173 STORE_AND_GROW_TRANSITION_DOUBLE_TO_OBJECT, |
| 174 STORE_AND_GROW_TRANSITION_HOLEY_SMI_TO_OBJECT, | 174 STORE_AND_GROW_TRANSITION_HOLEY_SMI_TO_OBJECT, |
| 175 STORE_AND_GROW_TRANSITION_HOLEY_SMI_TO_DOUBLE, | 175 STORE_AND_GROW_TRANSITION_HOLEY_SMI_TO_DOUBLE, |
| 176 STORE_AND_GROW_TRANSITION_HOLEY_DOUBLE_TO_OBJECT, | 176 STORE_AND_GROW_TRANSITION_HOLEY_DOUBLE_TO_OBJECT, |
| 177 STORE_NO_TRANSITION_IGNORE_OUT_OF_BOUNDS, | 177 STORE_NO_TRANSITION_IGNORE_OUT_OF_BOUNDS, |
| 178 STORE_NO_TRANSITION_HANDLE_COW | 178 STORE_NO_TRANSITION_HANDLE_COW |
| 179 }; | 179 }; |
| 180 | 180 |
| 181 | 181 |
| 182 enum ContextualMode { |
| 183 NOT_CONTEXTUAL, |
| 184 CONTEXTUAL |
| 185 }; |
| 186 |
| 187 |
| 182 static const int kGrowICDelta = STORE_AND_GROW_NO_TRANSITION - | 188 static const int kGrowICDelta = STORE_AND_GROW_NO_TRANSITION - |
| 183 STANDARD_STORE; | 189 STANDARD_STORE; |
| 184 STATIC_ASSERT(STANDARD_STORE == 0); | 190 STATIC_ASSERT(STANDARD_STORE == 0); |
| 185 STATIC_ASSERT(kGrowICDelta == | 191 STATIC_ASSERT(kGrowICDelta == |
| 186 STORE_AND_GROW_TRANSITION_SMI_TO_OBJECT - | 192 STORE_AND_GROW_TRANSITION_SMI_TO_OBJECT - |
| 187 STORE_TRANSITION_SMI_TO_OBJECT); | 193 STORE_TRANSITION_SMI_TO_OBJECT); |
| 188 STATIC_ASSERT(kGrowICDelta == | 194 STATIC_ASSERT(kGrowICDelta == |
| 189 STORE_AND_GROW_TRANSITION_SMI_TO_DOUBLE - | 195 STORE_AND_GROW_TRANSITION_SMI_TO_DOUBLE - |
| 190 STORE_TRANSITION_SMI_TO_DOUBLE); | 196 STORE_TRANSITION_SMI_TO_DOUBLE); |
| 191 STATIC_ASSERT(kGrowICDelta == | 197 STATIC_ASSERT(kGrowICDelta == |
| (...skipping 4839 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5031 static const char* Kind2String(Kind kind); | 5037 static const char* Kind2String(Kind kind); |
| 5032 | 5038 |
| 5033 // Types of stubs. | 5039 // Types of stubs. |
| 5034 enum StubType { | 5040 enum StubType { |
| 5035 NORMAL, | 5041 NORMAL, |
| 5036 FAST | 5042 FAST |
| 5037 }; | 5043 }; |
| 5038 | 5044 |
| 5039 typedef int ExtraICState; | 5045 typedef int ExtraICState; |
| 5040 | 5046 |
| 5041 static const ExtraICState kNoExtraICState = 0; | |
| 5042 | |
| 5043 static const int kPrologueOffsetNotSet = -1; | 5047 static const int kPrologueOffsetNotSet = -1; |
| 5044 | 5048 |
| 5045 #ifdef ENABLE_DISASSEMBLER | 5049 #ifdef ENABLE_DISASSEMBLER |
| 5046 // Printing | 5050 // Printing |
| 5047 static const char* ICState2String(InlineCacheState state); | 5051 static const char* ICState2String(InlineCacheState state); |
| 5048 static const char* StubType2String(StubType type); | 5052 static const char* StubType2String(StubType type); |
| 5049 static void PrintExtraICState(FILE* out, Kind kind, ExtraICState extra); | 5053 static void PrintExtraICState(FILE* out, Kind kind, ExtraICState extra); |
| 5050 void Disassemble(const char* name, FILE* out = stdout); | 5054 void Disassemble(const char* name, FILE* out = stdout); |
| 5051 #endif // ENABLE_DISASSEMBLER | 5055 #endif // ENABLE_DISASSEMBLER |
| 5052 | 5056 |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5252 | 5256 |
| 5253 // The entire code object including its header is copied verbatim to the | 5257 // The entire code object including its header is copied verbatim to the |
| 5254 // snapshot so that it can be written in one, fast, memcpy during | 5258 // snapshot so that it can be written in one, fast, memcpy during |
| 5255 // deserialization. The deserializer will overwrite some pointers, rather | 5259 // deserialization. The deserializer will overwrite some pointers, rather |
| 5256 // like a runtime linker, but the random allocation addresses used in the | 5260 // like a runtime linker, but the random allocation addresses used in the |
| 5257 // mksnapshot process would still be present in the unlinked snapshot data, | 5261 // mksnapshot process would still be present in the unlinked snapshot data, |
| 5258 // which would make snapshot production non-reproducible. This method wipes | 5262 // which would make snapshot production non-reproducible. This method wipes |
| 5259 // out the to-be-overwritten header data for reproducible snapshots. | 5263 // out the to-be-overwritten header data for reproducible snapshots. |
| 5260 inline void WipeOutHeader(); | 5264 inline void WipeOutHeader(); |
| 5261 | 5265 |
| 5262 class ExtraICStateStrictMode: public BitField<StrictModeFlag, 0, 1> {}; | |
| 5263 class ExtraICStateKeyedAccessStoreMode: | |
| 5264 public BitField<KeyedAccessStoreMode, 1, 4> {}; // NOLINT | |
| 5265 | |
| 5266 static inline StrictModeFlag GetStrictMode(ExtraICState extra_ic_state) { | |
| 5267 return ExtraICStateStrictMode::decode(extra_ic_state); | |
| 5268 } | |
| 5269 | |
| 5270 static inline KeyedAccessStoreMode GetKeyedAccessStoreMode( | |
| 5271 ExtraICState extra_ic_state) { | |
| 5272 return ExtraICStateKeyedAccessStoreMode::decode(extra_ic_state); | |
| 5273 } | |
| 5274 | |
| 5275 static inline ExtraICState ComputeExtraICState( | |
| 5276 KeyedAccessStoreMode store_mode, | |
| 5277 StrictModeFlag strict_mode) { | |
| 5278 return ExtraICStateKeyedAccessStoreMode::encode(store_mode) | | |
| 5279 ExtraICStateStrictMode::encode(strict_mode); | |
| 5280 } | |
| 5281 | |
| 5282 // Flags operations. | 5266 // Flags operations. |
| 5267 // Defined here and in IC::kNoExtraICState to prevent circular dependency. |
| 5268 static const int kNoExtraICState = 0; |
| 5283 static inline Flags ComputeFlags( | 5269 static inline Flags ComputeFlags( |
| 5284 Kind kind, | 5270 Kind kind, |
| 5285 InlineCacheState ic_state = UNINITIALIZED, | 5271 InlineCacheState ic_state = UNINITIALIZED, |
| 5286 ExtraICState extra_ic_state = kNoExtraICState, | 5272 ExtraICState extra_ic_state = kNoExtraICState, |
| 5287 StubType type = NORMAL, | 5273 StubType type = NORMAL, |
| 5288 int argc = -1, | 5274 int argc = -1, |
| 5289 InlineCacheHolderFlag holder = OWN_MAP); | 5275 InlineCacheHolderFlag holder = OWN_MAP); |
| 5290 | 5276 |
| 5291 static inline Flags ComputeMonomorphicFlags( | 5277 static inline Flags ComputeMonomorphicFlags( |
| 5292 Kind kind, | 5278 Kind kind, |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5455 public BitField<bool, 0, 1> {}; // NOLINT | 5441 public BitField<bool, 0, 1> {}; // NOLINT |
| 5456 class FullCodeFlagsHasDebugBreakSlotsField: public BitField<bool, 1, 1> {}; | 5442 class FullCodeFlagsHasDebugBreakSlotsField: public BitField<bool, 1, 1> {}; |
| 5457 class FullCodeFlagsIsCompiledOptimizable: public BitField<bool, 2, 1> {}; | 5443 class FullCodeFlagsIsCompiledOptimizable: public BitField<bool, 2, 1> {}; |
| 5458 | 5444 |
| 5459 static const int kAllowOSRAtLoopNestingLevelOffset = kFullCodeFlags + 1; | 5445 static const int kAllowOSRAtLoopNestingLevelOffset = kFullCodeFlags + 1; |
| 5460 static const int kProfilerTicksOffset = kAllowOSRAtLoopNestingLevelOffset + 1; | 5446 static const int kProfilerTicksOffset = kAllowOSRAtLoopNestingLevelOffset + 1; |
| 5461 | 5447 |
| 5462 // Flags layout. BitField<type, shift, size>. | 5448 // Flags layout. BitField<type, shift, size>. |
| 5463 class ICStateField: public BitField<InlineCacheState, 0, 3> {}; | 5449 class ICStateField: public BitField<InlineCacheState, 0, 3> {}; |
| 5464 class TypeField: public BitField<StubType, 3, 1> {}; | 5450 class TypeField: public BitField<StubType, 3, 1> {}; |
| 5465 class CacheHolderField: public BitField<InlineCacheHolderFlag, 6, 1> {}; | 5451 class CacheHolderField: public BitField<InlineCacheHolderFlag, 5, 1> {}; |
| 5466 class KindField: public BitField<Kind, 7, 4> {}; | 5452 class KindField: public BitField<Kind, 6, 4> {}; |
| 5467 class IsPregeneratedField: public BitField<bool, 11, 1> {}; | 5453 class IsPregeneratedField: public BitField<bool, 10, 1> {}; |
| 5468 class ExtraICStateField: public BitField<ExtraICState, 12, 5> {}; | 5454 class ExtraICStateField: public BitField<ExtraICState, 11, 6> {}; |
| 5469 class ExtendedExtraICStateField: public BitField<ExtraICState, 12, | 5455 class ExtendedExtraICStateField: public BitField<ExtraICState, 11, |
| 5470 PlatformSmiTagging::kSmiValueSize - 12 + 1> {}; // NOLINT | 5456 PlatformSmiTagging::kSmiValueSize - 11 + 1> {}; // NOLINT |
| 5471 STATIC_ASSERT(ExtraICStateField::kShift == ExtendedExtraICStateField::kShift); | 5457 STATIC_ASSERT(ExtraICStateField::kShift == ExtendedExtraICStateField::kShift); |
| 5472 | 5458 |
| 5473 // KindSpecificFlags1 layout (STUB and OPTIMIZED_FUNCTION) | 5459 // KindSpecificFlags1 layout (STUB and OPTIMIZED_FUNCTION) |
| 5474 static const int kStackSlotsFirstBit = 0; | 5460 static const int kStackSlotsFirstBit = 0; |
| 5475 static const int kStackSlotsBitCount = 24; | 5461 static const int kStackSlotsBitCount = 24; |
| 5476 static const int kHasFunctionCacheFirstBit = | 5462 static const int kHasFunctionCacheFirstBit = |
| 5477 kStackSlotsFirstBit + kStackSlotsBitCount; | 5463 kStackSlotsFirstBit + kStackSlotsBitCount; |
| 5478 static const int kHasFunctionCacheBitCount = 1; | 5464 static const int kHasFunctionCacheBitCount = 1; |
| 5479 static const int kMarkedForDeoptimizationFirstBit = | 5465 static const int kMarkedForDeoptimizationFirstBit = |
| 5480 kStackSlotsFirstBit + kStackSlotsBitCount + 1; | 5466 kStackSlotsFirstBit + kStackSlotsBitCount + 1; |
| (...skipping 5149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10630 } else { | 10616 } else { |
| 10631 value &= ~(1 << bit_position); | 10617 value &= ~(1 << bit_position); |
| 10632 } | 10618 } |
| 10633 return value; | 10619 return value; |
| 10634 } | 10620 } |
| 10635 }; | 10621 }; |
| 10636 | 10622 |
| 10637 } } // namespace v8::internal | 10623 } } // namespace v8::internal |
| 10638 | 10624 |
| 10639 #endif // V8_OBJECTS_H_ | 10625 #endif // V8_OBJECTS_H_ |
| OLD | NEW |