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

Side by Side Diff: src/interpreter/register-translator.h

Issue 1633153002: [interpreter] Reduce move operations for wide register support. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Remove RegisterOperandIsMovable from RegisterMover interface Created 4 years, 10 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/bytecodes.cc ('k') | src/interpreter/register-translator.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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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_REGISTER_TRANSLATOR_H_ 5 #ifndef V8_INTERPRETER_REGISTER_TRANSLATOR_H_
6 #define V8_INTERPRETER_REGISTER_TRANSLATOR_H_ 6 #define V8_INTERPRETER_REGISTER_TRANSLATOR_H_
7 7
8 #include "src/interpreter/bytecodes.h" 8 #include "src/interpreter/bytecodes.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 // value indicates the translation window is required. 70 // value indicates the translation window is required.
71 static int RegisterCountAdjustment(int register_count, int parameter_count); 71 static int RegisterCountAdjustment(int register_count, int parameter_count);
72 72
73 private: 73 private:
74 static const int kTranslationWindowLength = 4; 74 static const int kTranslationWindowLength = 4;
75 static const int kTranslationWindowLimit = -kMinInt8; 75 static const int kTranslationWindowLimit = -kMinInt8;
76 static const int kTranslationWindowStart = 76 static const int kTranslationWindowStart =
77 kTranslationWindowLimit - kTranslationWindowLength + 1; 77 kTranslationWindowLimit - kTranslationWindowLength + 1;
78 78
79 Register TranslateAndMove(Bytecode bytecode, int operand_index, Register reg); 79 Register TranslateAndMove(Bytecode bytecode, int operand_index, Register reg);
80 Register MakeAddressable(Register reg, OperandType reg_type); 80 static bool RegisterIsMovableToWindow(Bytecode bytecode, int operand_index);
81
81 static Register Translate(Register reg); 82 static Register Translate(Register reg);
82 83
83 RegisterMover* mover() const { return mover_; } 84 RegisterMover* mover() const { return mover_; }
84 85
85 // Entity to perform register moves necessary to translate registers 86 // Entity to perform register moves necessary to translate registers
86 // and ensure reachability. 87 // and ensure reachability.
87 RegisterMover* mover_; 88 RegisterMover* mover_;
88 89
89 // Flag to avoid re-entrancy when emitting move bytecodes for 90 // Flag to avoid re-entrancy when emitting move bytecodes for
90 // translation. 91 // translation.
91 bool emitting_moves_; 92 bool emitting_moves_;
92 93
93 // State for restoring registers after bytecode. 94 // Number of window registers in use.
94 Register window_registers_[kTranslationWindowLength];
95 int window_registers_count_; 95 int window_registers_count_;
96
97 // State for restoring register moves emitted by TranslateOutputRegisters.
98 std::pair<Register, Register> output_moves_[kTranslationWindowLength];
99 int output_moves_count_;
96 }; 100 };
97 101
98 // Interface for RegisterTranslator helper class that will emit 102 // Interface for RegisterTranslator helper class that will emit
99 // register move bytecodes at the translator's behest. 103 // register move bytecodes at the translator's behest.
100 class RegisterMover { 104 class RegisterMover {
101 public: 105 public:
102 virtual ~RegisterMover() {} 106 virtual ~RegisterMover() {}
103 107
104 // Move register |from| to register |to| with no translation. 108 // Move register |from| to register |to| with no translation.
105 // returns false if either register operand is invalid. Implementations 109 // returns false if either register operand is invalid. Implementations
106 // of this method must be aware that register moves with bad 110 // of this method must be aware that register moves with bad
107 // register values are a security hole. 111 // register values are a security hole.
108 virtual void MoveRegisterUntranslated(Register from, Register to) = 0; 112 virtual void MoveRegisterUntranslated(Register from, Register to) = 0;
109
110 // Returns true if the register operand can be moved into the
111 // translation window.
112 virtual bool RegisterOperandIsMovable(Bytecode bytecode,
113 int operand_index) = 0;
114 }; 113 };
115 114
116 } // namespace interpreter 115 } // namespace interpreter
117 } // namespace internal 116 } // namespace internal
118 } // namespace v8 117 } // namespace v8
119 118
120 #endif // V8_INTERPRETER_REGISTER_TRANSLATOR_H_ 119 #endif // V8_INTERPRETER_REGISTER_TRANSLATOR_H_
OLDNEW
« no previous file with comments | « src/interpreter/bytecodes.cc ('k') | src/interpreter/register-translator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698