Commit ed93fc67 authored by Sigurd Schneider's avatar Sigurd Schneider Committed by Commit Bot

[ia32,root] Enable compilation with the PreserveRoot register config

Change-Id: I2499c3ada16bdf51f7830847753b856aa8aaff46
Bug: v8:6666
Reviewed-on: https://chromium-review.googlesource.com/c/1270836
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56515}
parent 7074113d
......@@ -1351,11 +1351,7 @@ void VisitPairAtomicBinOp(InstructionSelector* selector, Node* node,
// For Word64 operations, the value input is split into the a high node,
// and a low node in the int64-lowering phase.
Node* value_high = node->InputAt(3);
#if defined(V8_EMBEDDED_BUILTINS)
bool block_root_register = !selector->CanUseRootsRegister();
#else
bool block_root_register = true;
#endif
bool block_root_register = !FLAG_embedded_builtins;
// Wasm lives in 32-bit address space, so we do not need to worry about
// base/index lowering. This will need to be fixed for Wasm64.
......@@ -1805,11 +1801,7 @@ void InstructionSelector::VisitWord32AtomicPairStore(Node* node) {
Node* index = node->InputAt(1);
Node* value = node->InputAt(2);
Node* value_high = node->InputAt(3);
#if defined(V8_EMBEDDED_BUILTINS)
bool block_root_register = !CanUseRootsRegister();
#else
bool block_root_register = true;
#endif
bool block_root_register = !FLAG_embedded_builtins;
AddressingMode addressing_mode;
InstructionOperand inputs[] = {
......@@ -1855,11 +1847,7 @@ void InstructionSelector::VisitWord32AtomicPairCompareExchange(Node* node) {
IA32OperandGenerator g(this);
Node* index = node->InputAt(1);
AddressingMode addressing_mode;
#if defined(V8_EMBEDDED_BUILTINS)
bool block_root_register = !CanUseRootsRegister();
#else
bool block_root_register = true;
#endif
bool block_root_register = !FLAG_embedded_builtins;
InstructionOperand inputs[] = {
// High, Low values of old value
......
......@@ -2450,22 +2450,25 @@ bool PipelineImpl::SelectInstructions(Linkage* linkage) {
AllocateRegisters(config.get(), call_descriptor, run_verifier);
} else if (data->info()->GetPoisoningMitigationLevel() !=
PoisoningMitigationLevel::kDontPoison) {
#if defined(V8_TARGET_ARCH_IA32)
DCHECK(!FLAG_embedded_builtins);
#endif
AllocateRegisters(RegisterConfiguration::Poisoning(), call_descriptor,
run_verifier);
} else {
#if defined(V8_TARGET_ARCH_IA32) && defined(V8_EMBEDDED_BUILTINS)
} else if (Builtins::IsBuiltinId(data->info()->builtin_index())) {
// TODO(v8:6666): Extend support to user code. Ensure that
// it is mutually exclusive with the Poisoning configuration above; and that
// it cooperates with restricted allocatable registers above.
// TODO(v8:6666): Ensure that that this configuration cooperates with
// restricted allocatable registers above, i.e. that we guarantee a
// restricted configuration cannot allocate kRootRegister on ia32.
static_assert(kRootRegister == kSpeculationPoisonRegister,
"The following checks assume root equals poison register");
CHECK_IMPLIES(FLAG_embedded_builtins, !FLAG_untrusted_code_mitigations);
CHECK(!FLAG_untrusted_code_mitigations);
AllocateRegisters(RegisterConfiguration::PreserveRootIA32(),
call_descriptor, run_verifier);
#endif // defined(V8_TARGET_ARCH_IA32) && defined(V8_EMBEDDED_BUILTINS)
} else {
#else
AllocateRegisters(RegisterConfiguration::Default(), call_descriptor,
run_verifier);
#endif // defined(V8_TARGET_ARCH_IA32) && defined(V8_EMBEDDED_BUILTINS)
}
// Verify the instruction sequence has the same hash in two stages.
......@@ -2536,6 +2539,11 @@ void PipelineImpl::AssembleCode(Linkage* linkage) {
PipelineData* data = this->data_;
data->BeginPhaseKind("code generation");
data->InitializeCodeGenerator(linkage);
#if defined(V8_TARGET_ARCH_IA32) && defined(V8_EMBEDDED_BUILTINS)
code_generator()->tasm()->set_ebx_addressable(false);
#endif
Run<AssembleCodePhase>();
if (data->info()->trace_turbo_json_enabled()) {
TurboJsonFile json_of(data->info(), std::ios_base::app);
......
......@@ -1802,6 +1802,10 @@ class V8_EXPORT_PRIVATE Assembler : public AssemblerBase {
typedef SetRootRegisterSupportScope<false> SupportsRootRegisterScope;
typedef SetRootRegisterSupportScope<true> AllowExplicitEbxAccessScope;
void set_ebx_addressable(bool is_addressable) {
is_ebx_addressable_ = is_addressable;
}
protected:
void emit_sse_operand(XMMRegister reg, Operand adr);
void emit_sse_operand(XMMRegister dst, XMMRegister src);
......
......@@ -892,4 +892,44 @@
'wasm/asm-wasm-f64': [SKIP],
}], # arch == x64
##############################################################################
['arch == ia32 and embedded_builtins == True', {
# TODO(v8:6666): Fix arguments adaptor trampoline
'wasm/compiled-module-serialization': [SKIP],
'asm/embenchen/copy': [FAIL],
'wasm/embenchen/corrections': [FAIL],
'asm/embenchen/primes': [FAIL],
'asm/embenchen/corrections': [FAIL],
'wasm/embenchen/copy': [FAIL],
'asm/embenchen/fannkuch': [FAIL],
'asm/embenchen/memops': [FAIL],
'asm/embenchen/fasta': [FAIL],
'wasm/embenchen/fannkuch': [FAIL],
'asm/embenchen/zlib': [FAIL],
'wasm/embenchen/fasta': [FAIL],
'wasm/embenchen/primes': [FAIL],
'wasm/embenchen/box2d': [FAIL],
'asm/embenchen/box2d': [FAIL],
'wasm/embenchen/memops': [FAIL],
'wasm/embenchen/zlib': [FAIL],
'asm/embenchen/lua_binarytrees': [FAIL],
'wasm/embenchen/lua_binarytrees': [FAIL],
'asm/sqlite3/sqlite': [FAIL],
'asm/sqlite3/sqlite-safe-heap': [FAIL],
'asm/sqlite3/sqlite-pointer-masking': [FAIL],
'asm/poppler/poppler': [FAIL],
'regress/wasm/regress-808848': [FAIL],
'regress/wasm/regress-834624': [FAIL],
'regress/wasm/regress-843563': [FAIL],
'wasm/anyref': [FAIL],
'wasm/exceptions-shared': [FAIL],
'wasm/errors': [FAIL],
'wasm/ffi-error': [FAIL],
'wasm/gc-frame': [FAIL],
'wasm/import-function': [FAIL],
'wasm/ffi': [FAIL],
'wasm/test-wasm-module-builder': [FAIL],
'wasm/stackwalk': [FAIL],
}], # arch == ia32 and embedded_builtins == True
]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment