From de2c668db88bb70df41db6f07b6d50a447ff8585 Mon Sep 17 00:00:00 2001 From: "balazs.kilvady@imgtec.com" Date: Fri, 29 Aug 2014 15:25:41 +0000 Subject: [PATCH] MIPS: Refactoring InterfaceDescriptors away from code-stubs.h - internal. Port r23515 (fe0bdbf) Original commit message: Clean up and create seperation between the concept of a call descriptor and a code stub interface descriptor. The former is just concerned with how to call, but the latter has many extra hints related to code generation and deoptimization for the implementation of a particular code stub. BUG= R=paul.lind@imgtec.com Review URL: https://codereview.chromium.org/516263002 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@23524 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/mips/code-stubs-mips.cc | 77 ------------------------- src/mips/interface-descriptors-mips.cc | 92 ++++++++++++++++++++++++++++++ src/mips64/code-stubs-mips64.cc | 77 ------------------------- src/mips64/interface-descriptors-mips64.cc | 92 ++++++++++++++++++++++++++++++ 4 files changed, 184 insertions(+), 154 deletions(-) create mode 100644 src/mips/interface-descriptors-mips.cc create mode 100644 src/mips64/interface-descriptors-mips64.cc diff --git a/src/mips/code-stubs-mips.cc b/src/mips/code-stubs-mips.cc index fe4f7d6..9c0abe8 100644 --- a/src/mips/code-stubs-mips.cc +++ b/src/mips/code-stubs-mips.cc @@ -123,9 +123,6 @@ void CompareNilICStub::InitializeInterfaceDescriptor( } -const Register InterfaceDescriptor::ContextRegister() { return cp; } - - static void InitializeArrayConstructorDescriptor( CodeStub::Major major, CodeStubInterfaceDescriptor* descriptor, int constant_stack_parameter_count) { @@ -260,80 +257,6 @@ void StringAddStub::InitializeInterfaceDescriptor( } -void CallDescriptors::InitializeForIsolate(Isolate* isolate) { - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(Isolate::ArgumentAdaptorCall); - Register registers[] = { cp, // context, - a1, // JSFunction - a0, // actual number of arguments - a2, // expected number of arguments - }; - Representation representations[] = { - Representation::Tagged(), // context - Representation::Tagged(), // JSFunction - Representation::Integer32(), // actual number of arguments - Representation::Integer32(), // expected number of arguments - }; - descriptor->Initialize(arraysize(registers), registers, representations); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(Isolate::KeyedCall); - Register registers[] = { cp, // context - a2, // key - }; - Representation representations[] = { - Representation::Tagged(), // context - Representation::Tagged(), // key - }; - descriptor->Initialize(arraysize(registers), registers, representations); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(Isolate::NamedCall); - Register registers[] = { cp, // context - a2, // name - }; - Representation representations[] = { - Representation::Tagged(), // context - Representation::Tagged(), // name - }; - descriptor->Initialize(arraysize(registers), registers, representations); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(Isolate::CallHandler); - Register registers[] = { cp, // context - a0, // receiver - }; - Representation representations[] = { - Representation::Tagged(), // context - Representation::Tagged(), // receiver - }; - descriptor->Initialize(arraysize(registers), registers, representations); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(Isolate::ApiFunctionCall); - Register registers[] = { cp, // context - a0, // callee - t0, // call_data - a2, // holder - a1, // api_function_address - }; - Representation representations[] = { - Representation::Tagged(), // context - Representation::Tagged(), // callee - Representation::Tagged(), // call_data - Representation::Tagged(), // holder - Representation::External(), // api_function_address - }; - descriptor->Initialize(arraysize(registers), registers, representations); - } -} - - #define __ ACCESS_MASM(masm) diff --git a/src/mips/interface-descriptors-mips.cc b/src/mips/interface-descriptors-mips.cc new file mode 100644 index 0000000..3bbc583 --- /dev/null +++ b/src/mips/interface-descriptors-mips.cc @@ -0,0 +1,92 @@ +// Copyright 2012 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "src/v8.h" + +#if V8_TARGET_ARCH_MIPS + +#include "src/interface-descriptors.h" + +namespace v8 { +namespace internal { + +const Register InterfaceDescriptor::ContextRegister() { return cp; } + + +void CallDescriptors::InitializeForIsolate(Isolate* isolate) { + { + CallInterfaceDescriptor* descriptor = + isolate->call_descriptor(CallDescriptorKey::ArgumentAdaptorCall); + Register registers[] = { cp, // context, + a1, // JSFunction + a0, // actual number of arguments + a2, // expected number of arguments + }; + Representation representations[] = { + Representation::Tagged(), // context + Representation::Tagged(), // JSFunction + Representation::Integer32(), // actual number of arguments + Representation::Integer32(), // expected number of arguments + }; + descriptor->Initialize(arraysize(registers), registers, representations); + } + { + CallInterfaceDescriptor* descriptor = + isolate->call_descriptor(CallDescriptorKey::KeyedCall); + Register registers[] = { cp, // context + a2, // key + }; + Representation representations[] = { + Representation::Tagged(), // context + Representation::Tagged(), // key + }; + descriptor->Initialize(arraysize(registers), registers, representations); + } + { + CallInterfaceDescriptor* descriptor = + isolate->call_descriptor(CallDescriptorKey::NamedCall); + Register registers[] = { cp, // context + a2, // name + }; + Representation representations[] = { + Representation::Tagged(), // context + Representation::Tagged(), // name + }; + descriptor->Initialize(arraysize(registers), registers, representations); + } + { + CallInterfaceDescriptor* descriptor = + isolate->call_descriptor(CallDescriptorKey::CallHandler); + Register registers[] = { cp, // context + a0, // receiver + }; + Representation representations[] = { + Representation::Tagged(), // context + Representation::Tagged(), // receiver + }; + descriptor->Initialize(arraysize(registers), registers, representations); + } + { + CallInterfaceDescriptor* descriptor = + isolate->call_descriptor(CallDescriptorKey::ApiFunctionCall); + Register registers[] = { cp, // context + a0, // callee + t0, // call_data + a2, // holder + a1, // api_function_address + }; + Representation representations[] = { + Representation::Tagged(), // context + Representation::Tagged(), // callee + Representation::Tagged(), // call_data + Representation::Tagged(), // holder + Representation::External(), // api_function_address + }; + descriptor->Initialize(arraysize(registers), registers, representations); + } +} +} +} // namespace v8::internal + +#endif // V8_TARGET_ARCH_MIPS diff --git a/src/mips64/code-stubs-mips64.cc b/src/mips64/code-stubs-mips64.cc index 3d01961..e2b8f92 100644 --- a/src/mips64/code-stubs-mips64.cc +++ b/src/mips64/code-stubs-mips64.cc @@ -123,9 +123,6 @@ void CompareNilICStub::InitializeInterfaceDescriptor( } -const Register InterfaceDescriptor::ContextRegister() { return cp; } - - static void InitializeArrayConstructorDescriptor( CodeStub::Major major, CodeStubInterfaceDescriptor* descriptor, int constant_stack_parameter_count) { @@ -260,80 +257,6 @@ void StringAddStub::InitializeInterfaceDescriptor( } -void CallDescriptors::InitializeForIsolate(Isolate* isolate) { - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(Isolate::ArgumentAdaptorCall); - Register registers[] = { cp, // context - a1, // JSFunction - a0, // actual number of arguments - a2, // expected number of arguments - }; - Representation representations[] = { - Representation::Tagged(), // context - Representation::Tagged(), // JSFunction - Representation::Integer32(), // actual number of arguments - Representation::Integer32(), // expected number of arguments - }; - descriptor->Initialize(arraysize(registers), registers, representations); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(Isolate::KeyedCall); - Register registers[] = { cp, // context - a2, // key - }; - Representation representations[] = { - Representation::Tagged(), // context - Representation::Tagged(), // key - }; - descriptor->Initialize(arraysize(registers), registers, representations); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(Isolate::NamedCall); - Register registers[] = { cp, // context - a2, // name - }; - Representation representations[] = { - Representation::Tagged(), // context - Representation::Tagged(), // name - }; - descriptor->Initialize(arraysize(registers), registers, representations); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(Isolate::CallHandler); - Register registers[] = { cp, // context - a0, // receiver - }; - Representation representations[] = { - Representation::Tagged(), // context - Representation::Tagged(), // receiver - }; - descriptor->Initialize(arraysize(registers), registers, representations); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(Isolate::ApiFunctionCall); - Register registers[] = { cp, // context - a0, // callee - a4, // call_data - a2, // holder - a1, // api_function_address - }; - Representation representations[] = { - Representation::Tagged(), // context - Representation::Tagged(), // callee - Representation::Tagged(), // call_data - Representation::Tagged(), // holder - Representation::External(), // api_function_address - }; - descriptor->Initialize(arraysize(registers), registers, representations); - } -} - - #define __ ACCESS_MASM(masm) diff --git a/src/mips64/interface-descriptors-mips64.cc b/src/mips64/interface-descriptors-mips64.cc new file mode 100644 index 0000000..ee4cfb8 --- /dev/null +++ b/src/mips64/interface-descriptors-mips64.cc @@ -0,0 +1,92 @@ +// Copyright 2012 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "src/v8.h" + +#if V8_TARGET_ARCH_MIPS64 + +#include "src/interface-descriptors.h" + +namespace v8 { +namespace internal { + +const Register InterfaceDescriptor::ContextRegister() { return cp; } + + +void CallDescriptors::InitializeForIsolate(Isolate* isolate) { + { + CallInterfaceDescriptor* descriptor = + isolate->call_descriptor(CallDescriptorKey::ArgumentAdaptorCall); + Register registers[] = { cp, // context + a1, // JSFunction + a0, // actual number of arguments + a2, // expected number of arguments + }; + Representation representations[] = { + Representation::Tagged(), // context + Representation::Tagged(), // JSFunction + Representation::Integer32(), // actual number of arguments + Representation::Integer32(), // expected number of arguments + }; + descriptor->Initialize(arraysize(registers), registers, representations); + } + { + CallInterfaceDescriptor* descriptor = + isolate->call_descriptor(CallDescriptorKey::KeyedCall); + Register registers[] = { cp, // context + a2, // key + }; + Representation representations[] = { + Representation::Tagged(), // context + Representation::Tagged(), // key + }; + descriptor->Initialize(arraysize(registers), registers, representations); + } + { + CallInterfaceDescriptor* descriptor = + isolate->call_descriptor(CallDescriptorKey::NamedCall); + Register registers[] = { cp, // context + a2, // name + }; + Representation representations[] = { + Representation::Tagged(), // context + Representation::Tagged(), // name + }; + descriptor->Initialize(arraysize(registers), registers, representations); + } + { + CallInterfaceDescriptor* descriptor = + isolate->call_descriptor(CallDescriptorKey::CallHandler); + Register registers[] = { cp, // context + a0, // receiver + }; + Representation representations[] = { + Representation::Tagged(), // context + Representation::Tagged(), // receiver + }; + descriptor->Initialize(arraysize(registers), registers, representations); + } + { + CallInterfaceDescriptor* descriptor = + isolate->call_descriptor(CallDescriptorKey::ApiFunctionCall); + Register registers[] = { cp, // context + a0, // callee + a4, // call_data + a2, // holder + a1, // api_function_address + }; + Representation representations[] = { + Representation::Tagged(), // context + Representation::Tagged(), // callee + Representation::Tagged(), // call_data + Representation::Tagged(), // holder + Representation::External(), // api_function_address + }; + descriptor->Initialize(arraysize(registers), registers, representations); + } +} +} +} // namespace v8::internal + +#endif // V8_TARGET_ARCH_MIPS64 -- 2.7.4