Commit bc8c97c7 authored by Toon Verwaest's avatar Toon Verwaest Committed by Commit Bot

[api] Remove deprecated FunctionCallbackInfo::Callee

This especially simplifies arm64 CallApiCallbackStub alignemnt handling.

Bug: 
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: I26e9c075702161a3f1c70f94ec83d149d2d8f33a
Reviewed-on: https://chromium-review.googlesource.com/741600Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49004}
parent 0f21d0b0
......@@ -3709,8 +3709,6 @@ class FunctionCallbackInfo {
V8_INLINE int Length() const;
/** Accessor for the available arguments. */
V8_INLINE Local<Value> operator[](int i) const;
V8_INLINE V8_DEPRECATED("Use Data() to explicitly pass Callee instead",
Local<Function> Callee() const);
/** Returns the receiver. This corresponds to the "this" value. */
V8_INLINE Local<Object> This() const;
/**
......@@ -3735,7 +3733,7 @@ class FunctionCallbackInfo {
/** The ReturnValue for the call. */
V8_INLINE ReturnValue<T> GetReturnValue() const;
// This shouldn't be public, but the arm compiler needs it.
static const int kArgsLength = 7;
static const int kArgsLength = 6;
protected:
friend class internal::FunctionCallbackArguments;
......@@ -3746,8 +3744,7 @@ class FunctionCallbackInfo {
static const int kReturnValueDefaultValueIndex = 2;
static const int kReturnValueIndex = 3;
static const int kDataIndex = 4;
static const int kCalleeIndex = 5;
static const int kNewTargetIndex = 6;
static const int kNewTargetIndex = 5;
V8_INLINE FunctionCallbackInfo(internal::Object** implicit_args,
internal::Object** values, int length);
......@@ -9576,13 +9573,6 @@ Local<Value> FunctionCallbackInfo<T>::operator[](int i) const {
}
template<typename T>
Local<Function> FunctionCallbackInfo<T>::Callee() const {
return Local<Function>(reinterpret_cast<Function*>(
&implicit_args_[kCalleeIndex]));
}
template<typename T>
Local<Object> FunctionCallbackInfo<T>::This() const {
return Local<Object>(reinterpret_cast<Object*>(values_ + 1));
......
......@@ -158,7 +158,6 @@ class FunctionCallbackArguments
static const int kReturnValueDefaultValueIndex =
T::kReturnValueDefaultValueIndex;
static const int kIsolateIndex = T::kIsolateIndex;
static const int kCalleeIndex = T::kCalleeIndex;
static const int kNewTargetIndex = T::kNewTargetIndex;
FunctionCallbackArguments(internal::Isolate* isolate, internal::Object* data,
......@@ -169,7 +168,6 @@ class FunctionCallbackArguments
: Super(isolate), argv_(argv), argc_(argc) {
Object** values = begin();
values[T::kDataIndex] = data;
values[T::kCalleeIndex] = callee;
values[T::kHolderIndex] = holder;
values[T::kNewTargetIndex] = new_target;
values[T::kIsolateIndex] = reinterpret_cast<internal::Object*>(isolate);
......@@ -178,8 +176,6 @@ class FunctionCallbackArguments
values[T::kReturnValueDefaultValueIndex] =
isolate->heap()->the_hole_value();
values[T::kReturnValueIndex] = isolate->heap()->the_hole_value();
DCHECK(values[T::kCalleeIndex]->IsJSFunction() ||
values[T::kCalleeIndex]->IsFunctionTemplateInfo());
DCHECK(values[T::kHolderIndex]->IsHeapObject());
DCHECK(values[T::kIsolateIndex]->IsSmi());
}
......
......@@ -1487,9 +1487,8 @@ void CallApiCallbackStub::Generate(MacroAssembler* masm) {
typedef FunctionCallbackArguments FCA;
STATIC_ASSERT(FCA::kArgsLength == 7);
STATIC_ASSERT(FCA::kNewTargetIndex == 6);
STATIC_ASSERT(FCA::kCalleeIndex == 5);
STATIC_ASSERT(FCA::kArgsLength == 6);
STATIC_ASSERT(FCA::kNewTargetIndex == 5);
STATIC_ASSERT(FCA::kDataIndex == 4);
STATIC_ASSERT(FCA::kReturnValueOffset == 3);
STATIC_ASSERT(FCA::kReturnValueDefaultValueIndex == 2);
......@@ -1499,9 +1498,6 @@ void CallApiCallbackStub::Generate(MacroAssembler* masm) {
// new target
__ PushRoot(Heap::kUndefinedValueRootIndex);
// callee
__ push(callee);
// call data
__ push(call_data);
......
......@@ -1710,9 +1710,8 @@ void CallApiCallbackStub::Generate(MacroAssembler* masm) {
typedef FunctionCallbackArguments FCA;
STATIC_ASSERT(FCA::kArgsLength == 7);
STATIC_ASSERT(FCA::kNewTargetIndex == 6);
STATIC_ASSERT(FCA::kCalleeIndex == 5);
STATIC_ASSERT(FCA::kArgsLength == 6);
STATIC_ASSERT(FCA::kNewTargetIndex == 5);
STATIC_ASSERT(FCA::kDataIndex == 4);
STATIC_ASSERT(FCA::kReturnValueOffset == 3);
STATIC_ASSERT(FCA::kReturnValueDefaultValueIndex == 2);
......@@ -1722,8 +1721,8 @@ void CallApiCallbackStub::Generate(MacroAssembler* masm) {
Register undef = x7;
__ LoadRoot(undef, Heap::kUndefinedValueRootIndex);
// Push alignment filler, new target, callee and call data.
__ Push(undef, undef, callee, call_data);
// Push new target, call data.
__ Push(undef, call_data);
Register isolate_reg = x5;
__ Mov(isolate_reg, ExternalReference::isolate_address(masm->isolate()));
......@@ -1758,9 +1757,7 @@ void CallApiCallbackStub::Generate(MacroAssembler* masm) {
// Arguments is after the return address.
__ SlotAddress(x0, 1);
// FunctionCallbackInfo::implicit_args_ and FunctionCallbackInfo::values_
// + 1 to account for the alignment filler.
__ Add(x10, args,
Operand((FCA::kArgsLength - 1 + argc() + 1) * kPointerSize));
__ Add(x10, args, Operand((FCA::kArgsLength - 1 + argc()) * kPointerSize));
__ Stp(args, x10, MemOperand(x0, 0 * kPointerSize));
// FunctionCallbackInfo::length_ = argc
__ Mov(x10, argc());
......@@ -1780,10 +1777,10 @@ void CallApiCallbackStub::Generate(MacroAssembler* masm) {
MemOperand return_value_operand(fp, return_value_offset * kPointerSize);
// The number of arguments might be odd, but will be padded when calling the
// stub. We do not round up stack_space to account for odd argc here, this
// will be done in CallApiFunctionAndReturn. The current frame needs to be
// aligned here, which is why we push a filler before FCA.
const int stack_space = (argc() + 1) + FCA::kArgsLength + 1;
// will be done in CallApiFunctionAndReturn.
const int stack_space = (argc() + 1) + FCA::kArgsLength;
// The current frame needs to be aligned.
DCHECK_EQ((stack_space - (argc() + 1)) % 2, 0);
const int spill_offset = 1 + kApiStackSpace;
CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, stack_space,
......
......@@ -1442,9 +1442,8 @@ void CallApiCallbackStub::Generate(MacroAssembler* masm) {
typedef FunctionCallbackArguments FCA;
STATIC_ASSERT(FCA::kArgsLength == 7);
STATIC_ASSERT(FCA::kNewTargetIndex == 6);
STATIC_ASSERT(FCA::kCalleeIndex == 5);
STATIC_ASSERT(FCA::kArgsLength == 6);
STATIC_ASSERT(FCA::kNewTargetIndex == 5);
STATIC_ASSERT(FCA::kDataIndex == 4);
STATIC_ASSERT(FCA::kReturnValueOffset == 3);
STATIC_ASSERT(FCA::kReturnValueDefaultValueIndex == 2);
......@@ -1456,9 +1455,6 @@ void CallApiCallbackStub::Generate(MacroAssembler* masm) {
// new target
__ PushRoot(Heap::kUndefinedValueRootIndex);
// callee
__ push(callee);
// call data
__ push(call_data);
......
......@@ -1593,9 +1593,8 @@ void CallApiCallbackStub::Generate(MacroAssembler* masm) {
typedef FunctionCallbackArguments FCA;
STATIC_ASSERT(FCA::kArgsLength == 7);
STATIC_ASSERT(FCA::kNewTargetIndex == 6);
STATIC_ASSERT(FCA::kCalleeIndex == 5);
STATIC_ASSERT(FCA::kArgsLength == 6);
STATIC_ASSERT(FCA::kNewTargetIndex == 5);
STATIC_ASSERT(FCA::kDataIndex == 4);
STATIC_ASSERT(FCA::kReturnValueOffset == 3);
STATIC_ASSERT(FCA::kReturnValueDefaultValueIndex == 2);
......@@ -1605,8 +1604,8 @@ void CallApiCallbackStub::Generate(MacroAssembler* masm) {
// new target
__ PushRoot(Heap::kUndefinedValueRootIndex);
// callee and call data.
__ Push(callee, call_data);
// call data.
__ Push(call_data);
Register scratch = call_data;
__ LoadRoot(scratch, Heap::kUndefinedValueRootIndex);
......
......@@ -1595,9 +1595,8 @@ void CallApiCallbackStub::Generate(MacroAssembler* masm) {
typedef FunctionCallbackArguments FCA;
STATIC_ASSERT(FCA::kArgsLength == 7);
STATIC_ASSERT(FCA::kNewTargetIndex == 6);
STATIC_ASSERT(FCA::kCalleeIndex == 5);
STATIC_ASSERT(FCA::kArgsLength == 6);
STATIC_ASSERT(FCA::kNewTargetIndex == 5);
STATIC_ASSERT(FCA::kDataIndex == 4);
STATIC_ASSERT(FCA::kReturnValueOffset == 3);
STATIC_ASSERT(FCA::kReturnValueDefaultValueIndex == 2);
......@@ -1607,8 +1606,8 @@ void CallApiCallbackStub::Generate(MacroAssembler* masm) {
// new target
__ PushRoot(Heap::kUndefinedValueRootIndex);
// callee and call data.
__ Push(callee, call_data);
// call data.
__ Push(call_data);
Register scratch = call_data;
__ LoadRoot(scratch, Heap::kUndefinedValueRootIndex);
......
......@@ -1596,9 +1596,8 @@ void CallApiCallbackStub::Generate(MacroAssembler* masm) {
typedef FunctionCallbackArguments FCA;
STATIC_ASSERT(FCA::kArgsLength == 7);
STATIC_ASSERT(FCA::kNewTargetIndex == 6);
STATIC_ASSERT(FCA::kCalleeIndex == 5);
STATIC_ASSERT(FCA::kArgsLength == 6);
STATIC_ASSERT(FCA::kNewTargetIndex == 5);
STATIC_ASSERT(FCA::kDataIndex == 4);
STATIC_ASSERT(FCA::kReturnValueOffset == 3);
STATIC_ASSERT(FCA::kReturnValueDefaultValueIndex == 2);
......@@ -1608,9 +1607,6 @@ void CallApiCallbackStub::Generate(MacroAssembler* masm) {
// new target
__ PushRoot(Heap::kUndefinedValueRootIndex);
// callee
__ push(callee);
// call data
__ push(call_data);
......
......@@ -1597,9 +1597,8 @@ void CallApiCallbackStub::Generate(MacroAssembler* masm) {
typedef FunctionCallbackArguments FCA;
STATIC_ASSERT(FCA::kArgsLength == 7);
STATIC_ASSERT(FCA::kNewTargetIndex == 6);
STATIC_ASSERT(FCA::kCalleeIndex == 5);
STATIC_ASSERT(FCA::kArgsLength == 6);
STATIC_ASSERT(FCA::kNewTargetIndex == 5);
STATIC_ASSERT(FCA::kDataIndex == 4);
STATIC_ASSERT(FCA::kReturnValueOffset == 3);
STATIC_ASSERT(FCA::kReturnValueDefaultValueIndex == 2);
......@@ -1609,9 +1608,6 @@ void CallApiCallbackStub::Generate(MacroAssembler* masm) {
// new target
__ PushRoot(Heap::kUndefinedValueRootIndex);
// callee
__ push(callee);
// call data
__ push(call_data);
......
......@@ -1489,9 +1489,8 @@ void CallApiCallbackStub::Generate(MacroAssembler* masm) {
typedef FunctionCallbackArguments FCA;
STATIC_ASSERT(FCA::kArgsLength == 7);
STATIC_ASSERT(FCA::kNewTargetIndex == 6);
STATIC_ASSERT(FCA::kCalleeIndex == 5);
STATIC_ASSERT(FCA::kArgsLength == 6);
STATIC_ASSERT(FCA::kNewTargetIndex == 5);
STATIC_ASSERT(FCA::kDataIndex == 4);
STATIC_ASSERT(FCA::kReturnValueOffset == 3);
STATIC_ASSERT(FCA::kReturnValueDefaultValueIndex == 2);
......@@ -1503,9 +1502,6 @@ void CallApiCallbackStub::Generate(MacroAssembler* masm) {
// new target
__ PushRoot(Heap::kUndefinedValueRootIndex);
// callee
__ Push(callee);
// call data
__ Push(call_data);
......
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