diff --git a/src/builtins/base.tq b/src/builtins/base.tq index 20a44c2d92..5f09b2ec6c 100644 --- a/src/builtins/base.tq +++ b/src/builtins/base.tq @@ -2530,6 +2530,7 @@ extern macro Signed(RawPtr): intptr; extern macro TruncateIntPtrToInt32(intptr): int32; extern macro SmiTag(intptr): Smi; extern macro SmiFromInt32(int32): Smi; +extern macro SmiFromUint32(uint32): Smi; extern macro SmiUntag(Smi): intptr; extern macro SmiToInt32(Smi): int32; extern macro RoundIntPtrToFloat64(intptr): float64; @@ -2691,7 +2692,7 @@ Convert(ui: uint32): Number { return ChangeUint32ToTagged(ui); } Convert(ui: uint32): Smi { - return SmiFromInt32(Signed(ui)); + return SmiFromUint32(ui); } Convert(ui: uint32): uintptr { return ChangeUint32ToWord(ui); diff --git a/src/codegen/code-stub-assembler.cc b/src/codegen/code-stub-assembler.cc index 7dad8cb95e..5c68b6e335 100644 --- a/src/codegen/code-stub-assembler.cc +++ b/src/codegen/code-stub-assembler.cc @@ -595,6 +595,12 @@ TNode CodeStubAssembler::SmiFromInt32(SloppyTNode value) { return smi; } +TNode CodeStubAssembler::SmiFromUint32(TNode value) { + CSA_ASSERT(this, IntPtrLessThan(ChangeUint32ToWord(value), + IntPtrConstant(Smi::kMaxValue))); + return SmiFromInt32(Signed(value)); +} + TNode CodeStubAssembler::IsValidPositiveSmi(TNode value) { intptr_t constant_value; if (ToIntPtrConstant(value, &constant_value)) { diff --git a/src/codegen/code-stub-assembler.h b/src/codegen/code-stub-assembler.h index 9884d04e66..c71c9ff70d 100644 --- a/src/codegen/code-stub-assembler.h +++ b/src/codegen/code-stub-assembler.h @@ -557,6 +557,7 @@ class V8_EXPORT_PRIVATE CodeStubAssembler TNode SmiToFloat64(SloppyTNode value); TNode SmiFromIntPtr(SloppyTNode value) { return SmiTag(value); } TNode SmiFromInt32(SloppyTNode value); + TNode SmiFromUint32(TNode value); TNode SmiToIntPtr(SloppyTNode value) { return SmiUntag(value); } TNode SmiToInt32(SloppyTNode value); diff --git a/src/interpreter/interpreter-assembler.cc b/src/interpreter/interpreter-assembler.cc index 2d08631ec0..3d2ba20c32 100644 --- a/src/interpreter/interpreter-assembler.cc +++ b/src/interpreter/interpreter-assembler.cc @@ -562,7 +562,7 @@ TNode InterpreterAssembler::BytecodeOperandCount(int operand_index) { return BytecodeUnsignedOperand(operand_index, operand_size); } -Node* InterpreterAssembler::BytecodeOperandFlag(int operand_index) { +TNode InterpreterAssembler::BytecodeOperandFlag(int operand_index) { DCHECK_EQ(OperandType::kFlag8, Bytecodes::GetOperandType(bytecode_, operand_index)); OperandSize operand_size = @@ -579,15 +579,16 @@ TNode InterpreterAssembler::BytecodeOperandUImm(int operand_index) { return BytecodeUnsignedOperand(operand_index, operand_size); } -Node* InterpreterAssembler::BytecodeOperandUImmWord(int operand_index) { +TNode InterpreterAssembler::BytecodeOperandUImmWord( + int operand_index) { return ChangeUint32ToWord(BytecodeOperandUImm(operand_index)); } -Node* InterpreterAssembler::BytecodeOperandUImmSmi(int operand_index) { - return SmiFromInt32(Signed(BytecodeOperandUImm(operand_index))); +TNode InterpreterAssembler::BytecodeOperandUImmSmi(int operand_index) { + return SmiFromUint32(BytecodeOperandUImm(operand_index)); } -Node* InterpreterAssembler::BytecodeOperandImm(int operand_index) { +TNode InterpreterAssembler::BytecodeOperandImm(int operand_index) { DCHECK_EQ(OperandType::kImm, Bytecodes::GetOperandType(bytecode_, operand_index)); OperandSize operand_size = @@ -595,15 +596,17 @@ Node* InterpreterAssembler::BytecodeOperandImm(int operand_index) { return BytecodeSignedOperand(operand_index, operand_size); } -Node* InterpreterAssembler::BytecodeOperandImmIntPtr(int operand_index) { +TNode InterpreterAssembler::BytecodeOperandImmIntPtr( + int operand_index) { return ChangeInt32ToIntPtr(BytecodeOperandImm(operand_index)); } -Node* InterpreterAssembler::BytecodeOperandImmSmi(int operand_index) { +TNode InterpreterAssembler::BytecodeOperandImmSmi(int operand_index) { return SmiFromInt32(BytecodeOperandImm(operand_index)); } -Node* InterpreterAssembler::BytecodeOperandIdxInt32(int operand_index) { +TNode InterpreterAssembler::BytecodeOperandIdxInt32( + int operand_index) { DCHECK_EQ(OperandType::kIdx, Bytecodes::GetOperandType(bytecode_, operand_index)); OperandSize operand_size = @@ -611,15 +614,15 @@ Node* InterpreterAssembler::BytecodeOperandIdxInt32(int operand_index) { return BytecodeUnsignedOperand(operand_index, operand_size); } -Node* InterpreterAssembler::BytecodeOperandIdx(int operand_index) { +TNode InterpreterAssembler::BytecodeOperandIdx(int operand_index) { return ChangeUint32ToWord(BytecodeOperandIdxInt32(operand_index)); } -Node* InterpreterAssembler::BytecodeOperandIdxSmi(int operand_index) { - return SmiTag(BytecodeOperandIdx(operand_index)); +TNode InterpreterAssembler::BytecodeOperandIdxSmi(int operand_index) { + return SmiTag(Signed(BytecodeOperandIdx(operand_index))); } -Node* InterpreterAssembler::BytecodeOperandConstantPoolIdx( +TNode InterpreterAssembler::BytecodeOperandConstantPoolIdx( int operand_index, LoadSensitivity needs_poisoning) { DCHECK_EQ(OperandType::kIdx, Bytecodes::GetOperandType(bytecode_, operand_index)); @@ -629,7 +632,7 @@ Node* InterpreterAssembler::BytecodeOperandConstantPoolIdx( BytecodeUnsignedOperand(operand_index, operand_size, needs_poisoning)); } -Node* InterpreterAssembler::BytecodeOperandReg( +TNode InterpreterAssembler::BytecodeOperandReg( int operand_index, LoadSensitivity needs_poisoning) { DCHECK(Bytecodes::IsRegisterOperandType( Bytecodes::GetOperandType(bytecode_, operand_index))); @@ -639,7 +642,8 @@ Node* InterpreterAssembler::BytecodeOperandReg( BytecodeSignedOperand(operand_index, operand_size, needs_poisoning)); } -Node* InterpreterAssembler::BytecodeOperandRuntimeId(int operand_index) { +TNode InterpreterAssembler::BytecodeOperandRuntimeId( + int operand_index) { DCHECK_EQ(OperandType::kRuntimeId, Bytecodes::GetOperandType(bytecode_, operand_index)); OperandSize operand_size = @@ -648,7 +652,7 @@ Node* InterpreterAssembler::BytecodeOperandRuntimeId(int operand_index) { return BytecodeUnsignedOperand(operand_index, operand_size); } -Node* InterpreterAssembler::BytecodeOperandNativeContextIndex( +TNode InterpreterAssembler::BytecodeOperandNativeContextIndex( int operand_index) { DCHECK_EQ(OperandType::kNativeContextIndex, Bytecodes::GetOperandType(bytecode_, operand_index)); @@ -658,7 +662,8 @@ Node* InterpreterAssembler::BytecodeOperandNativeContextIndex( BytecodeUnsignedOperand(operand_index, operand_size)); } -Node* InterpreterAssembler::BytecodeOperandIntrinsicId(int operand_index) { +TNode InterpreterAssembler::BytecodeOperandIntrinsicId( + int operand_index) { DCHECK_EQ(OperandType::kIntrinsicId, Bytecodes::GetOperandType(bytecode_, operand_index)); OperandSize operand_size = @@ -667,7 +672,7 @@ Node* InterpreterAssembler::BytecodeOperandIntrinsicId(int operand_index) { return BytecodeUnsignedOperand(operand_index, operand_size); } -Node* InterpreterAssembler::LoadConstantPoolEntry(Node* index) { +TNode InterpreterAssembler::LoadConstantPoolEntry(TNode index) { TNode constant_pool = CAST(LoadObjectField( BytecodeArrayTaggedPointer(), BytecodeArray::kConstantPoolOffset)); return UnsafeLoadFixedArrayElement( @@ -675,13 +680,13 @@ Node* InterpreterAssembler::LoadConstantPoolEntry(Node* index) { } TNode InterpreterAssembler::LoadAndUntagConstantPoolEntry( - Node* index) { - return SmiUntag(LoadConstantPoolEntry(index)); + TNode index) { + return SmiUntag(CAST(LoadConstantPoolEntry(index))); } -Node* InterpreterAssembler::LoadConstantPoolEntryAtOperandIndex( +TNode InterpreterAssembler::LoadConstantPoolEntryAtOperandIndex( int operand_index) { - Node* index = + TNode index = BytecodeOperandConstantPoolIdx(operand_index, LoadSensitivity::kSafe); return LoadConstantPoolEntry(index); } @@ -689,7 +694,7 @@ Node* InterpreterAssembler::LoadConstantPoolEntryAtOperandIndex( TNode InterpreterAssembler::LoadAndUntagConstantPoolEntryAtOperandIndex( int operand_index) { - return SmiUntag(LoadConstantPoolEntryAtOperandIndex(operand_index)); + return SmiUntag(CAST(LoadConstantPoolEntryAtOperandIndex(operand_index))); } TNode InterpreterAssembler::LoadFeedbackVector() { @@ -1804,7 +1809,7 @@ void InterpreterAssembler::ToNumberOrNumeric(Object::Conversion mode) { BIND(&if_done); // Record the type feedback collected for {object}. - Node* slot_index = BytecodeOperandIdx(0); + TNode slot_index = BytecodeOperandIdx(0); TNode maybe_feedback_vector = LoadFeedbackVector(); UpdateFeedback(var_type_feedback.value(), maybe_feedback_vector, slot_index); diff --git a/src/interpreter/interpreter-assembler.h b/src/interpreter/interpreter-assembler.h index 424e471848..d5fa1c17ea 100644 --- a/src/interpreter/interpreter-assembler.h +++ b/src/interpreter/interpreter-assembler.h @@ -28,44 +28,44 @@ class V8_EXPORT_PRIVATE InterpreterAssembler : public CodeStubAssembler { compiler::TNode BytecodeOperandCount(int operand_index); // Returns the 32-bit unsigned flag for bytecode operand |operand_index| // in the current bytecode. - compiler::Node* BytecodeOperandFlag(int operand_index); + compiler::TNode BytecodeOperandFlag(int operand_index); // Returns the 32-bit zero-extended index immediate for bytecode operand // |operand_index| in the current bytecode. - compiler::Node* BytecodeOperandIdxInt32(int operand_index); + compiler::TNode BytecodeOperandIdxInt32(int operand_index); // Returns the word zero-extended index immediate for bytecode operand // |operand_index| in the current bytecode. - compiler::Node* BytecodeOperandIdx(int operand_index); + compiler::TNode BytecodeOperandIdx(int operand_index); // Returns the smi index immediate for bytecode operand |operand_index| // in the current bytecode. - compiler::Node* BytecodeOperandIdxSmi(int operand_index); + compiler::TNode BytecodeOperandIdxSmi(int operand_index); // Returns the 32-bit unsigned immediate for bytecode operand |operand_index| // in the current bytecode. compiler::TNode BytecodeOperandUImm(int operand_index); // Returns the word-size unsigned immediate for bytecode operand // |operand_index| in the current bytecode. - compiler::Node* BytecodeOperandUImmWord(int operand_index); + compiler::TNode BytecodeOperandUImmWord(int operand_index); // Returns the unsigned smi immediate for bytecode operand |operand_index| in // the current bytecode. - compiler::Node* BytecodeOperandUImmSmi(int operand_index); + compiler::TNode BytecodeOperandUImmSmi(int operand_index); // Returns the 32-bit signed immediate for bytecode operand |operand_index| // in the current bytecode. - compiler::Node* BytecodeOperandImm(int operand_index); + compiler::TNode BytecodeOperandImm(int operand_index); // Returns the word-size signed immediate for bytecode operand |operand_index| // in the current bytecode. - compiler::Node* BytecodeOperandImmIntPtr(int operand_index); + compiler::TNode BytecodeOperandImmIntPtr(int operand_index); // Returns the smi immediate for bytecode operand |operand_index| in the // current bytecode. - compiler::Node* BytecodeOperandImmSmi(int operand_index); + compiler::TNode BytecodeOperandImmSmi(int operand_index); // Returns the 32-bit unsigned runtime id immediate for bytecode operand // |operand_index| in the current bytecode. - compiler::Node* BytecodeOperandRuntimeId(int operand_index); - // Returns the 32-bit unsigned native context index immediate for bytecode + compiler::TNode BytecodeOperandRuntimeId(int operand_index); + // Returns the word zero-extended native context index immediate for bytecode // operand |operand_index| in the current bytecode. - compiler::Node* BytecodeOperandNativeContextIndex(int operand_index); + compiler::TNode BytecodeOperandNativeContextIndex( + int operand_index); // Returns the 32-bit unsigned intrinsic id immediate for bytecode operand // |operand_index| in the current bytecode. - compiler::Node* BytecodeOperandIntrinsicId(int operand_index); - + compiler::TNode BytecodeOperandIntrinsicId(int operand_index); // Accumulator. compiler::TNode GetAccumulator(); void SetAccumulator(SloppyTNode value); @@ -136,14 +136,15 @@ class V8_EXPORT_PRIVATE InterpreterAssembler : public CodeStubAssembler { // Load constant at the index specified in operand |operand_index| from the // constant pool. - compiler::Node* LoadConstantPoolEntryAtOperandIndex(int operand_index); + compiler::TNode LoadConstantPoolEntryAtOperandIndex( + int operand_index); // Load and untag constant at the index specified in operand |operand_index| // from the constant pool. TNode LoadAndUntagConstantPoolEntryAtOperandIndex(int operand_index); // Load constant at |index| in the constant pool. - compiler::Node* LoadConstantPoolEntry(compiler::Node* index); + compiler::TNode LoadConstantPoolEntry(compiler::TNode index); // Load and untag constant at |index| in the constant pool. - TNode LoadAndUntagConstantPoolEntry(compiler::Node* index); + TNode LoadAndUntagConstantPoolEntry(compiler::TNode index); // Load the FeedbackVector for the current function. The retuned node could be // undefined. @@ -362,13 +363,13 @@ class V8_EXPORT_PRIVATE InterpreterAssembler : public CodeStubAssembler { // Returns the word-size sign-extended register index for bytecode operand // |operand_index| in the current bytecode. Value is not poisoned on // speculation since the value loaded from the register is poisoned instead. - compiler::Node* BytecodeOperandReg( + compiler::TNode BytecodeOperandReg( int operand_index, LoadSensitivity needs_poisoning = LoadSensitivity::kCritical); // Returns the word zero-extended index immediate for bytecode operand // |operand_index| in the current bytecode for use when loading a . - compiler::Node* BytecodeOperandConstantPoolIdx( + compiler::TNode BytecodeOperandConstantPoolIdx( int operand_index, LoadSensitivity needs_poisoning = LoadSensitivity::kCritical); diff --git a/src/interpreter/interpreter-generator.cc b/src/interpreter/interpreter-generator.cc index e8569ecd55..9a39a21025 100644 --- a/src/interpreter/interpreter-generator.cc +++ b/src/interpreter/interpreter-generator.cc @@ -71,7 +71,7 @@ IGNITION_HANDLER(LdaZero, InterpreterAssembler) { // // Load an integer literal into the accumulator as a Smi. IGNITION_HANDLER(LdaSmi, InterpreterAssembler) { - Node* smi_int = BytecodeOperandImmSmi(0); + TNode smi_int = BytecodeOperandImmSmi(0); SetAccumulator(smi_int); Dispatch(); } @@ -80,7 +80,7 @@ IGNITION_HANDLER(LdaSmi, InterpreterAssembler) { // // Load constant literal at |idx| in the constant pool into the accumulator. IGNITION_HANDLER(LdaConstant, InterpreterAssembler) { - Node* constant = LoadConstantPoolEntryAtOperandIndex(0); + TNode constant = LoadConstantPoolEntryAtOperandIndex(0); SetAccumulator(constant); Dispatch(); } @@ -161,7 +161,7 @@ class InterpreterLoadGlobalAssembler : public InterpreterAssembler { void LdaGlobal(int slot_operand_index, int name_operand_index, TypeofMode typeof_mode) { TNode maybe_feedback_vector = LoadFeedbackVector(); - Node* feedback_slot = BytecodeOperandIdx(slot_operand_index); + TNode feedback_slot = BytecodeOperandIdx(slot_operand_index); AccessorAssembler accessor_asm(state()); ExitPoint exit_point(this, [=](Node* result) { @@ -172,8 +172,9 @@ class InterpreterLoadGlobalAssembler : public InterpreterAssembler { LazyNode lazy_context = [=] { return GetContext(); }; LazyNode lazy_name = [=] { - Node* name = LoadConstantPoolEntryAtOperandIndex(name_operand_index); - return CAST(name); + TNode name = + CAST(LoadConstantPoolEntryAtOperandIndex(name_operand_index)); + return name; }; ParameterMode slot_mode = CodeStubAssembler::INTPTR_PARAMETERS; @@ -213,9 +214,9 @@ IGNITION_HANDLER(StaGlobal, InterpreterAssembler) { TNode context = GetContext(); // Store the global via the StoreGlobalIC. - Node* name = LoadConstantPoolEntryAtOperandIndex(0); + TNode name = CAST(LoadConstantPoolEntryAtOperandIndex(0)); TNode value = GetAccumulator(); - Node* raw_slot = BytecodeOperandIdx(1); + TNode raw_slot = Signed(BytecodeOperandIdx(1)); TNode smi_slot = SmiTag(raw_slot); TNode maybe_vector = LoadFeedbackVector(); @@ -240,7 +241,7 @@ IGNITION_HANDLER(StaGlobal, InterpreterAssembler) { // chain starting at |context| into the accumulator. IGNITION_HANDLER(LdaContextSlot, InterpreterAssembler) { TNode context = CAST(LoadRegisterAtOperandIndex(0)); - Node* slot_index = BytecodeOperandIdx(1); + TNode slot_index = Signed(BytecodeOperandIdx(1)); TNode depth = BytecodeOperandUImm(2); Node* slot_context = GetContextAtDepth(context, depth); TNode result = LoadContextElement(slot_context, slot_index); @@ -254,7 +255,7 @@ IGNITION_HANDLER(LdaContextSlot, InterpreterAssembler) { // chain starting at |context| into the accumulator. IGNITION_HANDLER(LdaImmutableContextSlot, InterpreterAssembler) { TNode context = CAST(LoadRegisterAtOperandIndex(0)); - Node* slot_index = BytecodeOperandIdx(1); + TNode slot_index = Signed(BytecodeOperandIdx(1)); TNode depth = BytecodeOperandUImm(2); Node* slot_context = GetContextAtDepth(context, depth); TNode result = LoadContextElement(slot_context, slot_index); @@ -266,7 +267,7 @@ IGNITION_HANDLER(LdaImmutableContextSlot, InterpreterAssembler) { // // Load the object in |slot_index| of the current context into the accumulator. IGNITION_HANDLER(LdaCurrentContextSlot, InterpreterAssembler) { - Node* slot_index = BytecodeOperandIdx(0); + TNode slot_index = Signed(BytecodeOperandIdx(0)); TNode slot_context = GetContext(); TNode result = LoadContextElement(slot_context, slot_index); SetAccumulator(result); @@ -277,7 +278,7 @@ IGNITION_HANDLER(LdaCurrentContextSlot, InterpreterAssembler) { // // Load the object in |slot_index| of the current context into the accumulator. IGNITION_HANDLER(LdaImmutableCurrentContextSlot, InterpreterAssembler) { - Node* slot_index = BytecodeOperandIdx(0); + TNode slot_index = Signed(BytecodeOperandIdx(0)); TNode slot_context = GetContext(); TNode result = LoadContextElement(slot_context, slot_index); SetAccumulator(result); @@ -291,7 +292,7 @@ IGNITION_HANDLER(LdaImmutableCurrentContextSlot, InterpreterAssembler) { IGNITION_HANDLER(StaContextSlot, InterpreterAssembler) { TNode value = GetAccumulator(); TNode context = CAST(LoadRegisterAtOperandIndex(0)); - Node* slot_index = BytecodeOperandIdx(1); + TNode slot_index = Signed(BytecodeOperandIdx(1)); TNode depth = BytecodeOperandUImm(2); Node* slot_context = GetContextAtDepth(context, depth); StoreContextElement(slot_context, slot_index, value); @@ -304,7 +305,7 @@ IGNITION_HANDLER(StaContextSlot, InterpreterAssembler) { // context. IGNITION_HANDLER(StaCurrentContextSlot, InterpreterAssembler) { TNode value = GetAccumulator(); - Node* slot_index = BytecodeOperandIdx(0); + TNode slot_index = Signed(BytecodeOperandIdx(0)); TNode slot_context = GetContext(); StoreContextElement(slot_context, slot_index, value); Dispatch(); @@ -315,7 +316,7 @@ IGNITION_HANDLER(StaCurrentContextSlot, InterpreterAssembler) { // Lookup the object with the name in constant pool entry |name_index| // dynamically. IGNITION_HANDLER(LdaLookupSlot, InterpreterAssembler) { - Node* name = LoadConstantPoolEntryAtOperandIndex(0); + TNode name = CAST(LoadConstantPoolEntryAtOperandIndex(0)); TNode context = GetContext(); TNode result = CallRuntime(Runtime::kLoadLookupSlot, context, name); SetAccumulator(result); @@ -327,7 +328,7 @@ IGNITION_HANDLER(LdaLookupSlot, InterpreterAssembler) { // Lookup the object with the name in constant pool entry |name_index| // dynamically without causing a NoReferenceError. IGNITION_HANDLER(LdaLookupSlotInsideTypeof, InterpreterAssembler) { - Node* name = LoadConstantPoolEntryAtOperandIndex(0); + TNode name = CAST(LoadConstantPoolEntryAtOperandIndex(0)); TNode context = GetContext(); TNode result = CallRuntime(Runtime::kLoadLookupSlotInsideTypeof, context, name); @@ -344,7 +345,7 @@ class InterpreterLookupContextSlotAssembler : public InterpreterAssembler { void LookupContextSlot(Runtime::FunctionId function_id) { TNode context = GetContext(); - Node* slot_index = BytecodeOperandIdx(1); + TNode slot_index = Signed(BytecodeOperandIdx(1)); TNode depth = BytecodeOperandUImm(2); Label slowpath(this, Label::kDeferred); @@ -363,7 +364,7 @@ class InterpreterLookupContextSlotAssembler : public InterpreterAssembler { // Slow path when we have to call out to the runtime. BIND(&slowpath); { - Node* name = LoadConstantPoolEntryAtOperandIndex(0); + TNode name = CAST(LoadConstantPoolEntryAtOperandIndex(0)); TNode result = CallRuntime(function_id, context, name); SetAccumulator(result); Dispatch(); @@ -419,7 +420,7 @@ class InterpreterLookupGlobalAssembler : public InterpreterLoadGlobalAssembler { // Slow path when we have to call out to the runtime BIND(&slowpath); { - Node* name = LoadConstantPoolEntryAtOperandIndex(0); + TNode name = CAST(LoadConstantPoolEntryAtOperandIndex(0)); TNode result = CallRuntime(function_id, context, name); SetAccumulator(result); Dispatch(); @@ -450,8 +451,8 @@ IGNITION_HANDLER(LdaLookupGlobalSlotInsideTypeof, // pool entry |name_index|. IGNITION_HANDLER(StaLookupSlot, InterpreterAssembler) { TNode value = GetAccumulator(); - Node* name = LoadConstantPoolEntryAtOperandIndex(0); - Node* bytecode_flags = BytecodeOperandFlag(1); + TNode name = CAST(LoadConstantPoolEntryAtOperandIndex(0)); + TNode bytecode_flags = BytecodeOperandFlag(1); TNode context = GetContext(); Variable var_result(this, MachineRepresentation::kTagged); @@ -507,7 +508,7 @@ IGNITION_HANDLER(StaLookupSlot, InterpreterAssembler) { // constant pool entry . IGNITION_HANDLER(LdaNamedProperty, InterpreterAssembler) { TNode feedback_vector = LoadFeedbackVector(); - Node* feedback_slot = BytecodeOperandIdx(2); + TNode feedback_slot = Signed(BytecodeOperandIdx(2)); TNode smi_slot = SmiTag(feedback_slot); // Load receiver. @@ -540,7 +541,7 @@ IGNITION_HANDLER(LdaNamedProperty, InterpreterAssembler) { // Calls the GetProperty builtin for and the key in the accumulator. IGNITION_HANDLER(LdaNamedPropertyNoFeedback, InterpreterAssembler) { TNode object = LoadRegisterAtOperandIndex(0); - Node* name = LoadConstantPoolEntryAtOperandIndex(1); + TNode name = CAST(LoadConstantPoolEntryAtOperandIndex(1)); TNode context = GetContext(); TNode result = CallBuiltin(Builtins::kGetProperty, context, object, name); @@ -555,7 +556,7 @@ IGNITION_HANDLER(LdaNamedPropertyNoFeedback, InterpreterAssembler) { IGNITION_HANDLER(LdaKeyedProperty, InterpreterAssembler) { TNode object = LoadRegisterAtOperandIndex(0); TNode name = GetAccumulator(); - Node* raw_slot = BytecodeOperandIdx(1); + TNode raw_slot = Signed(BytecodeOperandIdx(1)); TNode smi_slot = SmiTag(raw_slot); TNode feedback_vector = LoadFeedbackVector(); TNode context = GetContext(); @@ -577,9 +578,9 @@ class InterpreterStoreNamedPropertyAssembler : public InterpreterAssembler { void StaNamedProperty(Callable ic, NamedPropertyType property_type) { TNode code_target = HeapConstant(ic.code()); TNode object = LoadRegisterAtOperandIndex(0); - Node* name = LoadConstantPoolEntryAtOperandIndex(1); + TNode name = CAST(LoadConstantPoolEntryAtOperandIndex(1)); TNode value = GetAccumulator(); - Node* raw_slot = BytecodeOperandIdx(2); + TNode raw_slot = Signed(BytecodeOperandIdx(2)); TNode smi_slot = SmiTag(raw_slot); TNode maybe_vector = LoadFeedbackVector(); TNode context = GetContext(); @@ -624,7 +625,7 @@ IGNITION_HANDLER(StaNamedOwnProperty, InterpreterStoreNamedPropertyAssembler) { IGNITION_HANDLER(StaNamedPropertyNoFeedback, InterpreterStoreNamedPropertyAssembler) { TNode object = LoadRegisterAtOperandIndex(0); - Node* name = LoadConstantPoolEntryAtOperandIndex(1); + TNode name = CAST(LoadConstantPoolEntryAtOperandIndex(1)); TNode value = GetAccumulator(); TNode context = GetContext(); @@ -642,7 +643,7 @@ IGNITION_HANDLER(StaKeyedProperty, InterpreterAssembler) { TNode object = LoadRegisterAtOperandIndex(0); TNode name = LoadRegisterAtOperandIndex(1); TNode value = GetAccumulator(); - Node* raw_slot = BytecodeOperandIdx(2); + TNode raw_slot = Signed(BytecodeOperandIdx(2)); TNode smi_slot = SmiTag(raw_slot); TNode maybe_vector = LoadFeedbackVector(); TNode context = GetContext(); @@ -667,7 +668,7 @@ IGNITION_HANDLER(StaInArrayLiteral, InterpreterAssembler) { TNode array = LoadRegisterAtOperandIndex(0); TNode index = LoadRegisterAtOperandIndex(1); TNode value = GetAccumulator(); - Node* raw_slot = BytecodeOperandIdx(2); + TNode raw_slot = Signed(BytecodeOperandIdx(2)); TNode smi_slot = SmiTag(raw_slot); TNode feedback_vector = LoadFeedbackVector(); TNode context = GetContext(); @@ -696,8 +697,9 @@ IGNITION_HANDLER(StaDataPropertyInLiteral, InterpreterAssembler) { TNode object = LoadRegisterAtOperandIndex(0); TNode name = LoadRegisterAtOperandIndex(1); TNode value = GetAccumulator(); - TNode flags = SmiFromInt32(BytecodeOperandFlag(2)); - TNode vector_index = SmiTag(BytecodeOperandIdx(3)); + TNode flags = + SmiFromInt32(UncheckedCast(BytecodeOperandFlag(2))); + TNode vector_index = BytecodeOperandIdxSmi(3); TNode feedback_vector = LoadFeedbackVector(); TNode context = GetContext(); @@ -708,7 +710,7 @@ IGNITION_HANDLER(StaDataPropertyInLiteral, InterpreterAssembler) { } IGNITION_HANDLER(CollectTypeProfile, InterpreterAssembler) { - Node* position = BytecodeOperandImmSmi(0); + TNode position = BytecodeOperandImmSmi(0); TNode value = GetAccumulator(); TNode feedback_vector = LoadFeedbackVector(); @@ -725,7 +727,7 @@ IGNITION_HANDLER(CollectTypeProfile, InterpreterAssembler) { // identified by . is the depth of the current context // relative to the module context. IGNITION_HANDLER(LdaModuleVariable, InterpreterAssembler) { - Node* cell_index = BytecodeOperandImmIntPtr(0); + TNode cell_index = BytecodeOperandImmIntPtr(0); TNode depth = BytecodeOperandUImm(1); Node* module_context = GetContextAtDepth(GetContext(), depth); @@ -770,7 +772,7 @@ IGNITION_HANDLER(LdaModuleVariable, InterpreterAssembler) { // is the depth of the current context relative to the module context. IGNITION_HANDLER(StaModuleVariable, InterpreterAssembler) { TNode value = GetAccumulator(); - Node* cell_index = BytecodeOperandImmIntPtr(0); + TNode cell_index = BytecodeOperandImmIntPtr(0); TNode depth = BytecodeOperandUImm(1); Node* module_context = GetContextAtDepth(GetContext(), depth); @@ -838,7 +840,7 @@ class InterpreterBinaryOpAssembler : public InterpreterAssembler { TNode lhs = LoadRegisterAtOperandIndex(0); TNode rhs = GetAccumulator(); TNode context = GetContext(); - Node* slot_index = BytecodeOperandIdx(1); + TNode slot_index = Signed(BytecodeOperandIdx(1)); TNode maybe_feedback_vector = LoadFeedbackVector(); BinaryOpAssembler binop_asm(state()); @@ -850,9 +852,9 @@ class InterpreterBinaryOpAssembler : public InterpreterAssembler { void BinaryOpSmiWithFeedback(BinaryOpGenerator generator) { TNode lhs = GetAccumulator(); - Node* rhs = BytecodeOperandImmSmi(0); + TNode rhs = BytecodeOperandImmSmi(0); TNode context = GetContext(); - Node* slot_index = BytecodeOperandIdx(1); + TNode slot_index = Signed(BytecodeOperandIdx(1)); TNode maybe_feedback_vector = LoadFeedbackVector(); BinaryOpAssembler binop_asm(state()); @@ -959,7 +961,7 @@ class InterpreterBitwiseBinaryOpAssembler : public InterpreterAssembler { TNode left = LoadRegisterAtOperandIndex(0); TNode right = GetAccumulator(); TNode context = GetContext(); - Node* slot_index = BytecodeOperandIdx(1); + TNode slot_index = Signed(BytecodeOperandIdx(1)); TNode maybe_feedback_vector = LoadFeedbackVector(); TVARIABLE(Smi, var_left_feedback); @@ -1007,8 +1009,8 @@ class InterpreterBitwiseBinaryOpAssembler : public InterpreterAssembler { void BitwiseBinaryOpWithSmi(Operation bitwise_op) { TNode left = GetAccumulator(); - Node* right = BytecodeOperandImmSmi(0); - Node* slot_index = BytecodeOperandIdx(1); + TNode right = BytecodeOperandImmSmi(0); + TNode slot_index = Signed(BytecodeOperandIdx(1)); TNode maybe_feedback_vector = LoadFeedbackVector(); TNode context = GetContext(); @@ -1115,7 +1117,7 @@ IGNITION_HANDLER(BitwiseAndSmi, InterpreterBitwiseBinaryOpAssembler) { // Perform bitwise-not on the accumulator. IGNITION_HANDLER(BitwiseNot, InterpreterAssembler) { TNode operand = GetAccumulator(); - Node* slot_index = BytecodeOperandIdx(0); + TNode slot_index = Signed(BytecodeOperandIdx(0)); TNode maybe_feedback_vector = LoadFeedbackVector(); TNode context = GetContext(); @@ -1271,7 +1273,7 @@ class UnaryNumericOpAssembler : public InterpreterAssembler { } BIND(&end); - Node* slot_index = BytecodeOperandIdx(0); + TNode slot_index = Signed(BytecodeOperandIdx(0)); TNode maybe_feedback_vector = LoadFeedbackVector(); UpdateFeedback(var_feedback.value(), maybe_feedback_vector, slot_index); SetAccumulator(var_result.value()); @@ -1550,7 +1552,7 @@ class InterpreterJSCallAssembler : public InterpreterAssembler { void JSCall(ConvertReceiverMode receiver_mode) { TNode function = LoadRegisterAtOperandIndex(0); RegListNodePair args = GetRegisterListAtOperandIndex(1); - Node* slot_id = BytecodeOperandIdx(3); + TNode slot_id = BytecodeOperandIdx(3); TNode maybe_feedback_vector = LoadFeedbackVector(); TNode context = GetContext(); @@ -1583,7 +1585,7 @@ class InterpreterJSCallAssembler : public InterpreterAssembler { kFirstArgumentOperandIndex + kRecieverAndArgOperandCount; TNode function = LoadRegisterAtOperandIndex(0); - Node* slot_id = BytecodeOperandIdx(kSlotOperandIndex); + TNode slot_id = BytecodeOperandIdx(kSlotOperandIndex); TNode maybe_feedback_vector = LoadFeedbackVector(); TNode context = GetContext(); @@ -1676,7 +1678,7 @@ IGNITION_HANDLER(CallNoFeedback, InterpreterJSCallAssembler) { // register |first_arg| and |arg_count| arguments in subsequent // registers. IGNITION_HANDLER(CallRuntime, InterpreterAssembler) { - Node* function_id = BytecodeOperandRuntimeId(0); + TNode function_id = BytecodeOperandRuntimeId(0); RegListNodePair args = GetRegisterListAtOperandIndex(1); TNode context = GetContext(); Node* result = CallRuntimeN(function_id, context, args); @@ -1690,7 +1692,7 @@ IGNITION_HANDLER(CallRuntime, InterpreterAssembler) { // |function_id| with the first argument in |first_arg| and |arg_count| // arguments in subsequent registers. IGNITION_HANDLER(InvokeIntrinsic, InterpreterAssembler) { - Node* function_id = BytecodeOperandIntrinsicId(0); + TNode function_id = BytecodeOperandIntrinsicId(0); RegListNodePair args = GetRegisterListAtOperandIndex(1); TNode context = GetContext(); Node* result = GenerateInvokeIntrinsic(this, function_id, context, args); @@ -1706,7 +1708,7 @@ IGNITION_HANDLER(InvokeIntrinsic, InterpreterAssembler) { // IGNITION_HANDLER(CallRuntimeForPair, InterpreterAssembler) { // Call the runtime function. - Node* function_id = BytecodeOperandRuntimeId(0); + TNode function_id = BytecodeOperandRuntimeId(0); RegListNodePair args = GetRegisterListAtOperandIndex(1); TNode context = GetContext(); Node* result_pair = CallRuntimeN(function_id, context, args, 2); @@ -1722,7 +1724,7 @@ IGNITION_HANDLER(CallRuntimeForPair, InterpreterAssembler) { // Call the JS runtime function that has the |context_index| with the receiver // in register |receiver| and |arg_count| arguments in subsequent registers. IGNITION_HANDLER(CallJSRuntime, InterpreterAssembler) { - Node* context_index = BytecodeOperandNativeContextIndex(0); + TNode context_index = Signed(BytecodeOperandNativeContextIndex(0)); RegListNodePair args = GetRegisterListAtOperandIndex(1); // Get the function to call from the native context. @@ -1744,7 +1746,7 @@ IGNITION_HANDLER(CallJSRuntime, InterpreterAssembler) { IGNITION_HANDLER(CallWithSpread, InterpreterAssembler) { TNode callable = LoadRegisterAtOperandIndex(0); RegListNodePair args = GetRegisterListAtOperandIndex(1); - Node* slot_id = BytecodeOperandIdx(3); + TNode slot_id = BytecodeOperandIdx(3); TNode maybe_feedback_vector = LoadFeedbackVector(); TNode context = GetContext(); @@ -1763,7 +1765,7 @@ IGNITION_HANDLER(ConstructWithSpread, InterpreterAssembler) { TNode new_target = GetAccumulator(); TNode constructor = LoadRegisterAtOperandIndex(0); RegListNodePair args = GetRegisterListAtOperandIndex(1); - Node* slot_id = BytecodeOperandIdx(3); + TNode slot_id = BytecodeOperandIdx(3); TNode feedback_vector = LoadFeedbackVector(); TNode context = GetContext(); Node* result = ConstructWithSpread(constructor, context, new_target, args, @@ -1782,7 +1784,7 @@ IGNITION_HANDLER(Construct, InterpreterAssembler) { TNode new_target = GetAccumulator(); TNode constructor = LoadRegisterAtOperandIndex(0); RegListNodePair args = GetRegisterListAtOperandIndex(1); - Node* slot_id = BytecodeOperandIdx(3); + TNode slot_id = BytecodeOperandIdx(3); TNode feedback_vector = LoadFeedbackVector(); TNode context = GetContext(); Node* result = Construct(constructor, context, new_target, args, slot_id, @@ -1822,7 +1824,7 @@ class InterpreterCompareOpAssembler : public InterpreterAssembler { UNREACHABLE(); } - Node* slot_index = BytecodeOperandIdx(1); + TNode slot_index = Signed(BytecodeOperandIdx(1)); TNode maybe_feedback_vector = LoadFeedbackVector(); UpdateFeedback(var_type_feedback.value(), maybe_feedback_vector, slot_index); @@ -1894,7 +1896,7 @@ IGNITION_HANDLER(TestReferenceEqual, InterpreterAssembler) { IGNITION_HANDLER(TestIn, InterpreterAssembler) { TNode name = LoadRegisterAtOperandIndex(0); TNode object = GetAccumulator(); - Node* raw_slot = BytecodeOperandIdx(1); + TNode raw_slot = Signed(BytecodeOperandIdx(1)); TNode smi_slot = SmiTag(raw_slot); TNode feedback_vector = LoadFeedbackVector(); TNode context = GetContext(); @@ -1913,7 +1915,7 @@ IGNITION_HANDLER(TestIn, InterpreterAssembler) { IGNITION_HANDLER(TestInstanceOf, InterpreterAssembler) { TNode object = LoadRegisterAtOperandIndex(0); TNode callable = GetAccumulator(); - Node* slot_id = BytecodeOperandIdx(1); + TNode slot_id = BytecodeOperandIdx(1); TNode feedback_vector = LoadFeedbackVector(); TNode context = GetContext(); @@ -1980,7 +1982,7 @@ IGNITION_HANDLER(TestUndefined, InterpreterAssembler) { // by |literal_flag|. IGNITION_HANDLER(TestTypeOf, InterpreterAssembler) { TNode object = GetAccumulator(); - Node* literal_flag = BytecodeOperandFlag(0); + TNode literal_flag = BytecodeOperandFlag(0); #define MAKE_LABEL(name, lower_case) Label if_##lower_case(this); TYPEOF_LITERAL_LIST(MAKE_LABEL) @@ -2097,7 +2099,7 @@ IGNITION_HANDLER(TestTypeOf, InterpreterAssembler) { // // Jump by the number of bytes represented by the immediate operand |imm|. IGNITION_HANDLER(Jump, InterpreterAssembler) { - Node* relative_jump = BytecodeOperandUImmWord(0); + TNode relative_jump = Signed(BytecodeOperandUImmWord(0)); Jump(relative_jump); } @@ -2117,7 +2119,7 @@ IGNITION_HANDLER(JumpConstant, InterpreterAssembler) { // will misbehave if passed arbitrary input values. IGNITION_HANDLER(JumpIfTrue, InterpreterAssembler) { TNode accumulator = GetAccumulator(); - Node* relative_jump = BytecodeOperandUImmWord(0); + TNode relative_jump = Signed(BytecodeOperandUImmWord(0)); CSA_ASSERT(this, IsBoolean(CAST(accumulator))); JumpIfTaggedEqual(accumulator, TrueConstant(), relative_jump); } @@ -2141,7 +2143,7 @@ IGNITION_HANDLER(JumpIfTrueConstant, InterpreterAssembler) { // will misbehave if passed arbitrary input values. IGNITION_HANDLER(JumpIfFalse, InterpreterAssembler) { TNode accumulator = GetAccumulator(); - Node* relative_jump = BytecodeOperandUImmWord(0); + TNode relative_jump = Signed(BytecodeOperandUImmWord(0)); CSA_ASSERT(this, IsBoolean(CAST(accumulator))); JumpIfTaggedEqual(accumulator, FalseConstant(), relative_jump); } @@ -2164,7 +2166,7 @@ IGNITION_HANDLER(JumpIfFalseConstant, InterpreterAssembler) { // referenced by the accumulator is true when the object is cast to boolean. IGNITION_HANDLER(JumpIfToBooleanTrue, InterpreterAssembler) { TNode value = GetAccumulator(); - Node* relative_jump = BytecodeOperandUImmWord(0); + TNode relative_jump = Signed(BytecodeOperandUImmWord(0)); Label if_true(this), if_false(this); BranchIfToBooleanIsTrue(value, &if_true, &if_false); BIND(&if_true); @@ -2195,7 +2197,7 @@ IGNITION_HANDLER(JumpIfToBooleanTrueConstant, InterpreterAssembler) { // referenced by the accumulator is false when the object is cast to boolean. IGNITION_HANDLER(JumpIfToBooleanFalse, InterpreterAssembler) { TNode value = GetAccumulator(); - Node* relative_jump = BytecodeOperandUImmWord(0); + TNode relative_jump = Signed(BytecodeOperandUImmWord(0)); Label if_true(this), if_false(this); BranchIfToBooleanIsTrue(value, &if_true, &if_false); BIND(&if_true); @@ -2226,7 +2228,7 @@ IGNITION_HANDLER(JumpIfToBooleanFalseConstant, InterpreterAssembler) { // referenced by the accumulator is the null constant. IGNITION_HANDLER(JumpIfNull, InterpreterAssembler) { TNode accumulator = GetAccumulator(); - Node* relative_jump = BytecodeOperandUImmWord(0); + TNode relative_jump = Signed(BytecodeOperandUImmWord(0)); JumpIfTaggedEqual(accumulator, NullConstant(), relative_jump); } @@ -2246,7 +2248,7 @@ IGNITION_HANDLER(JumpIfNullConstant, InterpreterAssembler) { // referenced by the accumulator is not the null constant. IGNITION_HANDLER(JumpIfNotNull, InterpreterAssembler) { TNode accumulator = GetAccumulator(); - Node* relative_jump = BytecodeOperandUImmWord(0); + TNode relative_jump = Signed(BytecodeOperandUImmWord(0)); JumpIfTaggedNotEqual(accumulator, NullConstant(), relative_jump); } @@ -2266,7 +2268,7 @@ IGNITION_HANDLER(JumpIfNotNullConstant, InterpreterAssembler) { // referenced by the accumulator is the undefined constant. IGNITION_HANDLER(JumpIfUndefined, InterpreterAssembler) { TNode accumulator = GetAccumulator(); - Node* relative_jump = BytecodeOperandUImmWord(0); + TNode relative_jump = Signed(BytecodeOperandUImmWord(0)); JumpIfTaggedEqual(accumulator, UndefinedConstant(), relative_jump); } @@ -2286,7 +2288,7 @@ IGNITION_HANDLER(JumpIfUndefinedConstant, InterpreterAssembler) { // referenced by the accumulator is not the undefined constant. IGNITION_HANDLER(JumpIfNotUndefined, InterpreterAssembler) { TNode accumulator = GetAccumulator(); - Node* relative_jump = BytecodeOperandUImmWord(0); + TNode relative_jump = Signed(BytecodeOperandUImmWord(0)); JumpIfTaggedNotEqual(accumulator, UndefinedConstant(), relative_jump); } @@ -2314,7 +2316,7 @@ IGNITION_HANDLER(JumpIfUndefinedOrNull, InterpreterAssembler) { Dispatch(); BIND(&do_jump); - Node* relative_jump = BytecodeOperandUImmWord(0); + TNode relative_jump = Signed(BytecodeOperandUImmWord(0)); Jump(relative_jump); } @@ -2342,7 +2344,7 @@ IGNITION_HANDLER(JumpIfUndefinedOrNullConstant, InterpreterAssembler) { // referenced by the accumulator is a JSReceiver. IGNITION_HANDLER(JumpIfJSReceiver, InterpreterAssembler) { TNode accumulator = GetAccumulator(); - Node* relative_jump = BytecodeOperandUImmWord(0); + TNode relative_jump = Signed(BytecodeOperandUImmWord(0)); Label if_object(this), if_notobject(this, Label::kDeferred), if_notsmi(this); Branch(TaggedIsSmi(accumulator), &if_notobject, &if_notsmi); @@ -2383,8 +2385,8 @@ IGNITION_HANDLER(JumpIfJSReceiverConstant, InterpreterAssembler) { // performs a loop nesting check and potentially triggers OSR in case the // current OSR level matches (or exceeds) the specified |loop_depth|. IGNITION_HANDLER(JumpLoop, InterpreterAssembler) { - Node* relative_jump = BytecodeOperandUImmWord(0); - Node* loop_depth = BytecodeOperandImm(1); + TNode relative_jump = Signed(BytecodeOperandUImmWord(0)); + TNode loop_depth = BytecodeOperandImm(1); Node* osr_level = LoadOsrNestingLevel(); // Check if OSR points at the given {loop_depth} are armed by comparing it to @@ -2415,9 +2417,9 @@ IGNITION_HANDLER(JumpLoop, InterpreterAssembler) { // next bytecode. IGNITION_HANDLER(SwitchOnSmiNoFeedback, InterpreterAssembler) { TNode acc = GetAccumulator(); - Node* table_start = BytecodeOperandIdx(0); - Node* table_length = BytecodeOperandUImmWord(1); - Node* case_value_base = BytecodeOperandImmIntPtr(2); + TNode table_start = BytecodeOperandIdx(0); + TNode table_length = BytecodeOperandUImmWord(1); + TNode case_value_base = BytecodeOperandImmIntPtr(2); Label fall_through(this); @@ -2426,7 +2428,7 @@ IGNITION_HANDLER(SwitchOnSmiNoFeedback, InterpreterAssembler) { // accumulator values. CSA_ASSERT(this, TaggedIsSmi(acc)); - TNode case_value = IntPtrSub(SmiUntag(CAST(acc)), case_value_base); + TNode case_value = IntPtrSub(SmiUntag(CAST(acc)), case_value_base); GotoIf(IntPtrLessThan(case_value, IntPtrConstant(0)), &fall_through); GotoIf(IntPtrGreaterThanOrEqual(case_value, table_length), &fall_through); TNode entry = IntPtrAdd(table_start, case_value); @@ -2442,10 +2444,11 @@ IGNITION_HANDLER(SwitchOnSmiNoFeedback, InterpreterAssembler) { // Creates a regular expression literal for literal index with // and the pattern in . IGNITION_HANDLER(CreateRegExpLiteral, InterpreterAssembler) { - Node* pattern = LoadConstantPoolEntryAtOperandIndex(0); + TNode pattern = LoadConstantPoolEntryAtOperandIndex(0); TNode feedback_vector = LoadFeedbackVector(); - Node* slot_id = BytecodeOperandIdx(1); - TNode flags = SmiFromInt32(BytecodeOperandFlag(2)); + TNode slot_id = BytecodeOperandIdx(1); + TNode flags = + SmiFromInt32(UncheckedCast(BytecodeOperandFlag(2))); TNode context = GetContext(); VARIABLE(result, MachineRepresentation::kTagged); @@ -2463,9 +2466,9 @@ IGNITION_HANDLER(CreateRegExpLiteral, InterpreterAssembler) { // CreateArrayLiteral flags and constant elements in . IGNITION_HANDLER(CreateArrayLiteral, InterpreterAssembler) { TNode feedback_vector = LoadFeedbackVector(); - Node* slot_id = BytecodeOperandIdx(1); + TNode slot_id = BytecodeOperandIdx(1); TNode context = GetContext(); - Node* bytecode_flags = BytecodeOperandFlag(2); + TNode bytecode_flags = BytecodeOperandFlag(2); Label fast_shallow_clone(this), call_runtime(this, Label::kDeferred); // No feedback, so handle it as a slow case. @@ -2491,10 +2494,10 @@ IGNITION_HANDLER(CreateArrayLiteral, InterpreterAssembler) { DecodeWordFromWord32( bytecode_flags); TNode flags = SmiTag(Signed(flags_raw)); - Node* constant_elements = LoadConstantPoolEntryAtOperandIndex(0); + TNode constant_elements = LoadConstantPoolEntryAtOperandIndex(0); TNode result = CallRuntime(Runtime::kCreateArrayLiteral, context, feedback_vector, - SmiTag(slot_id), constant_elements, flags); + SmiTag(Signed(slot_id)), constant_elements, flags); SetAccumulator(result); Dispatch(); } @@ -2505,7 +2508,7 @@ IGNITION_HANDLER(CreateArrayLiteral, InterpreterAssembler) { // Creates an empty JSArray literal for literal index . IGNITION_HANDLER(CreateEmptyArrayLiteral, InterpreterAssembler) { TNode feedback_vector = LoadFeedbackVector(); - Node* slot_id = BytecodeOperandIdx(0); + TNode slot_id = BytecodeOperandIdx(0); TNode context = GetContext(); Label no_feedback(this, Label::kDeferred), end(this); @@ -2551,8 +2554,8 @@ IGNITION_HANDLER(CreateArrayFromIterable, InterpreterAssembler) { // CreateObjectLiteralFlags and constant elements in . IGNITION_HANDLER(CreateObjectLiteral, InterpreterAssembler) { TNode feedback_vector = LoadFeedbackVector(); - Node* slot_id = BytecodeOperandIdx(1); - Node* bytecode_flags = BytecodeOperandFlag(2); + TNode slot_id = BytecodeOperandIdx(1); + TNode bytecode_flags = BytecodeOperandFlag(2); Label if_fast_clone(this), if_not_fast_clone(this, Label::kDeferred); // No feedback, so handle it as a slow case. @@ -2585,9 +2588,9 @@ IGNITION_HANDLER(CreateObjectLiteral, InterpreterAssembler) { bytecode_flags); TNode flags = SmiTag(Signed(flags_raw)); - TNode result = - CallRuntime(Runtime::kCreateObjectLiteral, context, feedback_vector, - SmiTag(slot_id), object_boilerplate_description, flags); + TNode result = CallRuntime(Runtime::kCreateObjectLiteral, context, + feedback_vector, SmiTag(Signed(slot_id)), + object_boilerplate_description, flags); SetAccumulator(result); // TODO(klaasb) build a single dispatch once the call is inlined Dispatch(); @@ -2611,11 +2614,11 @@ IGNITION_HANDLER(CreateEmptyObjectLiteral, InterpreterAssembler) { // {source}, converting getters into data properties. IGNITION_HANDLER(CloneObject, InterpreterAssembler) { TNode source = LoadRegisterAtOperandIndex(0); - Node* bytecode_flags = BytecodeOperandFlag(1); + TNode bytecode_flags = BytecodeOperandFlag(1); TNode raw_flags = DecodeWordFromWord32(bytecode_flags); TNode smi_flags = SmiTag(Signed(raw_flags)); - Node* raw_slot = BytecodeOperandIdx(2); + TNode raw_slot = Signed(BytecodeOperandIdx(2)); TNode smi_slot = SmiTag(raw_slot); TNode maybe_feedback_vector = LoadFeedbackVector(); TNode context = GetContext(); @@ -2634,7 +2637,7 @@ IGNITION_HANDLER(CloneObject, InterpreterAssembler) { // specification. IGNITION_HANDLER(GetTemplateObject, InterpreterAssembler) { TNode feedback_vector = LoadFeedbackVector(); - Node* slot = BytecodeOperandIdx(1); + TNode slot = BytecodeOperandIdx(1); Label call_runtime(this, Label::kDeferred); GotoIf(IsUndefined(feedback_vector), &call_runtime); @@ -2649,8 +2652,8 @@ IGNITION_HANDLER(GetTemplateObject, InterpreterAssembler) { BIND(&call_runtime); { - Node* description = LoadConstantPoolEntryAtOperandIndex(0); - TNode slot_smi = SmiTag(slot); + TNode description = LoadConstantPoolEntryAtOperandIndex(0); + TNode slot_smi = SmiTag(Signed(slot)); TNode closure = CAST(LoadRegister(Register::function_closure())); TNode shared_info = LoadObjectField( @@ -2675,10 +2678,10 @@ IGNITION_HANDLER(GetTemplateObject, InterpreterAssembler) { // Creates a new closure for SharedFunctionInfo at position |index| in the // constant pool and with pretenuring controlled by |flags|. IGNITION_HANDLER(CreateClosure, InterpreterAssembler) { - Node* shared = LoadConstantPoolEntryAtOperandIndex(0); - Node* flags = BytecodeOperandFlag(2); + TNode shared = LoadConstantPoolEntryAtOperandIndex(0); + TNode flags = BytecodeOperandFlag(2); TNode context = GetContext(); - Node* slot = BytecodeOperandIdx(1); + TNode slot = BytecodeOperandIdx(1); Label if_undefined(this); TNode feedback_cell_array = @@ -2727,7 +2730,7 @@ IGNITION_HANDLER(CreateClosure, InterpreterAssembler) { // // Creates a new block context with the scope info constant at |index|. IGNITION_HANDLER(CreateBlockContext, InterpreterAssembler) { - Node* scope_info = LoadConstantPoolEntryAtOperandIndex(0); + TNode scope_info = CAST(LoadConstantPoolEntryAtOperandIndex(0)); TNode context = GetContext(); SetAccumulator(CallRuntime(Runtime::kPushBlockContext, context, scope_info)); Dispatch(); @@ -2739,7 +2742,7 @@ IGNITION_HANDLER(CreateBlockContext, InterpreterAssembler) { // and the ScopeInfo at |scope_info_idx|. IGNITION_HANDLER(CreateCatchContext, InterpreterAssembler) { TNode exception = LoadRegisterAtOperandIndex(0); - Node* scope_info = LoadConstantPoolEntryAtOperandIndex(1); + TNode scope_info = CAST(LoadConstantPoolEntryAtOperandIndex(1)); TNode context = GetContext(); SetAccumulator( CallRuntime(Runtime::kPushCatchContext, context, exception, scope_info)); @@ -2750,8 +2753,8 @@ IGNITION_HANDLER(CreateCatchContext, InterpreterAssembler) { // // Creates a new context with number of |slots| for the function closure. IGNITION_HANDLER(CreateFunctionContext, InterpreterAssembler) { - Node* scope_info_idx = BytecodeOperandIdx(0); - Node* scope_info = LoadConstantPoolEntry(scope_info_idx); + TNode scope_info_idx = BytecodeOperandIdx(0); + TNode scope_info = CAST(LoadConstantPoolEntry(scope_info_idx)); TNode slots = BytecodeOperandUImm(1); TNode context = GetContext(); ConstructorBuiltinsAssembler constructor_assembler(state()); @@ -2764,8 +2767,8 @@ IGNITION_HANDLER(CreateFunctionContext, InterpreterAssembler) { // // Creates a new context with number of |slots| for an eval closure. IGNITION_HANDLER(CreateEvalContext, InterpreterAssembler) { - Node* scope_info_idx = BytecodeOperandIdx(0); - Node* scope_info = LoadConstantPoolEntry(scope_info_idx); + TNode scope_info_idx = BytecodeOperandIdx(0); + TNode scope_info = CAST(LoadConstantPoolEntry(scope_info_idx)); TNode slots = BytecodeOperandUImm(1); TNode context = GetContext(); ConstructorBuiltinsAssembler constructor_assembler(state()); @@ -2780,7 +2783,7 @@ IGNITION_HANDLER(CreateEvalContext, InterpreterAssembler) { // with-statement with the object in |register|. IGNITION_HANDLER(CreateWithContext, InterpreterAssembler) { TNode object = LoadRegisterAtOperandIndex(0); - Node* scope_info = LoadConstantPoolEntryAtOperandIndex(1); + TNode scope_info = CAST(LoadConstantPoolEntryAtOperandIndex(1)); TNode context = GetContext(); SetAccumulator( CallRuntime(Runtime::kPushWithContext, context, object, scope_info)); @@ -2903,8 +2906,8 @@ IGNITION_HANDLER(ReThrow, InterpreterAssembler) { // // Aborts execution (via a call to the runtime function). IGNITION_HANDLER(Abort, InterpreterAssembler) { - Node* reason = BytecodeOperandIdx(0); - CallRuntime(Runtime::kAbort, NoContextConstant(), SmiTag(reason)); + TNode reason = BytecodeOperandIdx(0); + CallRuntime(Runtime::kAbort, NoContextConstant(), SmiTag(Signed(reason))); Unreachable(); } @@ -2929,7 +2932,7 @@ IGNITION_HANDLER(ThrowReferenceErrorIfHole, InterpreterAssembler) { BIND(&throw_error); { - Node* name = LoadConstantPoolEntryAtOperandIndex(0); + TNode name = CAST(LoadConstantPoolEntryAtOperandIndex(0)); CallRuntime(Runtime::kThrowAccessedUninitializedVariable, GetContext(), name); // We shouldn't ever return from a throw. @@ -3010,7 +3013,7 @@ DEBUG_BREAK_BYTECODE_LIST(DEBUG_BREAK) // coverage. IGNITION_HANDLER(IncBlockCounter, InterpreterAssembler) { TNode closure = LoadRegister(Register::function_closure()); - Node* coverage_array_slot = BytecodeOperandIdxSmi(0); + TNode coverage_array_slot = BytecodeOperandIdxSmi(0); TNode context = GetContext(); CallBuiltin(Builtins::kIncBlockCounter, context, closure, @@ -3060,7 +3063,7 @@ IGNITION_HANDLER(ForInEnumerate, InterpreterAssembler) { IGNITION_HANDLER(ForInPrepare, InterpreterAssembler) { // The {enumerator} is either a Map or a FixedArray. TNode enumerator = CAST(GetAccumulator()); - Node* vector_index = BytecodeOperandIdx(1); + TNode vector_index = BytecodeOperandIdx(1); TNode maybe_feedback_vector = LoadFeedbackVector(); // Check if we're using an enum cache. @@ -3125,7 +3128,7 @@ IGNITION_HANDLER(ForInNext, InterpreterAssembler) { TNode cache_type; TNode cache_array; std::tie(cache_type, cache_array) = LoadRegisterPairAtOperandIndex(2); - Node* vector_index = BytecodeOperandIdx(3); + TNode vector_index = BytecodeOperandIdx(3); TNode maybe_feedback_vector = LoadFeedbackVector(); // Load the next key from the enumeration array. @@ -3203,7 +3206,7 @@ IGNITION_HANDLER(GetIterator, InterpreterAssembler) { TNode receiver = LoadRegisterAtOperandIndex(0); TNode context = GetContext(); TNode feedback_vector = LoadFeedbackVector(); - Node* feedback_slot = BytecodeOperandIdx(1); + TNode feedback_slot = Signed(BytecodeOperandIdx(1)); TNode smi_slot = SmiTag(feedback_slot); TNode result = @@ -3249,7 +3252,7 @@ IGNITION_HANDLER(SuspendGenerator, InterpreterAssembler) { TNode closure = CAST(LoadRegister(Register::function_closure())); TNode context = GetContext(); RegListNodePair registers = GetRegisterListAtOperandIndex(1); - Node* suspend_id = BytecodeOperandUImmSmi(3); + TNode suspend_id = BytecodeOperandUImmSmi(3); TNode shared = CAST(LoadObjectField(closure, JSFunction::kSharedFunctionInfoOffset)); @@ -3297,10 +3300,10 @@ IGNITION_HANDLER(SwitchOnGeneratorState, InterpreterAssembler) { CAST(LoadObjectField(generator, JSGeneratorObject::kContextOffset)); SetContext(context); - Node* table_start = BytecodeOperandIdx(1); + TNode table_start = BytecodeOperandIdx(1); // TODO(leszeks): table_length is only used for a CSA_ASSERT, we don't // actually need it otherwise. - Node* table_length = BytecodeOperandUImmWord(2); + TNode table_length = BytecodeOperandUImmWord(2); // The state must be a Smi. CSA_ASSERT(this, TaggedIsSmi(state)); diff --git a/test/unittests/interpreter/interpreter-assembler-unittest.cc b/test/unittests/interpreter/interpreter-assembler-unittest.cc index a8ff998107..a44bad95d3 100644 --- a/test/unittests/interpreter/interpreter-assembler-unittest.cc +++ b/test/unittests/interpreter/interpreter-assembler-unittest.cc @@ -444,7 +444,7 @@ TARGET_TEST_F(InterpreterAssemblerTest, LoadConstantPoolEntry) { InterpreterAssemblerForTest m(&state, bytecode); { TNode index = m.IntPtrConstant(2); - Node* load_constant = m.LoadConstantPoolEntry(index); + TNode load_constant = m.LoadConstantPoolEntry(index); #ifdef V8_COMPRESS_POINTERS Matcher constant_pool_matcher = IsChangeCompressedToTagged(m.IsLoadFromObject( @@ -474,7 +474,8 @@ TARGET_TEST_F(InterpreterAssemblerTest, LoadConstantPoolEntry) { } { Node* index = m.Parameter(2); - Node* load_constant = m.LoadConstantPoolEntry(index); + TNode load_constant = + m.LoadConstantPoolEntry(m.ReinterpretCast(index)); #if V8_COMPRESS_POINTERS Matcher constant_pool_matcher = IsChangeCompressedToTagged(m.IsLoadFromObject(