Skip to content

Commit a917b1c

Browse files
santiaboyCommit Bot
authored andcommitted
[CSA] TNodify the rest of the member variables in interpreter assembler
TNodify related methods: * BytecodeArrayTaggedPointer * DispatchTablePointer (renamed from DispatchTableRawPointer) * GetAccumulatorUnchecked SloppyTNodify SetAccumulator's argument. Marking some tests as slow, due to TNodification. Bug: v8:6949 Change-Id: I3a56c47247828ec1313ce69ce76064efedf57776 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1782162 Reviewed-by: Ross McIlroy <rmcilroy@chromium.org> Reviewed-by: Tobias Tebbi <tebbi@chromium.org> Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org> Cr-Commit-Position: refs/heads/master@{#63573}
1 parent 26b3649 commit a917b1c

7 files changed

Lines changed: 68 additions & 43 deletions

File tree

src/compiler/code-assembler.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1408,8 +1408,8 @@ Node* CodeAssembler::TailCallBytecodeDispatch(
14081408
// Instantiate TailCallBytecodeDispatch() for argument counts used by
14091409
// CSA-generated code
14101410
template V8_EXPORT_PRIVATE Node* CodeAssembler::TailCallBytecodeDispatch(
1411-
const CallInterfaceDescriptor& descriptor, Node* target, Node*, Node*,
1412-
Node*, Node*);
1411+
const CallInterfaceDescriptor& descriptor, Node* target, TNode<Object>,
1412+
Node*, TNode<BytecodeArray>, TNode<ExternalReference>);
14131413

14141414
TNode<Object> CodeAssembler::TailCallJSCode(TNode<Code> code,
14151415
TNode<Context> context,

src/compiler/code-assembler.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,10 @@ struct MachineRepresentationOf<
218218
static const MachineRepresentation value =
219219
MachineTypeOf<T>::value.representation();
220220
};
221+
template <>
222+
struct MachineRepresentationOf<ExternalReference> {
223+
static const MachineRepresentation value = RawPtrT::kMachineRepresentation;
224+
};
221225

