Reviewers: Weiliang, mvstanton,
Description:
X87: Added CallInterfaceDescriptors to all code stubs.
port r23854.
original commit message:
Added CallInterfaceDescriptors to all code stubs. A handful
of code stubs are too complex to be described this way, and
they are encoded with the macro
DEFINE_NULL_CALL_INTERFACE_DESCRIPTOR().
Along the way:
* allowed inheritance of CallInterfaceDescriptors.
* Defined static Register methods for some of the new
CallInterfaceDescriptors. We could go a lot further here, but
it doesn't have to be done immediately.
* Added Representation arrays to some CallInterfaceDescriptors,
especially where future hydrogen versions of the stubs could
benefit from this knowledge.
BUG=
Please review this at https://codereview.chromium.org/566843004/
SVN Base: https://github.com/v8/v8.git@bleeding_edge
Affected files (+38, -23 lines):
M src/ic/x87/handler-compiler-x87.cc
M src/x87/code-stubs-x87.h
M src/x87/code-stubs-x87.cc
M src/x87/interface-descriptors-x87.cc
Index: src/ic/x87/handler-compiler-x87.cc
diff --git a/src/ic/x87/handler-compiler-x87.cc
b/src/ic/x87/handler-compiler-x87.cc
index
ce5657b35d27dc25d70d1927b71d25ec99c0451d..c40da817ed33e7338aee8b5b7480cc1ba0ca3910
100644
--- a/src/ic/x87/handler-compiler-x87.cc
+++ b/src/ic/x87/handler-compiler-x87.cc
@@ -667,7 +667,7 @@ void NamedLoadHandlerCompiler::GenerateLoadCallback(
__ push(scratch3()); // Restore return address.
// Abi for CallApiGetter
- Register getter_address = edx;
+ Register getter_address = ApiGetterDescriptor::function_address();
Address function_address = v8::ToCData<Address>(callback->getter());
__ mov(getter_address, Immediate(function_address));
Index: src/x87/code-stubs-x87.cc
diff --git a/src/x87/code-stubs-x87.cc b/src/x87/code-stubs-x87.cc
index
fe14b8a90f2985f84f15ce8df4630e1f780ba866..cc3d6ce0a7a3c9718d21f5a6f5f62785c923fa04
100644
--- a/src/x87/code-stubs-x87.cc
+++ b/src/x87/code-stubs-x87.cc
@@ -332,6 +332,8 @@ void FunctionPrototypeStub::Generate(MacroAssembler*
masm) {
void ArgumentsAccessStub::GenerateReadElement(MacroAssembler* masm) {
// The key is in edx and the parameter count is in eax.
+ DCHECK(edx.is(ArgumentsAccessReadDescriptor::index()));
+ DCHECK(eax.is(ArgumentsAccessReadDescriptor::parameter_count()));
// The displacement is used for skipping the frame pointer on the
// stack. It is the offset of the last parameter (if any) relative
@@ -4283,6 +4285,7 @@ void CallApiGetterStub::Generate(MacroAssembler*
masm) {
// -- ...
// -- edx : api_function_address
// -----------------------------------
+ DCHECK(edx.is(ApiGetterDescriptor::function_address()));
// array for v8::Arguments::values_, handler for name and pointer
// to the values (it considered as smi in GC).
Index: src/x87/code-stubs-x87.h
diff --git a/src/x87/code-stubs-x87.h b/src/x87/code-stubs-x87.h
index
b8fef1fb39c579e09a8878c395a369a033b1cec7..49462bc5c4622a29b5552345ba4ed301517aab3c
100644
--- a/src/x87/code-stubs-x87.h
+++ b/src/x87/code-stubs-x87.h
@@ -109,6 +109,7 @@ class NameDictionaryLookupStub: public PlatformCodeStub
{
class IndexBits: public BitField<int, 6, 3> {};
class LookupModeBits: public BitField<LookupMode, 9, 1> {};
+ DEFINE_NULL_CALL_INTERFACE_DESCRIPTOR();
DEFINE_PLATFORM_CODE_STUB(NameDictionaryLookup, PlatformCodeStub);
};
@@ -188,6 +189,8 @@ class RecordWriteStub: public PlatformCodeStub {
CpuFeatures::FlushICache(stub->instruction_start(), 7);
}
+ DEFINE_NULL_CALL_INTERFACE_DESCRIPTOR();
+
private:
// This is a helper class for freeing up 3 scratch registers, where the
third
// is always ecx (needed for shift operations). The input is two
registers
Index: src/x87/interface-descriptors-x87.cc
diff --git a/src/x87/interface-descriptors-x87.cc
b/src/x87/interface-descriptors-x87.cc
index
86207513f45a3d2fd3b1ce385381f4664093b584..8dfad3633cb6493844d847d404d761424718189a
100644
--- a/src/x87/interface-descriptors-x87.cc
+++ b/src/x87/interface-descriptors-x87.cc
@@ -18,17 +18,9 @@ const Register LoadDescriptor::ReceiverRegister() {
return edx; }
const Register LoadDescriptor::NameRegister() { return ecx; }
-const Register VectorLoadICDescriptor::ReceiverRegister() {
- return LoadDescriptor::ReceiverRegister();
-}
-
-
-const Register VectorLoadICDescriptor::NameRegister() {
- return LoadDescriptor::NameRegister();
-}
+const Register VectorLoadICTrampolineDescriptor::SlotRegister() { return
eax; }
-const Register VectorLoadICDescriptor::SlotRegister() { return eax; }
const Register VectorLoadICDescriptor::VectorRegister() { return ebx; }
@@ -37,28 +29,28 @@ const Register StoreDescriptor::NameRegister() { return
ecx; }
const Register StoreDescriptor::ValueRegister() { return eax; }
-const Register ElementTransitionAndStoreDescriptor::ReceiverRegister() {
- return StoreDescriptor::ReceiverRegister();
+const Register ElementTransitionAndStoreDescriptor::MapRegister() {
+ return ebx;
}
-const Register ElementTransitionAndStoreDescriptor::NameRegister() {
- return StoreDescriptor::NameRegister();
-}
+const Register InstanceofDescriptor::left() { return eax; }
+const Register InstanceofDescriptor::right() { return edx; }
-const Register ElementTransitionAndStoreDescriptor::ValueRegister() {
- return StoreDescriptor::ValueRegister();
-}
+const Register ArgumentsAccessReadDescriptor::index() { return edx; }
+const Register ArgumentsAccessReadDescriptor::parameter_count() { return
eax; }
-const Register ElementTransitionAndStoreDescriptor::MapRegister() {
- return ebx;
-}
+const Register ApiGetterDescriptor::function_address() { return edx; }
-const Register InstanceofDescriptor::left() { return eax; }
-const Register InstanceofDescriptor::right() { return edx; }
+const Register MathPowTaggedDescriptor::exponent() { return eax; }
+
+
+const Register MathPowIntegerDescriptor::exponent() {
+ return MathPowTaggedDescriptor::exponent();
+}
void FastNewClosureDescriptor::Initialize(CallInterfaceDescriptorData*
data) {
@@ -110,12 +102,29 @@ void CreateAllocationSiteDescriptor::Initialize(
}
+void StoreArrayLiteralElementDescriptor::Initialize(
+ CallInterfaceDescriptorData* data) {
+ Register registers[] = {esi, ecx, eax};
+ data->Initialize(arraysize(registers), registers, NULL);
+}
+
+
void CallFunctionDescriptor::Initialize(CallInterfaceDescriptorData* data)
{
Register registers[] = {esi, edi};
data->Initialize(arraysize(registers), registers, NULL);
}
+void CallFunctionWithFeedbackDescriptor::Initialize(
+ CallInterfaceDescriptorData* data) {
+ Register registers[] = {esi, edi, edx};
+ Representation representations[] = {Representation::Tagged(),
+ Representation::Tagged(),
+ Representation::Smi()};
+ data->Initialize(arraysize(registers), registers, representations);
+}
+
+
void CallConstructDescriptor::Initialize(CallInterfaceDescriptorData*
data) {
// eax : number of arguments
// ebx : feedback vector
--
--
v8-dev mailing list
v8-dev@googlegroups.com
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to v8-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.