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

Unified Diff: src/interpreter/bytecode-array-builder.h

Issue 1783483002: [interpreter] Add support for scalable operands. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Re-generate golden files. Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/globals.h ('k') | src/interpreter/bytecode-array-builder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/bytecode-array-builder.h
diff --git a/src/interpreter/bytecode-array-builder.h b/src/interpreter/bytecode-array-builder.h
index 6d26c141a3eaa9c024ef581b9c5810438d935597..265511b98d6e81f51410627654eba9861d2ffa94 100644
--- a/src/interpreter/bytecode-array-builder.h
+++ b/src/interpreter/bytecode-array-builder.h
@@ -10,7 +10,6 @@
#include "src/interpreter/bytecodes.h"
#include "src/interpreter/constant-array-builder.h"
#include "src/interpreter/handler-table-builder.h"
-#include "src/interpreter/register-translator.h"
#include "src/interpreter/source-position-table.h"
#include "src/zone-containers.h"
@@ -24,7 +23,7 @@ namespace interpreter {
class BytecodeLabel;
class Register;
-class BytecodeArrayBuilder final : public ZoneObject, private RegisterMover {
+class BytecodeArrayBuilder final : public ZoneObject {
public:
BytecodeArrayBuilder(Isolate* isolate, Zone* zone, int parameter_count,
int context_count, int locals_count,
@@ -66,13 +65,6 @@ class BytecodeArrayBuilder final : public ZoneObject, private RegisterMover {
return temporary_register_allocator()->allocation_count();
}
- // Returns the number of registers used for translating wide
- // register operands into byte sized register operands.
- int translation_register_count() const {
- return RegisterTranslator::RegisterCountAdjustment(
- fixed_and_temporary_register_count(), parameter_count());
- }
-
Register Parameter(int parameter_index) const;
// Return true if the register |reg| represents a parameter or a
@@ -276,6 +268,22 @@ class BytecodeArrayBuilder final : public ZoneObject, private RegisterMover {
void EnsureReturn();
+ static OperandScale OperandSizesToScale(
+ OperandSize size0, OperandSize size1 = OperandSize::kByte,
+ OperandSize size2 = OperandSize::kByte,
+ OperandSize size3 = OperandSize::kByte);
+
+ static OperandSize SizeForRegisterOperand(Register reg);
+ static OperandSize SizeForSignedOperand(int value);
+ static OperandSize SizeForUnsignedOperand(int value);
+ static OperandSize SizeForUnsignedOperand(size_t value);
+
+ static uint32_t RegisterOperand(Register reg);
+ static Register RegisterFromOperand(uint32_t operand);
+ static uint32_t SignedOperand(int value, OperandSize size);
+ static uint32_t UnsignedOperand(int value);
+ static uint32_t UnsignedOperand(size_t value);
+
private:
class PreviousBytecodeHelper;
friend class BytecodeRegisterAllocator;
@@ -283,7 +291,6 @@ class BytecodeArrayBuilder final : public ZoneObject, private RegisterMover {
static Bytecode BytecodeForBinaryOperation(Token::Value op);
static Bytecode BytecodeForCountOperation(Token::Value op);
static Bytecode BytecodeForCompareOperation(Token::Value op);
- static Bytecode BytecodeForWideOperands(Bytecode bytecode);
static Bytecode BytecodeForStoreIC(LanguageMode language_mode);
static Bytecode BytecodeForKeyedStoreIC(LanguageMode language_mode);
static Bytecode BytecodeForLoadGlobal(TypeofMode typeof_mode);
@@ -293,32 +300,22 @@ class BytecodeArrayBuilder final : public ZoneObject, private RegisterMover {
static Bytecode BytecodeForDelete(LanguageMode language_mode);
static Bytecode BytecodeForCall(TailCallMode tail_call_mode);
- static bool FitsInIdx8Operand(int value);
- static bool FitsInIdx8Operand(size_t value);
- static bool FitsInImm8Operand(int value);
- static bool FitsInIdx16Operand(int value);
- static bool FitsInIdx16Operand(size_t value);
- static bool FitsInReg8Operand(Register value);
- static bool FitsInReg8OperandUntranslated(Register value);
- static bool FitsInReg16Operand(Register value);
- static bool FitsInReg16OperandUntranslated(Register value);
-
- // RegisterMover interface.
- void MoveRegisterUntranslated(Register from, Register to) override;
-
static Bytecode GetJumpWithConstantOperand(Bytecode jump_smi8_operand);
- static Bytecode GetJumpWithConstantWideOperand(Bytecode jump_smi8_operand);
static Bytecode GetJumpWithToBoolean(Bytecode jump_smi8_operand);
template <size_t N>
- INLINE(void Output(Bytecode bytecode, uint32_t(&operands)[N]));
- void Output(Bytecode bytecode, uint32_t operand0, uint32_t operand1,
- uint32_t operand2, uint32_t operand3);
- void Output(Bytecode bytecode, uint32_t operand0, uint32_t operand1,
- uint32_t operand2);
- void Output(Bytecode bytecode, uint32_t operand0, uint32_t operand1);
- void Output(Bytecode bytecode, uint32_t operand0);
+ INLINE(void Output(Bytecode bytecode, uint32_t (&operands)[N],
+ OperandScale operand_scale = OperandScale::kSingle));
void Output(Bytecode bytecode);
+ void OutputScaled(Bytecode bytecode, OperandScale operand_scale,
+ uint32_t operand0, uint32_t operand1, uint32_t operand2,
+ uint32_t operand3);
+ void OutputScaled(Bytecode bytecode, OperandScale operand_scale,
+ uint32_t operand0, uint32_t operand1, uint32_t operand2);
+ void OutputScaled(Bytecode bytecode, OperandScale operand_scale,
+ uint32_t operand0, uint32_t operand1);
+ void OutputScaled(Bytecode bytecode, OperandScale operand_scale,
+ uint32_t operand0);
BytecodeArrayBuilder& OutputJump(Bytecode jump_bytecode,
BytecodeLabel* label);
@@ -328,12 +325,14 @@ class BytecodeArrayBuilder final : public ZoneObject, private RegisterMover {
const ZoneVector<uint8_t>::iterator& jump_location, int delta);
void PatchIndirectJumpWith16BitOperand(
const ZoneVector<uint8_t>::iterator& jump_location, int delta);
+ void PatchIndirectJumpWith32BitOperand(
+ const ZoneVector<uint8_t>::iterator& jump_location, int delta);
void LeaveBasicBlock();
- bool OperandIsValid(Bytecode bytecode, int operand_index,
- uint32_t operand_value) const;
- bool RegisterIsValid(Register reg, OperandType reg_type) const;
+ bool OperandIsValid(Bytecode bytecode, OperandScale operand_scale,
+ int operand_index, uint32_t operand_value) const;
+ bool RegisterIsValid(Register reg, OperandSize reg_size) const;
bool LastBytecodeInSameBlock() const;
bool NeedToBooleanCast();
@@ -360,7 +359,6 @@ class BytecodeArrayBuilder final : public ZoneObject, private RegisterMover {
SourcePositionTableBuilder* source_position_table_builder() {
return &source_position_table_builder_;
}
- RegisterTranslator* register_translator() { return &register_translator_; }
Isolate* isolate_;
Zone* zone_;
@@ -378,7 +376,6 @@ class BytecodeArrayBuilder final : public ZoneObject, private RegisterMover {
int context_register_count_;
int return_position_;
TemporaryRegisterAllocator temporary_allocator_;
- RegisterTranslator register_translator_;
DISALLOW_COPY_AND_ASSIGN(BytecodeArrayBuilder);
};
« no previous file with comments | « src/globals.h ('k') | src/interpreter/bytecode-array-builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698