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 4237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4248 inline bool has_self_optimization_header(); | 4248 inline bool has_self_optimization_header(); |
4249 inline void set_self_optimization_header(bool value); | 4249 inline void set_self_optimization_header(bool value); |
4250 | 4250 |
4251 // [allow_osr_at_loop_nesting_level]: For FUNCTION kind, tells for | 4251 // [allow_osr_at_loop_nesting_level]: For FUNCTION kind, tells for |
4252 // how long the function has been marked for OSR and therefore which | 4252 // how long the function has been marked for OSR and therefore which |
4253 // level of loop nesting we are willing to do on-stack replacement | 4253 // level of loop nesting we are willing to do on-stack replacement |
4254 // for. | 4254 // for. |
4255 inline void set_allow_osr_at_loop_nesting_level(int level); | 4255 inline void set_allow_osr_at_loop_nesting_level(int level); |
4256 inline int allow_osr_at_loop_nesting_level(); | 4256 inline int allow_osr_at_loop_nesting_level(); |
4257 | 4257 |
| 4258 // [profiler_ticks]: For FUNCTION kind, tells for how many profiler ticks |
| 4259 // the code object was seen on the stack with no IC patching going on. |
| 4260 inline int profiler_ticks(); |
| 4261 inline void set_profiler_ticks(int ticks); |
| 4262 |
4258 // [stack_slots]: For kind OPTIMIZED_FUNCTION, the number of stack slots | 4263 // [stack_slots]: For kind OPTIMIZED_FUNCTION, the number of stack slots |
4259 // reserved in the code prologue. | 4264 // reserved in the code prologue. |
4260 inline unsigned stack_slots(); | 4265 inline unsigned stack_slots(); |
4261 inline void set_stack_slots(unsigned slots); | 4266 inline void set_stack_slots(unsigned slots); |
4262 | 4267 |
4263 // [safepoint_table_start]: For kind OPTIMIZED_CODE, the offset in | 4268 // [safepoint_table_start]: For kind OPTIMIZED_CODE, the offset in |
4264 // the instruction stream where the safepoint table starts. | 4269 // the instruction stream where the safepoint table starts. |
4265 inline unsigned safepoint_table_offset(); | 4270 inline unsigned safepoint_table_offset(); |
4266 inline void set_safepoint_table_offset(unsigned offset); | 4271 inline void set_safepoint_table_offset(unsigned offset); |
4267 | 4272 |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4467 static const int kFullCodeFlags = kOptimizableOffset + 1; | 4472 static const int kFullCodeFlags = kOptimizableOffset + 1; |
4468 class FullCodeFlagsHasDeoptimizationSupportField: | 4473 class FullCodeFlagsHasDeoptimizationSupportField: |
4469 public BitField<bool, 0, 1> {}; // NOLINT | 4474 public BitField<bool, 0, 1> {}; // NOLINT |
4470 class FullCodeFlagsHasDebugBreakSlotsField: public BitField<bool, 1, 1> {}; | 4475 class FullCodeFlagsHasDebugBreakSlotsField: public BitField<bool, 1, 1> {}; |
4471 class FullCodeFlagsIsCompiledOptimizable: public BitField<bool, 2, 1> {}; | 4476 class FullCodeFlagsIsCompiledOptimizable: public BitField<bool, 2, 1> {}; |
4472 class FullCodeFlagsHasSelfOptimizationHeader: public BitField<bool, 3, 1> {}; | 4477 class FullCodeFlagsHasSelfOptimizationHeader: public BitField<bool, 3, 1> {}; |
4473 | 4478 |
4474 static const int kBinaryOpReturnTypeOffset = kBinaryOpTypeOffset + 1; | 4479 static const int kBinaryOpReturnTypeOffset = kBinaryOpTypeOffset + 1; |
4475 | 4480 |
4476 static const int kAllowOSRAtLoopNestingLevelOffset = kFullCodeFlags + 1; | 4481 static const int kAllowOSRAtLoopNestingLevelOffset = kFullCodeFlags + 1; |
| 4482 static const int kProfilerTicksOffset = kAllowOSRAtLoopNestingLevelOffset + 1; |
4477 | 4483 |
4478 static const int kSafepointTableOffsetOffset = kStackSlotsOffset + kIntSize; | 4484 static const int kSafepointTableOffsetOffset = kStackSlotsOffset + kIntSize; |
4479 static const int kStackCheckTableOffsetOffset = kStackSlotsOffset + kIntSize; | 4485 static const int kStackCheckTableOffsetOffset = kStackSlotsOffset + kIntSize; |
4480 | 4486 |
4481 // Flags layout. BitField<type, shift, size>. | 4487 // Flags layout. BitField<type, shift, size>. |
4482 class ICStateField: public BitField<InlineCacheState, 0, 3> {}; | 4488 class ICStateField: public BitField<InlineCacheState, 0, 3> {}; |
4483 class TypeField: public BitField<PropertyType, 3, 4> {}; | 4489 class TypeField: public BitField<PropertyType, 3, 4> {}; |
4484 class CacheHolderField: public BitField<InlineCacheHolderFlag, 7, 1> {}; | 4490 class CacheHolderField: public BitField<InlineCacheHolderFlag, 7, 1> {}; |
4485 class KindField: public BitField<Kind, 8, 4> {}; | 4491 class KindField: public BitField<Kind, 8, 4> {}; |
4486 class ExtraICStateField: public BitField<ExtraICState, 12, 2> {}; | 4492 class ExtraICStateField: public BitField<ExtraICState, 12, 2> {}; |
(...skipping 838 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5325 inline void set_compiler_hints(int value); | 5331 inline void set_compiler_hints(int value); |
5326 | 5332 |
5327 inline int ast_node_count(); | 5333 inline int ast_node_count(); |
5328 inline void set_ast_node_count(int count); | 5334 inline void set_ast_node_count(int count); |
5329 | 5335 |
5330 // A counter used to determine when to stress the deoptimizer with a | 5336 // A counter used to determine when to stress the deoptimizer with a |
5331 // deopt. | 5337 // deopt. |
5332 inline int deopt_counter(); | 5338 inline int deopt_counter(); |
5333 inline void set_deopt_counter(int counter); | 5339 inline void set_deopt_counter(int counter); |
5334 | 5340 |
5335 inline int profiler_ticks(); | |
5336 inline void set_profiler_ticks(int ticks); | |
5337 | |
5338 // Inline cache age is used to infer whether the function survived a context | 5341 // Inline cache age is used to infer whether the function survived a context |
5339 // disposal or not. In the former case we reset the opt_count. | 5342 // disposal or not. In the former case we reset the opt_count. |
5340 inline int ic_age(); | 5343 inline int ic_age(); |
5341 inline void set_ic_age(int age); | 5344 inline void set_ic_age(int age); |
5342 | 5345 |
5343 // Add information on assignments of the form this.x = ...; | 5346 // Add information on assignments of the form this.x = ...; |
5344 void SetThisPropertyAssignmentsInfo( | 5347 void SetThisPropertyAssignmentsInfo( |
5345 bool has_only_simple_this_property_assignments, | 5348 bool has_only_simple_this_property_assignments, |
5346 FixedArray* this_property_assignments); | 5349 FixedArray* this_property_assignments); |
5347 | 5350 |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5509 kConstructStubOffset + kPointerSize; | 5512 kConstructStubOffset + kPointerSize; |
5510 static const int kFunctionDataOffset = | 5513 static const int kFunctionDataOffset = |
5511 kInstanceClassNameOffset + kPointerSize; | 5514 kInstanceClassNameOffset + kPointerSize; |
5512 static const int kScriptOffset = kFunctionDataOffset + kPointerSize; | 5515 static const int kScriptOffset = kFunctionDataOffset + kPointerSize; |
5513 static const int kDebugInfoOffset = kScriptOffset + kPointerSize; | 5516 static const int kDebugInfoOffset = kScriptOffset + kPointerSize; |
5514 static const int kInferredNameOffset = kDebugInfoOffset + kPointerSize; | 5517 static const int kInferredNameOffset = kDebugInfoOffset + kPointerSize; |
5515 static const int kInitialMapOffset = | 5518 static const int kInitialMapOffset = |
5516 kInferredNameOffset + kPointerSize; | 5519 kInferredNameOffset + kPointerSize; |
5517 static const int kThisPropertyAssignmentsOffset = | 5520 static const int kThisPropertyAssignmentsOffset = |
5518 kInitialMapOffset + kPointerSize; | 5521 kInitialMapOffset + kPointerSize; |
| 5522 // ic_age is a Smi field. It could be grouped with another Smi field into a |
| 5523 // PSEUDO_SMI_ACCESSORS pair (on x64), if one becomes available. |
| 5524 static const int kICAgeOffset = kThisPropertyAssignmentsOffset + kPointerSize; |
5519 #if V8_HOST_ARCH_32_BIT | 5525 #if V8_HOST_ARCH_32_BIT |
5520 // Smi fields. | 5526 // Smi fields. |
5521 static const int kLengthOffset = | 5527 static const int kLengthOffset = |
5522 kThisPropertyAssignmentsOffset + kPointerSize; | 5528 kICAgeOffset + kPointerSize; |
5523 static const int kFormalParameterCountOffset = kLengthOffset + kPointerSize; | 5529 static const int kFormalParameterCountOffset = kLengthOffset + kPointerSize; |
5524 static const int kExpectedNofPropertiesOffset = | 5530 static const int kExpectedNofPropertiesOffset = |
5525 kFormalParameterCountOffset + kPointerSize; | 5531 kFormalParameterCountOffset + kPointerSize; |
5526 static const int kNumLiteralsOffset = | 5532 static const int kNumLiteralsOffset = |
5527 kExpectedNofPropertiesOffset + kPointerSize; | 5533 kExpectedNofPropertiesOffset + kPointerSize; |
5528 static const int kStartPositionAndTypeOffset = | 5534 static const int kStartPositionAndTypeOffset = |
5529 kNumLiteralsOffset + kPointerSize; | 5535 kNumLiteralsOffset + kPointerSize; |
5530 static const int kEndPositionOffset = | 5536 static const int kEndPositionOffset = |
5531 kStartPositionAndTypeOffset + kPointerSize; | 5537 kStartPositionAndTypeOffset + kPointerSize; |
5532 static const int kFunctionTokenPositionOffset = | 5538 static const int kFunctionTokenPositionOffset = |
5533 kEndPositionOffset + kPointerSize; | 5539 kEndPositionOffset + kPointerSize; |
5534 static const int kCompilerHintsOffset = | 5540 static const int kCompilerHintsOffset = |
5535 kFunctionTokenPositionOffset + kPointerSize; | 5541 kFunctionTokenPositionOffset + kPointerSize; |
5536 static const int kThisPropertyAssignmentsCountOffset = | 5542 static const int kThisPropertyAssignmentsCountOffset = |
5537 kCompilerHintsOffset + kPointerSize; | 5543 kCompilerHintsOffset + kPointerSize; |
5538 static const int kOptCountOffset = | 5544 static const int kOptCountOffset = |
5539 kThisPropertyAssignmentsCountOffset + kPointerSize; | 5545 kThisPropertyAssignmentsCountOffset + kPointerSize; |
5540 static const int kAstNodeCountOffset = kOptCountOffset + kPointerSize; | 5546 static const int kAstNodeCountOffset = kOptCountOffset + kPointerSize; |
5541 static const int kDeoptCounterOffset = kAstNodeCountOffset + kPointerSize; | 5547 static const int kDeoptCounterOffset = kAstNodeCountOffset + kPointerSize; |
5542 static const int kProfilerTicksOffset = kDeoptCounterOffset + kPointerSize; | 5548 |
5543 static const int kICAgeOffset = kProfilerTicksOffset + kPointerSize; | |
5544 | 5549 |
5545 // Total size. | 5550 // Total size. |
5546 static const int kSize = kICAgeOffset + kPointerSize; | 5551 static const int kSize = kDeoptCounterOffset + kPointerSize; |
5547 #else | 5552 #else |
5548 // The only reason to use smi fields instead of int fields | 5553 // The only reason to use smi fields instead of int fields |
5549 // is to allow iteration without maps decoding during | 5554 // is to allow iteration without maps decoding during |
5550 // garbage collections. | 5555 // garbage collections. |
5551 // To avoid wasting space on 64-bit architectures we use | 5556 // To avoid wasting space on 64-bit architectures we use |
5552 // the following trick: we group integer fields into pairs | 5557 // the following trick: we group integer fields into pairs |
5553 // First integer in each pair is shifted left by 1. | 5558 // First integer in each pair is shifted left by 1. |
5554 // By doing this we guarantee that LSB of each kPointerSize aligned | 5559 // By doing this we guarantee that LSB of each kPointerSize aligned |
5555 // word is not set and thus this word cannot be treated as pointer | 5560 // word is not set and thus this word cannot be treated as pointer |
5556 // to HeapObject during old space traversal. | 5561 // to HeapObject during old space traversal. |
5557 static const int kLengthOffset = | 5562 static const int kLengthOffset = |
5558 kThisPropertyAssignmentsOffset + kPointerSize; | 5563 kICAgeOffset + kPointerSize; |
5559 static const int kFormalParameterCountOffset = | 5564 static const int kFormalParameterCountOffset = |
5560 kLengthOffset + kIntSize; | 5565 kLengthOffset + kIntSize; |
5561 | 5566 |
5562 static const int kExpectedNofPropertiesOffset = | 5567 static const int kExpectedNofPropertiesOffset = |
5563 kFormalParameterCountOffset + kIntSize; | 5568 kFormalParameterCountOffset + kIntSize; |
5564 static const int kNumLiteralsOffset = | 5569 static const int kNumLiteralsOffset = |
5565 kExpectedNofPropertiesOffset + kIntSize; | 5570 kExpectedNofPropertiesOffset + kIntSize; |
5566 | 5571 |
5567 static const int kEndPositionOffset = | 5572 static const int kEndPositionOffset = |
5568 kNumLiteralsOffset + kIntSize; | 5573 kNumLiteralsOffset + kIntSize; |
5569 static const int kStartPositionAndTypeOffset = | 5574 static const int kStartPositionAndTypeOffset = |
5570 kEndPositionOffset + kIntSize; | 5575 kEndPositionOffset + kIntSize; |
5571 | 5576 |
5572 static const int kFunctionTokenPositionOffset = | 5577 static const int kFunctionTokenPositionOffset = |
5573 kStartPositionAndTypeOffset + kIntSize; | 5578 kStartPositionAndTypeOffset + kIntSize; |
5574 static const int kCompilerHintsOffset = | 5579 static const int kCompilerHintsOffset = |
5575 kFunctionTokenPositionOffset + kIntSize; | 5580 kFunctionTokenPositionOffset + kIntSize; |
5576 | 5581 |
5577 static const int kThisPropertyAssignmentsCountOffset = | 5582 static const int kThisPropertyAssignmentsCountOffset = |
5578 kCompilerHintsOffset + kIntSize; | 5583 kCompilerHintsOffset + kIntSize; |
5579 static const int kOptCountOffset = | 5584 static const int kOptCountOffset = |
5580 kThisPropertyAssignmentsCountOffset + kIntSize; | 5585 kThisPropertyAssignmentsCountOffset + kIntSize; |
5581 | 5586 |
5582 static const int kAstNodeCountOffset = kOptCountOffset + kIntSize; | 5587 static const int kAstNodeCountOffset = kOptCountOffset + kIntSize; |
5583 static const int kDeoptCounterOffset = kAstNodeCountOffset + kIntSize; | 5588 static const int kDeoptCounterOffset = kAstNodeCountOffset + kIntSize; |
5584 | 5589 |
5585 | |
5586 static const int kProfilerTicksOffset = kDeoptCounterOffset + kIntSize; | |
5587 static const int kICAgeOffset = kProfilerTicksOffset + kIntSize; | |
5588 | |
5589 // Total size. | 5590 // Total size. |
5590 static const int kSize = kICAgeOffset + kIntSize; | 5591 static const int kSize = kDeoptCounterOffset + kIntSize; |
5591 | 5592 |
5592 #endif | 5593 #endif |
5593 | 5594 |
5594 // The construction counter for inobject slack tracking is stored in the | 5595 // The construction counter for inobject slack tracking is stored in the |
5595 // most significant byte of compiler_hints which is otherwise unused. | 5596 // most significant byte of compiler_hints which is otherwise unused. |
5596 // Its offset depends on the endian-ness of the architecture. | 5597 // Its offset depends on the endian-ness of the architecture. |
5597 #if __BYTE_ORDER == __LITTLE_ENDIAN | 5598 #if __BYTE_ORDER == __LITTLE_ENDIAN |
5598 static const int kConstructionCountOffset = kCompilerHintsOffset + 3; | 5599 static const int kConstructionCountOffset = kCompilerHintsOffset + 3; |
5599 #elif __BYTE_ORDER == __BIG_ENDIAN | 5600 #elif __BYTE_ORDER == __BIG_ENDIAN |
5600 static const int kConstructionCountOffset = kCompilerHintsOffset + 0; | 5601 static const int kConstructionCountOffset = kCompilerHintsOffset + 0; |
(...skipping 2994 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8595 } else { | 8596 } else { |
8596 value &= ~(1 << bit_position); | 8597 value &= ~(1 << bit_position); |
8597 } | 8598 } |
8598 return value; | 8599 return value; |
8599 } | 8600 } |
8600 }; | 8601 }; |
8601 | 8602 |
8602 } } // namespace v8::internal | 8603 } } // namespace v8::internal |
8603 | 8604 |
8604 #endif // V8_OBJECTS_H_ | 8605 #endif // V8_OBJECTS_H_ |
OLD | NEW |