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

Side by Side Diff: src/objects.h

Issue 1030353003: Enable constant pool support. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 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
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_OBJECTS_H_ 5 #ifndef V8_OBJECTS_H_
6 #define V8_OBJECTS_H_ 6 #define V8_OBJECTS_H_
7 7
8 #include <iosfwd> 8 #include <iosfwd>
9 9
10 #include "src/allocation.h" 10 #include "src/allocation.h"
(...skipping 5239 matching lines...) Expand 10 before | Expand all | Expand 10 after
5250 // [ic_age]: Inline caching age: the value of the Heap::global_ic_age 5250 // [ic_age]: Inline caching age: the value of the Heap::global_ic_age
5251 // at the moment when this object was created. 5251 // at the moment when this object was created.
5252 inline void set_ic_age(int count); 5252 inline void set_ic_age(int count);
5253 inline int ic_age() const; 5253 inline int ic_age() const;
5254 5254
5255 // [prologue_offset]: Offset of the function prologue, used for aging 5255 // [prologue_offset]: Offset of the function prologue, used for aging
5256 // FUNCTIONs and OPTIMIZED_FUNCTIONs. 5256 // FUNCTIONs and OPTIMIZED_FUNCTIONs.
5257 inline int prologue_offset() const; 5257 inline int prologue_offset() const;
5258 inline void set_prologue_offset(int offset); 5258 inline void set_prologue_offset(int offset);
5259 5259
5260 // [constant_pool offset]: Offset of the constant pool.
5261 // Valid for FLAG_enable_embedded_constant_pool only
5262 inline int constant_pool_offset() const;
5263 inline void set_constant_pool_offset(int offset);
5264
5260 // Unchecked accessors to be used during GC. 5265 // Unchecked accessors to be used during GC.
5261 inline ByteArray* unchecked_relocation_info(); 5266 inline ByteArray* unchecked_relocation_info();
5262 5267
5263 inline int relocation_size(); 5268 inline int relocation_size();
5264 5269
5265 // [flags]: Various code flags. 5270 // [flags]: Various code flags.
5266 inline Flags flags(); 5271 inline Flags flags();
5267 inline void set_flags(Flags flags); 5272 inline void set_flags(Flags flags);
5268 5273
5269 // [flags]: Access to specific code flags. 5274 // [flags]: Access to specific code flags.
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
5387 inline bool has_function_cache(); 5392 inline bool has_function_cache();
5388 inline void set_has_function_cache(bool flag); 5393 inline void set_has_function_cache(bool flag);
5389 5394
5390 5395
5391 // [marked_for_deoptimization]: For kind OPTIMIZED_FUNCTION tells whether 5396 // [marked_for_deoptimization]: For kind OPTIMIZED_FUNCTION tells whether
5392 // the code is going to be deoptimized because of dead embedded maps. 5397 // the code is going to be deoptimized because of dead embedded maps.
5393 inline bool marked_for_deoptimization(); 5398 inline bool marked_for_deoptimization();
5394 inline void set_marked_for_deoptimization(bool flag); 5399 inline void set_marked_for_deoptimization(bool flag);
5395 5400
5396 // [constant_pool]: The constant pool for this function. 5401 // [constant_pool]: The constant pool for this function.
5397 inline ConstantPoolArray* constant_pool(); 5402 inline Address constant_pool();
5403 // Valid for FLAG_enable_ool_constant_pool only
5398 inline void set_constant_pool(Object* constant_pool); 5404 inline void set_constant_pool(Object* constant_pool);
5399 5405
5400 // Get the safepoint entry for the given pc. 5406 // Get the safepoint entry for the given pc.
5401 SafepointEntry GetSafepointEntry(Address pc); 5407 SafepointEntry GetSafepointEntry(Address pc);
5402 5408
5403 // Find an object in a stub with a specified map 5409 // Find an object in a stub with a specified map
5404 Object* FindNthObject(int n, Map* match_map); 5410 Object* FindNthObject(int n, Map* match_map);
5405 5411
5406 // Find the first allocation site in an IC stub. 5412 // Find the first allocation site in an IC stub.
5407 AllocationSite* FindFirstAllocationSite(); 5413 AllocationSite* FindFirstAllocationSite();
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
5590 5596
5591 static inline bool IsWeakObjectInOptimizedCode(Object* object); 5597 static inline bool IsWeakObjectInOptimizedCode(Object* object);
5592 5598
5593 static Handle<WeakCell> WeakCellFor(Handle<Code> code); 5599 static Handle<WeakCell> WeakCellFor(Handle<Code> code);
5594 WeakCell* CachedWeakCell(); 5600 WeakCell* CachedWeakCell();
5595 5601
5596 // Max loop nesting marker used to postpose OSR. We don't take loop 5602 // Max loop nesting marker used to postpose OSR. We don't take loop
5597 // nesting that is deeper than 5 levels into account. 5603 // nesting that is deeper than 5 levels into account.
5598 static const int kMaxLoopNestingMarker = 6; 5604 static const int kMaxLoopNestingMarker = 6;
5599 5605
5606 static const int kOOLCPSize =
5607 FLAG_enable_ool_constant_pool ? kPointerSize : 0;
5608 static const int kECPSize = FLAG_enable_embedded_constant_pool ? kIntSize : 0;
5609
5600 // Layout description. 5610 // Layout description.
5601 static const int kRelocationInfoOffset = HeapObject::kHeaderSize; 5611 static const int kRelocationInfoOffset = HeapObject::kHeaderSize;
5602 static const int kHandlerTableOffset = kRelocationInfoOffset + kPointerSize; 5612 static const int kHandlerTableOffset = kRelocationInfoOffset + kPointerSize;
5603 static const int kDeoptimizationDataOffset = 5613 static const int kDeoptimizationDataOffset =
5604 kHandlerTableOffset + kPointerSize; 5614 kHandlerTableOffset + kPointerSize;
5605 // For FUNCTION kind, we store the type feedback info here. 5615 // For FUNCTION kind, we store the type feedback info here.
5606 static const int kTypeFeedbackInfoOffset = 5616 static const int kTypeFeedbackInfoOffset =
5607 kDeoptimizationDataOffset + kPointerSize; 5617 kDeoptimizationDataOffset + kPointerSize;
5608 static const int kNextCodeLinkOffset = kTypeFeedbackInfoOffset + kPointerSize; 5618 static const int kNextCodeLinkOffset = kTypeFeedbackInfoOffset + kPointerSize;
5609 static const int kGCMetadataOffset = kNextCodeLinkOffset + kPointerSize; 5619 static const int kGCMetadataOffset = kNextCodeLinkOffset + kPointerSize;
5610 static const int kInstructionSizeOffset = kGCMetadataOffset + kPointerSize; 5620 static const int kInstructionSizeOffset = kGCMetadataOffset + kPointerSize;
5611 static const int kICAgeOffset = kInstructionSizeOffset + kIntSize; 5621 static const int kICAgeOffset = kInstructionSizeOffset + kIntSize;
5612 static const int kFlagsOffset = kICAgeOffset + kIntSize; 5622 static const int kFlagsOffset = kICAgeOffset + kIntSize;
5613 static const int kKindSpecificFlags1Offset = kFlagsOffset + kIntSize; 5623 static const int kKindSpecificFlags1Offset = kFlagsOffset + kIntSize;
5614 static const int kKindSpecificFlags2Offset = 5624 static const int kKindSpecificFlags2Offset =
5615 kKindSpecificFlags1Offset + kIntSize; 5625 kKindSpecificFlags1Offset + kIntSize;
5616 // Note: We might be able to squeeze this into the flags above. 5626 // Note: We might be able to squeeze this into the flags above.
5617 static const int kPrologueOffset = kKindSpecificFlags2Offset + kIntSize; 5627 static const int kPrologueOffset = kKindSpecificFlags2Offset + kIntSize;
5618 static const int kConstantPoolOffset = kPrologueOffset + kIntSize; 5628 static const int kOOLConstantPoolOffset = kPrologueOffset + kIntSize;
rmcilroy 2015/04/08 12:38:55 Let's just have a single field here which points t
MTBrandyberry 2015/05/07 20:38:32 Acknowledged.
5629 static const int kEmbeddedConstantPoolOffset =
5630 kOOLConstantPoolOffset + kOOLCPSize;
5631 static const int kHeaderPaddingStart = kEmbeddedConstantPoolOffset + kECPSize;
5619 5632
5620 static const int kHeaderPaddingStart = kConstantPoolOffset + kPointerSize; 5633 static const int kConstantPoolOffset =
5634 kOOLCPSize ? kOOLConstantPoolOffset
5635 : (kECPSize ? kEmbeddedConstantPoolOffset : 0);
5621 5636
5622 // Add padding to align the instruction start following right after 5637 // Add padding to align the instruction start following right after
5623 // the Code object header. 5638 // the Code object header.
5624 static const int kHeaderSize = 5639 static const int kHeaderSize =
5625 (kHeaderPaddingStart + kCodeAlignmentMask) & ~kCodeAlignmentMask; 5640 (kHeaderPaddingStart + kCodeAlignmentMask) & ~kCodeAlignmentMask;
5626 // Ensure that the slot for the constant pool pointer is aligned. 5641 // Ensure that the slot for the constant pool pointer is aligned.
5627 STATIC_ASSERT((kConstantPoolOffset & kPointerAlignmentMask) == 0); 5642 STATIC_ASSERT(kOOLCPSize == 0 ||
5643 (kOOLConstantPoolOffset & kPointerAlignmentMask) == 0);
5628 5644
5629 // Byte offsets within kKindSpecificFlags1Offset. 5645 // Byte offsets within kKindSpecificFlags1Offset.
5630 static const int kOptimizableOffset = kKindSpecificFlags1Offset; 5646 static const int kOptimizableOffset = kKindSpecificFlags1Offset;
5631 5647
5632 static const int kFullCodeFlags = kOptimizableOffset + 1; 5648 static const int kFullCodeFlags = kOptimizableOffset + 1;
5633 class FullCodeFlagsHasDeoptimizationSupportField: 5649 class FullCodeFlagsHasDeoptimizationSupportField:
5634 public BitField<bool, 0, 1> {}; // NOLINT 5650 public BitField<bool, 0, 1> {}; // NOLINT
5635 class FullCodeFlagsHasDebugBreakSlotsField: public BitField<bool, 1, 1> {}; 5651 class FullCodeFlagsHasDebugBreakSlotsField: public BitField<bool, 1, 1> {};
5636 class FullCodeFlagsIsCompiledOptimizable: public BitField<bool, 2, 1> {}; 5652 class FullCodeFlagsIsCompiledOptimizable: public BitField<bool, 2, 1> {};
5637 class FullCodeFlagsHasRelocInfoForSerialization 5653 class FullCodeFlagsHasRelocInfoForSerialization
(...skipping 5434 matching lines...) Expand 10 before | Expand all | Expand 10 after
11072 } else { 11088 } else {
11073 value &= ~(1 << bit_position); 11089 value &= ~(1 << bit_position);
11074 } 11090 }
11075 return value; 11091 return value;
11076 } 11092 }
11077 }; 11093 };
11078 11094
11079 } } // namespace v8::internal 11095 } } // namespace v8::internal
11080 11096
11081 #endif // V8_OBJECTS_H_ 11097 #endif // V8_OBJECTS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698