28 #ifndef V8_HYDROGEN_GVN_H_
29 #define V8_HYDROGEN_GVN_H_
51 bool IsEmpty()
const {
return bits_ == 0; }
53 return (bits_ & MaskFlag(flag)) != 0;
56 return (bits_ & MaskSpecial(special)) != 0;
58 bool ContainsAnyOf(SideEffects set)
const {
return (bits_ & set.bits_) != 0; }
59 void Add(SideEffects set) { bits_ |= set.bits_; }
60 void AddSpecial(
int special) { bits_ |= MaskSpecial(special); }
68 return static_cast<uint64_t
>(1) << static_cast<unsigned>(flag);
70 uint64_t MaskSpecial(
int special)
const {
72 ASSERT(special < kNumberOfSpecials);
73 return static_cast<uint64_t
>(1) << static_cast<unsigned>(
91 void PrintSideEffectsTo(
StringStream* stream, SideEffects side_effects)
const;
94 bool ComputeGlobalVar(Unique<Cell> cell,
int* index);
95 bool ComputeInobjectField(HObjectAccess access,
int* index);
97 static int GlobalVar(
int index) {
99 ASSERT(index < kNumberOfGlobalVars);
102 static int InobjectField(
int index) {
104 ASSERT(index < kNumberOfInobjectFields);
105 return index + kNumberOfGlobalVars;
109 static const int kNumberOfGlobalVars = 4;
110 Unique<Cell> global_vars_[kNumberOfGlobalVars];
111 int num_global_vars_;
114 static const int kNumberOfInobjectFields =
115 SideEffects::kNumberOfSpecials - kNumberOfGlobalVars;
116 HObjectAccess inobject_fields_[kNumberOfInobjectFields];
117 int num_inobject_fields_;
122 class HGlobalValueNumberingPhase
V8_FINAL :
public HPhase {
124 explicit HGlobalValueNumberingPhase(HGraph* graph);
129 SideEffects CollectSideEffectsOnPathsToDominatedBlock(
130 HBasicBlock* dominator,
131 HBasicBlock* dominated);
133 void ComputeBlockSideEffects();
134 void LoopInvariantCodeMotion();
135 void ProcessLoopBlock(HBasicBlock* block,
136 HBasicBlock* before_loop,
137 SideEffects loop_kills);
138 bool AllowCodeMotion();
139 bool ShouldMove(HInstruction* instr, HBasicBlock* loop_header);
141 SideEffectsTracker side_effects_tracker_;
142 bool removed_side_effects_;
145 ZoneList<SideEffects> block_side_effects_;
148 ZoneList<SideEffects> loop_side_effects_;
152 BitVector visited_on_paths_;
159 #endif // V8_HYDROGEN_GVN_H_
void AddSpecial(int special)
void RemoveFlag(GVNFlag flag)
uint64_t ToIntegral() const
bool ContainsSpecial(int special) const
#define ASSERT(condition)
SideEffects(GVNFlagSet flags)
kInstanceClassNameOffset flag
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter trace hydrogen to given file name trace inlining decisions trace store elimination trace all use positions trace global value numbering trace hydrogen escape analysis trace the tracking of allocation sites trace map generalization environment for every instruction deoptimize every n garbage collections put a break point before deoptimizing deoptimize uncommon cases use on stack replacement trace array bounds check elimination perform array index dehoisting use load elimination use store elimination use constant folding eliminate unreachable code number of stress runs when picking a function to watch for shared function not JSFunction itself flushes the cache of optimized code for closures on every GC functions with arguments object maximum number of escape analysis fix point iterations allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms concurrent on stack replacement do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes number of stack frames inspected by the profiler percentage of ICs that must have type info to allow optimization extra verbose compilation tracing generate extra emit comments in code disassembly enable use of SSE3 instructions if available enable use of CMOV instruction if available enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long expose natives in global object expose freeBuffer extension expose gc extension under the specified name expose externalize string extension number of stack frames to capture disable builtin natives files print name of functions for which code is generated use random jit cookie to mask large constants trace lazy optimization use adaptive optimizations always try to OSR functions trace optimize function deoptimization minimum length for automatic enable preparsing maximum number of optimization attempts before giving up cache prototype transitions trace debugging JSON request response trace out of bounds accesses to external arrays trace_js_array_abuse automatically set the debug break flag when debugger commands are in the queue abort by crashing maximum length of function source code printed in a stack trace max size of the new max size of the old max size of executable always perform global GCs print one trace line following each garbage collection do not print trace line after scavenger collection print statistics of the maximum memory committed for the heap in only print modified registers Don t break for ASM_UNIMPLEMENTED_BREAK macros print stack trace when an illegal exception is thrown randomize hashes to avoid predictable hash Fixed seed to use to hash property Print the time it takes to deserialize the snapshot testing_bool_flag testing_int_flag string flag tmp file in which to serialize heap Print the time it takes to lazily compile hydrogen code stubs concurrent_recompilation concurrent_sweeping Print usage including flags
bool ContainsFlag(GVNFlag flag) const
void Add(SideEffects set)
#define DISALLOW_COPY_AND_ASSIGN(TypeName)
bool ContainsAnyOf(SideEffects set) const