OLD | NEW |
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_CRANKSHAFT_HYDROGEN_H_ | 5 #ifndef V8_CRANKSHAFT_HYDROGEN_H_ |
6 #define V8_CRANKSHAFT_HYDROGEN_H_ | 6 #define V8_CRANKSHAFT_HYDROGEN_H_ |
7 | 7 |
8 #include "src/accessors.h" | 8 #include "src/accessors.h" |
9 #include "src/allocation.h" | 9 #include "src/allocation.h" |
10 #include "src/ast/ast-type-bounds.h" | 10 #include "src/ast/ast-type-bounds.h" |
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
456 if (uint32_instructions_ == NULL) { | 456 if (uint32_instructions_ == NULL) { |
457 uint32_instructions_ = new(zone()) ZoneList<HInstruction*>(4, zone()); | 457 uint32_instructions_ = new(zone()) ZoneList<HInstruction*>(4, zone()); |
458 } | 458 } |
459 uint32_instructions_->Add(instr, zone()); | 459 uint32_instructions_->Add(instr, zone()); |
460 } | 460 } |
461 | 461 |
462 void IncrementInNoSideEffectsScope() { no_side_effects_scope_count_++; } | 462 void IncrementInNoSideEffectsScope() { no_side_effects_scope_count_++; } |
463 void DecrementInNoSideEffectsScope() { no_side_effects_scope_count_--; } | 463 void DecrementInNoSideEffectsScope() { no_side_effects_scope_count_--; } |
464 bool IsInsideNoSideEffectsScope() { return no_side_effects_scope_count_ > 0; } | 464 bool IsInsideNoSideEffectsScope() { return no_side_effects_scope_count_ > 0; } |
465 | 465 |
466 // If we are tracking source positions then this function assigns a unique | |
467 // identifier to each inlining and dumps function source if it was inlined | |
468 // for the first time during the current optimization. | |
469 int TraceInlinedFunction(Handle<SharedFunctionInfo> shared, | |
470 SourcePosition position); | |
471 | |
472 private: | 466 private: |
473 HConstant* ReinsertConstantIfNecessary(HConstant* constant); | 467 HConstant* ReinsertConstantIfNecessary(HConstant* constant); |
474 HConstant* GetConstant(SetOncePointer<HConstant>* pointer, | 468 HConstant* GetConstant(SetOncePointer<HConstant>* pointer, |
475 int32_t integer_value); | 469 int32_t integer_value); |
476 | 470 |
477 template<class Phase> | 471 template<class Phase> |
478 void Run() { | 472 void Run() { |
479 Phase phase(this); | 473 Phase phase(this); |
480 phase.Run(); | 474 phase.Run(); |
481 } | 475 } |
(...skipping 1364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1846 return SourcePosition::Unknown(); | 1840 return SourcePosition::Unknown(); |
1847 } | 1841 } |
1848 return SourcePosition(position, position_.InliningId()); | 1842 return SourcePosition(position, position_.InliningId()); |
1849 } | 1843 } |
1850 | 1844 |
1851 SourcePosition source_position() { return position_; } | 1845 SourcePosition source_position() { return position_; } |
1852 void set_source_position(SourcePosition position) { position_ = position; } | 1846 void set_source_position(SourcePosition position) { position_ = position; } |
1853 | 1847 |
1854 bool is_tracking_positions() { return track_positions_; } | 1848 bool is_tracking_positions() { return track_positions_; } |
1855 | 1849 |
1856 void TraceInlinedFunction(Handle<SharedFunctionInfo> shared, | |
1857 SourcePosition position, int inlining_id); | |
1858 | |
1859 HValue* BuildAllocateEmptyArrayBuffer(HValue* byte_length); | 1850 HValue* BuildAllocateEmptyArrayBuffer(HValue* byte_length); |
1860 template <typename ViewClass> | 1851 template <typename ViewClass> |
1861 void BuildArrayBufferViewInitialization(HValue* obj, | 1852 void BuildArrayBufferViewInitialization(HValue* obj, |
1862 HValue* buffer, | 1853 HValue* buffer, |
1863 HValue* byte_offset, | 1854 HValue* byte_offset, |
1864 HValue* byte_length); | 1855 HValue* byte_length); |
1865 | 1856 |
1866 private: | 1857 private: |
1867 HGraphBuilder(); | 1858 HGraphBuilder(); |
1868 | 1859 |
(...skipping 1119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2988 } | 2979 } |
2989 | 2980 |
2990 private: | 2981 private: |
2991 HOptimizedGraphBuilder* builder_; | 2982 HOptimizedGraphBuilder* builder_; |
2992 }; | 2983 }; |
2993 | 2984 |
2994 } // namespace internal | 2985 } // namespace internal |
2995 } // namespace v8 | 2986 } // namespace v8 |
2996 | 2987 |
2997 #endif // V8_CRANKSHAFT_HYDROGEN_H_ | 2988 #endif // V8_CRANKSHAFT_HYDROGEN_H_ |
OLD | NEW |