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 5443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5454 int GetThisPropertyAssignmentArgument(int index); | 5454 int GetThisPropertyAssignmentArgument(int index); |
5455 Object* GetThisPropertyAssignmentConstant(int index); | 5455 Object* GetThisPropertyAssignmentConstant(int index); |
5456 | 5456 |
5457 // [source code]: Source code for the function. | 5457 // [source code]: Source code for the function. |
5458 bool HasSourceCode(); | 5458 bool HasSourceCode(); |
5459 Handle<Object> GetSourceCode(); | 5459 Handle<Object> GetSourceCode(); |
5460 | 5460 |
5461 inline int opt_count(); | 5461 inline int opt_count(); |
5462 inline void set_opt_count(int opt_count); | 5462 inline void set_opt_count(int opt_count); |
5463 | 5463 |
5464 // Number of times we tried to reenable optimization. | |
5465 inline int opt_reenable_tries(); | |
5466 inline void set_opt_reenable_tries(int opt_reenable_tries); | |
5467 | |
5468 inline void TryReenableOptimization(); | |
5469 | |
5470 | |
5471 // Source size of this function. | 5464 // Source size of this function. |
5472 int SourceSize(); | 5465 int SourceSize(); |
5473 | 5466 |
5474 // Calculate the instance size. | 5467 // Calculate the instance size. |
5475 int CalculateInstanceSize(); | 5468 int CalculateInstanceSize(); |
5476 | 5469 |
5477 // Calculate the number of in-object properties. | 5470 // Calculate the number of in-object properties. |
5478 int CalculateInObjectProperties(); | 5471 int CalculateInObjectProperties(); |
5479 | 5472 |
5480 // Dispatched behavior. | 5473 // Dispatched behavior. |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5517 kConstructStubOffset + kPointerSize; | 5510 kConstructStubOffset + kPointerSize; |
5518 static const int kFunctionDataOffset = | 5511 static const int kFunctionDataOffset = |
5519 kInstanceClassNameOffset + kPointerSize; | 5512 kInstanceClassNameOffset + kPointerSize; |
5520 static const int kScriptOffset = kFunctionDataOffset + kPointerSize; | 5513 static const int kScriptOffset = kFunctionDataOffset + kPointerSize; |
5521 static const int kDebugInfoOffset = kScriptOffset + kPointerSize; | 5514 static const int kDebugInfoOffset = kScriptOffset + kPointerSize; |
5522 static const int kInferredNameOffset = kDebugInfoOffset + kPointerSize; | 5515 static const int kInferredNameOffset = kDebugInfoOffset + kPointerSize; |
5523 static const int kInitialMapOffset = | 5516 static const int kInitialMapOffset = |
5524 kInferredNameOffset + kPointerSize; | 5517 kInferredNameOffset + kPointerSize; |
5525 static const int kThisPropertyAssignmentsOffset = | 5518 static const int kThisPropertyAssignmentsOffset = |
5526 kInitialMapOffset + kPointerSize; | 5519 kInitialMapOffset + kPointerSize; |
| 5520 // ic_age is a Smi field. It could be grouped with another Smi field into a |
| 5521 // PSEUDO_SMI_ACCESSORS pair (on x64), if one becomes available. |
| 5522 static const int kICAgeOffset = kThisPropertyAssignmentsOffset + kPointerSize; |
5527 #if V8_HOST_ARCH_32_BIT | 5523 #if V8_HOST_ARCH_32_BIT |
5528 // Smi fields. | 5524 // Smi fields. |
5529 static const int kLengthOffset = | 5525 static const int kLengthOffset = |
5530 kThisPropertyAssignmentsOffset + kPointerSize; | 5526 kICAgeOffset + kPointerSize; |
5531 static const int kFormalParameterCountOffset = kLengthOffset + kPointerSize; | 5527 static const int kFormalParameterCountOffset = kLengthOffset + kPointerSize; |
5532 static const int kExpectedNofPropertiesOffset = | 5528 static const int kExpectedNofPropertiesOffset = |
5533 kFormalParameterCountOffset + kPointerSize; | 5529 kFormalParameterCountOffset + kPointerSize; |
5534 static const int kNumLiteralsOffset = | 5530 static const int kNumLiteralsOffset = |
5535 kExpectedNofPropertiesOffset + kPointerSize; | 5531 kExpectedNofPropertiesOffset + kPointerSize; |
5536 static const int kStartPositionAndTypeOffset = | 5532 static const int kStartPositionAndTypeOffset = |
5537 kNumLiteralsOffset + kPointerSize; | 5533 kNumLiteralsOffset + kPointerSize; |
5538 static const int kEndPositionOffset = | 5534 static const int kEndPositionOffset = |
5539 kStartPositionAndTypeOffset + kPointerSize; | 5535 kStartPositionAndTypeOffset + kPointerSize; |
5540 static const int kFunctionTokenPositionOffset = | 5536 static const int kFunctionTokenPositionOffset = |
5541 kEndPositionOffset + kPointerSize; | 5537 kEndPositionOffset + kPointerSize; |
5542 static const int kCompilerHintsOffset = | 5538 static const int kCompilerHintsOffset = |
5543 kFunctionTokenPositionOffset + kPointerSize; | 5539 kFunctionTokenPositionOffset + kPointerSize; |
5544 static const int kThisPropertyAssignmentsCountOffset = | 5540 static const int kThisPropertyAssignmentsCountOffset = |
5545 kCompilerHintsOffset + kPointerSize; | 5541 kCompilerHintsOffset + kPointerSize; |
5546 static const int kOptCountOffset = | 5542 static const int kOptCountOffset = |
5547 kThisPropertyAssignmentsCountOffset + kPointerSize; | 5543 kThisPropertyAssignmentsCountOffset + kPointerSize; |
5548 static const int kAstNodeCountOffset = kOptCountOffset + kPointerSize; | 5544 static const int kAstNodeCountOffset = kOptCountOffset + kPointerSize; |
5549 static const int kDeoptCounterOffset = kAstNodeCountOffset + kPointerSize; | 5545 static const int kDeoptCounterOffset = kAstNodeCountOffset + kPointerSize; |
5550 static const int kICAgeOffset = kDeoptCounterOffset + kPointerSize; | 5546 |
5551 static const int kOptReenableTriesOffset = kICAgeOffset + kPointerSize; | 5547 |
5552 // Total size. | 5548 // Total size. |
5553 static const int kSize = kOptReenableTriesOffset + kPointerSize; | 5549 static const int kSize = kDeoptCounterOffset + kPointerSize; |
5554 #else | 5550 #else |
5555 // The only reason to use smi fields instead of int fields | 5551 // The only reason to use smi fields instead of int fields |
5556 // is to allow iteration without maps decoding during | 5552 // is to allow iteration without maps decoding during |
5557 // garbage collections. | 5553 // garbage collections. |
5558 // To avoid wasting space on 64-bit architectures we use | 5554 // To avoid wasting space on 64-bit architectures we use |
5559 // the following trick: we group integer fields into pairs | 5555 // the following trick: we group integer fields into pairs |
5560 // First integer in each pair is shifted left by 1. | 5556 // First integer in each pair is shifted left by 1. |
5561 // By doing this we guarantee that LSB of each kPointerSize aligned | 5557 // By doing this we guarantee that LSB of each kPointerSize aligned |
5562 // word is not set and thus this word cannot be treated as pointer | 5558 // word is not set and thus this word cannot be treated as pointer |
5563 // to HeapObject during old space traversal. | 5559 // to HeapObject during old space traversal. |
5564 static const int kLengthOffset = | 5560 static const int kLengthOffset = |
5565 kThisPropertyAssignmentsOffset + kPointerSize; | 5561 kICAgeOffset + kPointerSize; |
5566 static const int kFormalParameterCountOffset = | 5562 static const int kFormalParameterCountOffset = |
5567 kLengthOffset + kIntSize; | 5563 kLengthOffset + kIntSize; |
5568 | 5564 |
5569 static const int kExpectedNofPropertiesOffset = | 5565 static const int kExpectedNofPropertiesOffset = |
5570 kFormalParameterCountOffset + kIntSize; | 5566 kFormalParameterCountOffset + kIntSize; |
5571 static const int kNumLiteralsOffset = | 5567 static const int kNumLiteralsOffset = |
5572 kExpectedNofPropertiesOffset + kIntSize; | 5568 kExpectedNofPropertiesOffset + kIntSize; |
5573 | 5569 |
5574 static const int kEndPositionOffset = | 5570 static const int kEndPositionOffset = |
5575 kNumLiteralsOffset + kIntSize; | 5571 kNumLiteralsOffset + kIntSize; |
5576 static const int kStartPositionAndTypeOffset = | 5572 static const int kStartPositionAndTypeOffset = |
5577 kEndPositionOffset + kIntSize; | 5573 kEndPositionOffset + kIntSize; |
5578 | 5574 |
5579 static const int kFunctionTokenPositionOffset = | 5575 static const int kFunctionTokenPositionOffset = |
5580 kStartPositionAndTypeOffset + kIntSize; | 5576 kStartPositionAndTypeOffset + kIntSize; |
5581 static const int kCompilerHintsOffset = | 5577 static const int kCompilerHintsOffset = |
5582 kFunctionTokenPositionOffset + kIntSize; | 5578 kFunctionTokenPositionOffset + kIntSize; |
5583 | 5579 |
5584 static const int kThisPropertyAssignmentsCountOffset = | 5580 static const int kThisPropertyAssignmentsCountOffset = |
5585 kCompilerHintsOffset + kIntSize; | 5581 kCompilerHintsOffset + kIntSize; |
5586 static const int kOptCountOffset = | 5582 static const int kOptCountOffset = |
5587 kThisPropertyAssignmentsCountOffset + kIntSize; | 5583 kThisPropertyAssignmentsCountOffset + kIntSize; |
5588 | 5584 |
5589 static const int kAstNodeCountOffset = kOptCountOffset + kIntSize; | 5585 static const int kAstNodeCountOffset = kOptCountOffset + kIntSize; |
5590 static const int kDeoptCounterOffset = kAstNodeCountOffset + kIntSize; | 5586 static const int kDeoptCounterOffset = kAstNodeCountOffset + kIntSize; |
5591 | 5587 |
5592 static const int kICAgeOffset = kDeoptCounterOffset + kIntSize; | |
5593 static const int kOptReenableTriesOffset = kICAgeOffset + kIntSize; | |
5594 | |
5595 // Total size. | 5588 // Total size. |
5596 static const int kSize = kOptReenableTriesOffset + kIntSize; | 5589 static const int kSize = kDeoptCounterOffset + kIntSize; |
5597 | 5590 |
5598 #endif | 5591 #endif |
5599 | 5592 |
5600 // The construction counter for inobject slack tracking is stored in the | 5593 // The construction counter for inobject slack tracking is stored in the |
5601 // most significant byte of compiler_hints which is otherwise unused. | 5594 // most significant byte of compiler_hints which is otherwise unused. |
5602 // Its offset depends on the endian-ness of the architecture. | 5595 // Its offset depends on the endian-ness of the architecture. |
5603 #if __BYTE_ORDER == __LITTLE_ENDIAN | 5596 #if __BYTE_ORDER == __LITTLE_ENDIAN |
5604 static const int kConstructionCountOffset = kCompilerHintsOffset + 3; | 5597 static const int kConstructionCountOffset = kCompilerHintsOffset + 3; |
5605 #elif __BYTE_ORDER == __BIG_ENDIAN | 5598 #elif __BYTE_ORDER == __BIG_ENDIAN |
5606 static const int kConstructionCountOffset = kCompilerHintsOffset + 0; | 5599 static const int kConstructionCountOffset = kCompilerHintsOffset + 0; |
(...skipping 3029 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8636 } else { | 8629 } else { |
8637 value &= ~(1 << bit_position); | 8630 value &= ~(1 << bit_position); |
8638 } | 8631 } |
8639 return value; | 8632 return value; |
8640 } | 8633 } |
8641 }; | 8634 }; |
8642 | 8635 |
8643 } } // namespace v8::internal | 8636 } } // namespace v8::internal |
8644 | 8637 |
8645 #endif // V8_OBJECTS_H_ | 8638 #endif // V8_OBJECTS_H_ |
OLD | NEW |