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

Side by Side Diff: src/interpreter/bytecode-register-optimizer.h

Issue 2416243002: Make unittests work in component build (Closed)
Patch Set: updates Created 4 years, 2 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
« no previous file with comments | « src/interpreter/bytecode-pipeline.h ('k') | src/interpreter/bytecode-register-optimizer.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 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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_INTERPRETER_BYTECODE_REGISTER_OPTIMIZER_H_ 5 #ifndef V8_INTERPRETER_BYTECODE_REGISTER_OPTIMIZER_H_
6 #define V8_INTERPRETER_BYTECODE_REGISTER_OPTIMIZER_H_ 6 #define V8_INTERPRETER_BYTECODE_REGISTER_OPTIMIZER_H_
7 7
8 #include "src/base/compiler-specific.h"
9 #include "src/globals.h"
8 #include "src/interpreter/bytecode-pipeline.h" 10 #include "src/interpreter/bytecode-pipeline.h"
9 11
10 namespace v8 { 12 namespace v8 {
11 namespace internal { 13 namespace internal {
12 namespace interpreter { 14 namespace interpreter {
13 15
14 // An optimization stage for eliminating unnecessary transfers between 16 // An optimization stage for eliminating unnecessary transfers between
15 // registers. The bytecode generator uses temporary registers 17 // registers. The bytecode generator uses temporary registers
16 // liberally for correctness and convenience and this stage removes 18 // liberally for correctness and convenience and this stage removes
17 // transfers that are not required and preserves correctness. 19 // transfers that are not required and preserves correctness.
18 class BytecodeRegisterOptimizer final 20 class V8_EXPORT_PRIVATE BytecodeRegisterOptimizer final
19 : public BytecodePipelineStage, 21 : public NON_EXPORTED_BASE(BytecodePipelineStage),
20 public BytecodeRegisterAllocator::Observer, 22 public NON_EXPORTED_BASE(BytecodeRegisterAllocator::Observer),
21 public ZoneObject { 23 public NON_EXPORTED_BASE(ZoneObject) {
22 public: 24 public:
23 BytecodeRegisterOptimizer(Zone* zone, 25 BytecodeRegisterOptimizer(Zone* zone,
24 BytecodeRegisterAllocator* register_allocator, 26 BytecodeRegisterAllocator* register_allocator,
25 int fixed_registers_count, int parameter_count, 27 int fixed_registers_count, int parameter_count,
26 BytecodePipelineStage* next_stage); 28 BytecodePipelineStage* next_stage);
27 virtual ~BytecodeRegisterOptimizer() {} 29 virtual ~BytecodeRegisterOptimizer() {}
28 30
29 // BytecodePipelineStage interface. 31 // BytecodePipelineStage interface.
30 void Write(BytecodeNode* node) override; 32 void Write(BytecodeNode* node) override;
31 void WriteJump(BytecodeNode* node, BytecodeLabel* label) override; 33 void WriteJump(BytecodeNode* node, BytecodeLabel* label) override;
32 void BindLabel(BytecodeLabel* label) override; 34 void BindLabel(BytecodeLabel* label) override;
33 void BindLabel(const BytecodeLabel& target, BytecodeLabel* label) override; 35 void BindLabel(const BytecodeLabel& target, BytecodeLabel* label) override;
34 Handle<BytecodeArray> ToBytecodeArray( 36 Handle<BytecodeArray> ToBytecodeArray(
35 Isolate* isolate, int register_count, int parameter_count, 37 Isolate* isolate, int register_count, int parameter_count,
36 Handle<FixedArray> handler_table) override; 38 Handle<FixedArray> handler_table) override;
37 39
38 private: 40 private:
39 static const uint32_t kInvalidEquivalenceId = kMaxUInt32; 41 static const uint32_t kInvalidEquivalenceId;
40 42
41 class RegisterInfo; 43 class RegisterInfo;
42 44
43 // BytecodeRegisterAllocator::Observer interface. 45 // BytecodeRegisterAllocator::Observer interface.
44 void RegisterAllocateEvent(Register reg) override; 46 void RegisterAllocateEvent(Register reg) override;
45 void RegisterListAllocateEvent(RegisterList reg_list) override; 47 void RegisterListAllocateEvent(RegisterList reg_list) override;
46 void RegisterListFreeEvent(RegisterList reg) override; 48 void RegisterListFreeEvent(RegisterList reg) override;
47 49
48 // Helpers for BytecodePipelineStage interface. 50 // Helpers for BytecodePipelineStage interface.
49 void FlushState(); 51 void FlushState();
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 Zone* zone_; 148 Zone* zone_;
147 149
148 DISALLOW_COPY_AND_ASSIGN(BytecodeRegisterOptimizer); 150 DISALLOW_COPY_AND_ASSIGN(BytecodeRegisterOptimizer);
149 }; 151 };
150 152
151 } // namespace interpreter 153 } // namespace interpreter
152 } // namespace internal 154 } // namespace internal
153 } // namespace v8 155 } // namespace v8
154 156
155 #endif // V8_INTERPRETER_BYTECODE_REGISTER_OPTIMIZER_H_ 157 #endif // V8_INTERPRETER_BYTECODE_REGISTER_OPTIMIZER_H_
OLDNEW
« no previous file with comments | « src/interpreter/bytecode-pipeline.h ('k') | src/interpreter/bytecode-register-optimizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698