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