222226
template <class T>
223227
struct is_valid_type_tag {

src/interpreter/interpreter-assembler.cc

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,19 @@ InterpreterAssembler::InterpreterAssembler(CodeAssemblerState* state,
3232
bytecode_(bytecode),
3333
operand_scale_(operand_scale),
3434
TVARIABLE_CONSTRUCTOR(interpreted_frame_pointer_),
35-
VARIABLE_CONSTRUCTOR(
36-
bytecode_array_, MachineRepresentation::kTagged,
37-
Parameter(InterpreterDispatchDescriptor::kBytecodeArray)),
35+
TVARIABLE_CONSTRUCTOR(
36+
bytecode_array_,
37+
CAST(Parameter(InterpreterDispatchDescriptor::kBytecodeArray))),
3838
TVARIABLE_CONSTRUCTOR(
3939
bytecode_offset_,
4040
UncheckedCast<IntPtrT>(
4141
Parameter(InterpreterDispatchDescriptor::kBytecodeOffset))),
42-
VARIABLE_CONSTRUCTOR(
43-
dispatch_table_, MachineType::PointerRepresentation(),
44-
Parameter(InterpreterDispatchDescriptor::kDispatchTable)),
45-
VARIABLE_CONSTRUCTOR(
46-
accumulator_, MachineRepresentation::kTagged,
47-
Parameter(InterpreterDispatchDescriptor::kAccumulator)),
42+
TVARIABLE_CONSTRUCTOR(
43+
dispatch_table_, UncheckedCast<ExternalReference>(Parameter(
44+
InterpreterDispatchDescriptor::kDispatchTable))),
45+
TVARIABLE_CONSTRUCTOR(
46+
accumulator_,
47+
CAST(Parameter(InterpreterDispatchDescriptor::kAccumulator))),
4848
accumulator_use_(AccumulatorUse::kNone),
4949
made_call_(false),
5050
reloaded_frame_ptr_(false),
@@ -129,27 +129,27 @@ void InterpreterAssembler::SaveBytecodeOffset() {
129129
}
130130
}
131131

132-
Node* InterpreterAssembler::BytecodeArrayTaggedPointer() {
132+
TNode<BytecodeArray> InterpreterAssembler::BytecodeArrayTaggedPointer() {
133133
// Force a re-load of the bytecode array after every call in case the debugger
134134
// has been activated.
135135
if (!bytecode_array_valid_) {
136-
bytecode_array_.Bind(LoadRegister(Register::bytecode_array()));
136+
bytecode_array_ = CAST(LoadRegister(Register::bytecode_array()));
137137
bytecode_array_valid_ = true;
138138
}
139139
return bytecode_array_.value();
140140
}
141141

142-
Node* InterpreterAssembler::DispatchTableRawPointer() {
142+
TNode<ExternalReference> InterpreterAssembler::DispatchTablePointer() {
143143
if (Bytecodes::MakesCallAlongCriticalPath(bytecode_) && made_call_ &&
144144
(dispatch_table_.value() ==
145145
Parameter(InterpreterDispatchDescriptor::kDispatchTable))) {
146-
dispatch_table_.Bind(ExternalConstant(
147-
ExternalReference::interpreter_dispatch_table_address(isolate())));
146+
dispatch_table_ = ExternalConstant(
147+
ExternalReference::interpreter_dispatch_table_address(isolate()));
148148
}
149149
return dispatch_table_.value();
150150
}
151151

152-
Node* InterpreterAssembler::GetAccumulatorUnchecked() {
152+
TNode<Object> InterpreterAssembler::GetAccumulatorUnchecked() {
153153
return accumulator_.value();
154154
}
155155

@@ -159,10 +159,11 @@ TNode<Object> InterpreterAssembler::GetAccumulator() {
159159
return TaggedPoisonOnSpeculation(GetAccumulatorUnchecked());
160160
}
161161

162-
void InterpreterAssembler::SetAccumulator(Node* value) {
162+
// TODO(v8:6949): Remove sloppy-ness from SetAccumulator's value argument.
163+
void InterpreterAssembler::SetAccumulator(SloppyTNode<Object> value) {
163164
DCHECK(Bytecodes::WritesAccumulator(bytecode_));
164165
accumulator_use_ = accumulator_use_ | AccumulatorUse::kWrite;
165-
accumulator_.Bind(value);
166+
accumulator_ = value;
166167
}
167168

168169
TNode<Context> InterpreterAssembler::GetContext() {
@@ -1436,9 +1437,8 @@ Node* InterpreterAssembler::DispatchToBytecode(Node* target_bytecode,
14361437
TraceBytecodeDispatch(target_bytecode);
14371438
}
14381439

1439-
Node* target_code_entry =
1440-
Load(MachineType::Pointer(), DispatchTableRawPointer(),
1441-
TimesSystemPointerSize(target_bytecode));
1440+
Node* target_code_entry = Load(MachineType::Pointer(), DispatchTablePointer(),
1441+
TimesSystemPointerSize(target_bytecode));
14421442

14431443
return DispatchToBytecodeHandlerEntry(target_code_entry, new_bytecode_offset,
14441444
target_bytecode);
@@ -1462,7 +1462,7 @@ Node* InterpreterAssembler::DispatchToBytecodeHandlerEntry(
14621462
return TailCallBytecodeDispatch(
14631463
InterpreterDispatchDescriptor{}, poisoned_handler_entry,
14641464
GetAccumulatorUnchecked(), bytecode_offset, BytecodeArrayTaggedPointer(),
1465-
DispatchTableRawPointer());
1465+
DispatchTablePointer());
14661466
}
14671467

14681468
void InterpreterAssembler::DispatchWide(OperandScale operand_scale) {
@@ -1493,9 +1493,8 @@ void InterpreterAssembler::DispatchWide(OperandScale operand_scale) {
14931493
UNREACHABLE();
14941494
}
14951495
TNode<WordT> target_index = IntPtrAdd(base_index, next_bytecode);
1496-
Node* target_code_entry =
1497-
Load(MachineType::Pointer(), DispatchTableRawPointer(),
1498-
TimesSystemPointerSize(target_index));
1496+
Node* target_code_entry = Load(MachineType::Pointer(), DispatchTablePointer(),
1497+
TimesSystemPointerSize(target_index));
14991498

15001499
DispatchToBytecodeHandlerEntry(target_code_entry, next_bytecode_offset,
15011500
next_bytecode);

src/interpreter/interpreter-assembler.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class V8_EXPORT_PRIVATE InterpreterAssembler : public CodeStubAssembler {
6868

6969
// Accumulator.
7070
compiler::TNode<Object> GetAccumulator();
71-
void SetAccumulator(compiler::Node* value);
71+
void SetAccumulator(SloppyTNode<Object> value);
7272

7373
// Context.
7474
compiler::TNode<Context> GetContext();
@@ -277,16 +277,16 @@ class V8_EXPORT_PRIVATE InterpreterAssembler : public CodeStubAssembler {
277277
void ToNumberOrNumeric(Object::Conversion mode);
278278

279279
private:
280-
// Returns a tagged pointer to the current function's BytecodeArray object.
281-
compiler::Node* BytecodeArrayTaggedPointer();
280+
// Returns a pointer to the current function's BytecodeArray object.
281+
TNode<BytecodeArray> BytecodeArrayTaggedPointer();
282282

283-
// Returns a raw pointer to first entry in the interpreter dispatch table.
284-
compiler::Node* DispatchTableRawPointer();
283+
// Returns a pointer to first entry in the interpreter dispatch table.
284+
TNode<ExternalReference> DispatchTablePointer();
285285

286286
// Returns the accumulator value without checking whether bytecode
287287
// uses it. This is intended to be used only in dispatch and in
288288
// tracing as these need to bypass accumulator use validity checks.
289-
compiler::Node* GetAccumulatorUnchecked();
289+
TNode<Object> GetAccumulatorUnchecked();
290290

291291
// Returns the frame pointer for the interpreted frame of the function being
292292
// interpreted.
@@ -424,11 +424,11 @@ class V8_EXPORT_PRIVATE InterpreterAssembler : public CodeStubAssembler {
424424

425425
Bytecode bytecode_;
426426
OperandScale operand_scale_;
427-
TVariable<RawPtrT> interpreted_frame_pointer_;
428-
CodeStubAssembler::Variable bytecode_array_;
429-
TVariable<IntPtrT> bytecode_offset_;
430-
CodeStubAssembler::Variable dispatch_table_;
431-
CodeStubAssembler::Variable accumulator_;
427+
CodeStubAssembler::TVariable<RawPtrT> interpreted_frame_pointer_;
428+
CodeStubAssembler::TVariable<BytecodeArray> bytecode_array_;
429+
CodeStubAssembler::TVariable<IntPtrT> bytecode_offset_;
430+
CodeStubAssembler::TVariable<ExternalReference> dispatch_table_;
431+
CodeStubAssembler::TVariable<Object> accumulator_;
432432
AccumulatorUse accumulator_use_;
433433
bool made_call_;
434434
bool reloaded_frame_ptr_;

test/cctest/cctest.status

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,8 @@
151151
# Pass but take too long with the simulator.
152152
'test-api/ExternalArrays': [PASS, SLOW],
153153
'test-api/Threading*': [SKIP],
154+
'test-cpu-profiler/MultipleIsolates': [PASS, SLOW],
155+
'test-debug/DebugBreakStackTrace': [PASS, SLOW],
154156
}], # 'arch == arm64 and simulator_run'
155157

156158
##############################################################################
@@ -259,6 +261,7 @@
259261
['arch == arm and simulator_run', {
260262
# Pass but take too long with the simulator.
261263
'test-api/Threading*': [SKIP],
264+
'test-cpu-profiler/MultipleIsolates': [PASS, SLOW],
262265
}], # 'arch == arm and simulator_run'
263266

264267
##############################################################################

test/mjsunit/mjsunit.status

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -470,11 +470,13 @@
470470
'array-reduce': [PASS, SLOW],
471471
'array-sort': [PASS, SLOW],
472472
'array-splice': [PASS, SLOW],
473+
'array-store-and-grow': [PASS, SLOW],
473474
'bit-not': [PASS, SLOW],
474475
'compiler/alloc-number': [PASS, SLOW],
475476
'compiler/osr-with-args': [PASS, SLOW],
476477
'generated-transition-stub': [PASS, SLOW],
477478
'json2': [PASS, SLOW],
479+
'large-object-literal-slow-elements': [PASS, SLOW],
478480
'math-floor-of-div-nosudiv': [PASS, SLOW],
479481
'math-floor-of-div': [PASS, SLOW],
480482
'messages': [PASS, SLOW],
@@ -486,6 +488,7 @@
486488
'regress/regress-create-exception': [PASS, SLOW],
487489
'regress/regress-json-stringify-gc': [PASS, SLOW],
488490
'string-indexof-2': [PASS, SLOW],
491+
'unbox-double-arrays': [PASS, SLOW],
489492
'unicodelctest-no-optimization': [PASS, SLOW],
490493
'unicodelctest': [PASS, SLOW],
491494
'unicode-test': [PASS, SLOW],
@@ -494,14 +497,27 @@
494497

495498
# BUG(v8:7247).
496499
'regress/regress-779407': [PASS, SLOW, NO_VARIANTS],
497-
498-
# BUG(v8:9256). Slow with pointer compression.
499-
'regress/regress-708247': [PASS, ['pointer_compression', SLOW]],
500-
'es6/array-concat': [PASS, ['pointer_compression', SLOW]],
501-
'non-extensible-array-reduce': [PASS, ['pointer_compression', SLOW]],
502-
'regress/regress-454725': [PASS, ['pointer_compression', SLOW]],
503500
}], # 'arch == arm64'
504501

502+
##############################################################################
503+
['arch == arm64 and simulator_run', {
504+
# Slow in simulator builds
505+
'compiler/osr-follow': [PASS, SLOW],
506+
'es6/array-concat': [PASS, SLOW],
507+
'non-extensible-array-reduce': [PASS, SLOW],
508+
'regress/regress-454725': [PASS, SLOW],
509+
'regress/regress-708247': [PASS, SLOW],
510+
'compiler/osr-big': [PASS, SLOW],
511+
'frozen-array-reduce': [PASS, SLOW],
512+
'json': [PASS, SLOW],
513+
'sealed-array-reduce': [PASS, SLOW],
514+
'try': [PASS, SLOW],
515+
516+
# Slow without pointer compression
517+
'wasm/asm-wasm-u32': [PASS, ['not pointer_compression', SLOW]],
518+
}], # 'arch == arm64 and simulator_run'
519+
520+
##############################################################################
505521
['arch == arm64 and mode == debug and simulator_run', {
506522

507523
# Pass but take too long with the simulator in debug mode.

test/mozilla/mozilla.status

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1035,6 +1035,9 @@
10351035

10361036
#BUG(3152): Avoid C stack overflow.
10371037
'js1_5/extensions/regress-355497': [FAIL_OK, '--sim-stack-size=512'],
1038+
1039+
# Slow without pointer compression
1040+
'js1_5/Regress/regress-80981': [PASS, ['not pointer_compression', SLOW]],
10381041
}], # 'arch == arm64 and simulator_run'
10391042

10401043
['system == android', {

0 commit comments

Comments
 (0)