Commit 50ddb12d authored by Victor Gomes's avatar Victor Gomes Committed by Commit Bot

[cleanup] Remove V8_REVERSE_JSARGS flag

Change-Id: I2f262f4545de9e421310094d0dfab2f6147869b5
Bug: v8:10201
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2466116Reviewed-by: 's avatarJunliang Yan <junyan@redhat.com>
Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
Reviewed-by: 's avatarMichael Achenbach <machenbach@chromium.org>
Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70502}
parent d2d7f476
......@@ -112,9 +112,6 @@ declare_args() {
# Disable arguments adaptor frame (sets -dV8_NO_ARGUMENTS_ADAPTOR).
v8_disable_arguments_adaptor = v8_current_cpu == "x64"
# Reverse JS arguments order in the stack (sets -dV8_REVERSE_JSARGS).
v8_enable_reverse_jsargs = true
# Sets -dOBJECT_PRINT.
v8_enable_object_print = ""
......@@ -373,10 +370,6 @@ assert(!v8_use_multi_snapshots || !v8_control_flow_integrity,
assert(!v8_enable_heap_sandbox || v8_enable_pointer_compression,
"V8 Heap Sandbox requires pointer compression")
assert(
!v8_disable_arguments_adaptor || v8_enable_reverse_jsargs,
"Disabling the arguments adaptor frame requires reversing the JS arguments stack")
assert(!v8_enable_unconditional_write_barriers || !v8_disable_write_barriers,
"Write barriers can't be both enabled and disabled")
......@@ -535,9 +528,6 @@ config("v8_header_features") {
if (v8_disable_arguments_adaptor) {
defines += [ "V8_NO_ARGUMENTS_ADAPTOR" ]
}
if (v8_enable_reverse_jsargs) {
defines += [ "V8_REVERSE_JSARGS" ]
}
}
# Put defines here that are only used in our internal files and NEVER in
......
......@@ -11246,22 +11246,14 @@ template<typename T>
Local<Value> FunctionCallbackInfo<T>::operator[](int i) const {
// values_ points to the first argument (not the receiver).
if (i < 0 || length_ <= i) return Local<Value>(*Undefined(GetIsolate()));
#ifdef V8_REVERSE_JSARGS
return Local<Value>(reinterpret_cast<Value*>(values_ + i));
#else
return Local<Value>(reinterpret_cast<Value*>(values_ - i));
#endif
}
template<typename T>
Local<Object> FunctionCallbackInfo<T>::This() const {
// values_ points to the first argument (not the receiver).
#ifdef V8_REVERSE_JSARGS
return Local<Object>(reinterpret_cast<Object*>(values_ - 1));
#else
return Local<Object>(reinterpret_cast<Object*>(values_ + 1));
#endif
}
......
......@@ -539,7 +539,7 @@
'debug_x64_trybot': [
'debug_trybot', 'x64'],
'debug_x64_reverse_jsargs': [
'debug_bot', 'x64', 'reverse_jsargs'],
'debug_bot', 'x64'],
'debug_x64_trybot_custom': [
'debug_trybot', 'x64', 'v8_snapshot_custom'],
'full_debug_x64': [
......@@ -758,10 +758,6 @@
'mixins': ['release_bot', 'minimal_symbols', 'dcheck_always_on'],
},
'reverse_jsargs': {
'gn_args': 'v8_enable_reverse_jsargs=true',
},
'official': {
'gn_args': 'is_official_build=true',
},
......
This diff is collapsed.
This diff is collapsed.
......@@ -206,7 +206,6 @@ MaybeHandle<Object> Builtins::InvokeApiFunction(Isolate* isolate,
} else {
argv = new Address[frame_argc];
}
#ifdef V8_REVERSE_JSARGS
argv[BuiltinArguments::kNewTargetOffset] = new_target->ptr();
argv[BuiltinArguments::kTargetOffset] = function->ptr();
argv[BuiltinArguments::kArgcOffset] = Smi::FromInt(frame_argc).ptr();
......@@ -217,19 +216,6 @@ MaybeHandle<Object> Builtins::InvokeApiFunction(Isolate* isolate,
for (int i = 0; i < argc; ++i) {
argv[cursor++] = args[i]->ptr();
}
#else
int cursor = frame_argc - 1;
argv[cursor--] = receiver->ptr();
for (int i = 0; i < argc; ++i) {
argv[cursor--] = args[i]->ptr();
}
DCHECK_EQ(cursor, BuiltinArguments::kPaddingOffset);
argv[BuiltinArguments::kPaddingOffset] =
ReadOnlyRoots(isolate).the_hole_value().ptr();
argv[BuiltinArguments::kArgcOffset] = Smi::FromInt(frame_argc).ptr();
argv[BuiltinArguments::kTargetOffset] = function->ptr();
argv[BuiltinArguments::kNewTargetOffset] = new_target->ptr();
#endif
MaybeHandle<Object> result;
{
RelocatableArguments arguments(isolate, frame_argc, &argv[frame_argc - 1]);
......
......@@ -23,20 +23,12 @@ Handle<Object> BuiltinArguments::atOrUndefined(Isolate* isolate,
Handle<Object> BuiltinArguments::receiver() const { return at<Object>(0); }
Handle<JSFunction> BuiltinArguments::target() const {
#ifdef V8_REVERSE_JSARGS
int index = kTargetOffset;
#else
int index = Arguments::length() - 1 - kTargetOffset;
#endif
return Handle<JSFunction>(address_of_arg_at(index));
}
Handle<HeapObject> BuiltinArguments::new_target() const {
#ifdef V8_REVERSE_JSARGS
int index = kNewTargetOffset;
#else
int index = Arguments::length() - 1 - kNewTargetOffset;
#endif
return Handle<JSFunction>(address_of_arg_at(index));
}
......
......@@ -52,12 +52,7 @@ class BuiltinArguments : public JavaScriptArguments {
static constexpr int kNumExtraArgs = 4;
static constexpr int kNumExtraArgsWithReceiver = 5;
#ifdef V8_REVERSE_JSARGS
static constexpr int kArgsOffset = 4;
#else
static constexpr int kArgsOffset = 0;
#endif
inline Handle<Object> atOrUndefined(Isolate* isolate, int index) const;
inline Handle<Object> receiver() const;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -731,11 +731,7 @@ class V8_EXPORT_PRIVATE MacroAssembler : public TurboAssembler {
// TODO(victorgomes): Remove this function once we stick with the reversed
// arguments order.
MemOperand ReceiverOperand(Register argc) {
#ifdef V8_REVERSE_JSARGS
return MemOperand(sp, 0);
#else
return MemOperand(sp, argc, LSL, kSystemPointerSizeLog2);
#endif
}
// ---------------------------------------------------------------------------
......
......@@ -2186,11 +2186,7 @@ void MacroAssembler::InvokeFunctionCode(Register function, Register new_target,
}
Operand MacroAssembler::ReceiverOperand(Register arg_count) {
#ifdef V8_REVERSE_JSARGS
return Operand(0);
#else
return Operand(arg_count, LSL, kXRegSizeLog2);
#endif
}
void MacroAssembler::InvokeFunctionWithNewTarget(
......
......@@ -1781,8 +1781,6 @@ class V8_EXPORT_PRIVATE MacroAssembler : public TurboAssembler {
DecodeField<Field>(reg, reg);
}
// TODO(victorgomes): inline this function once we remove V8_REVERSE_JSARGS
// flag.
Operand ReceiverOperand(const Register arg_count);
// ---- SMI and Number Utilities ----
......
This diff is collapsed.
......@@ -33,16 +33,9 @@ namespace internal {
Operand StackArgumentsAccessor::GetArgumentOperand(int index) const {
DCHECK_GE(index, 0);
#ifdef V8_REVERSE_JSARGS
// arg[0] = esp + kPCOnStackSize;
// arg[i] = arg[0] + i * kSystemPointerSize;
return Operand(esp, kPCOnStackSize + index * kSystemPointerSize);
#else
// arg[0] = (esp + kPCOnStackSize) + argc * kSystemPointerSize;
// arg[i] = arg[0] - i * kSystemPointerSize;
return Operand(esp, argc_, times_system_pointer_size,
kPCOnStackSize - index * kSystemPointerSize);
#endif
}
// -------------------------------------------------------------------------
......@@ -1158,13 +1151,7 @@ void MacroAssembler::CallDebugOnFunctionCall(Register fun, Register new_target,
Push(fun);
Push(fun);
// Arguments are located 2 words below the base pointer.
#ifdef V8_REVERSE_JSARGS
Operand receiver_op = Operand(ebp, kSystemPointerSize * 2);
#else
Operand receiver_op =
Operand(ebp, actual_parameter_count, times_system_pointer_size,
kSystemPointerSize * 2);
#endif
Push(receiver_op);
CallRuntime(Runtime::kDebugOnFunctionCall);
Pop(fun);
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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