Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(29)

Side by Side Diff: src/objects.h

Issue 10202007: Re-enable optimization for hot functions that have optimization disabled due to many deopts. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: fix 64-bit compile error Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/heap.cc ('k') | src/objects.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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.
5560 static const int kLengthOffset = 5564 static const int kLengthOffset =
5561 kICAgeOffset + kPointerSize; 5565 kThisPropertyAssignmentsOffset + kPointerSize;
5562 static const int kFormalParameterCountOffset = 5566 static const int kFormalParameterCountOffset =
5563 kLengthOffset + kIntSize; 5567 kLengthOffset + kIntSize;
5564 5568
5565 static const int kExpectedNofPropertiesOffset = 5569 static const int kExpectedNofPropertiesOffset =
5566 kFormalParameterCountOffset + kIntSize; 5570 kFormalParameterCountOffset + kIntSize;
5567 static const int kNumLiteralsOffset = 5571 static const int kNumLiteralsOffset =
5568 kExpectedNofPropertiesOffset + kIntSize; 5572 kExpectedNofPropertiesOffset + kIntSize;
5569 5573
5570 static const int kEndPositionOffset = 5574 static const int kEndPositionOffset =
5571 kNumLiteralsOffset + kIntSize; 5575 kNumLiteralsOffset + kIntSize;
5572 static const int kStartPositionAndTypeOffset = 5576 static const int kStartPositionAndTypeOffset =
5573 kEndPositionOffset + kIntSize; 5577 kEndPositionOffset + kIntSize;
5574 5578
5575 static const int kFunctionTokenPositionOffset = 5579 static const int kFunctionTokenPositionOffset =
5576 kStartPositionAndTypeOffset + kIntSize; 5580 kStartPositionAndTypeOffset + kIntSize;
5577 static const int kCompilerHintsOffset = 5581 static const int kCompilerHintsOffset =
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
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_
OLDNEW
« no previous file with comments | « src/heap.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698