Revision: 14307
Author: [email protected]
Date: Wed Apr 17 06:51:08 2013
Log: Revert "Accurate function prototypes for native calls from ARM
simulator."
This reverts commit https://code.google.com/p/v8/source/detail?r=14230
The reason for revert is Win64 mksnapshot failure.
Conflicts:
src/arm/simulator-arm.cc
BUG=
Review URL: https://codereview.chromium.org/14096025
http://code.google.com/p/v8/source/detail?r=14307
Deleted:
/branches/bleeding_edge/src/builtins-decls.h
Modified:
/branches/bleeding_edge/src/arguments.h
/branches/bleeding_edge/src/arm/code-stubs-arm.cc
/branches/bleeding_edge/src/arm/simulator-arm.cc
/branches/bleeding_edge/src/arm/simulator-arm.h
/branches/bleeding_edge/src/atomicops_internals_x86_gcc.h
/branches/bleeding_edge/src/builtins.cc
/branches/bleeding_edge/src/builtins.h
/branches/bleeding_edge/src/ia32/code-stubs-ia32.cc
/branches/bleeding_edge/src/mips/code-stubs-mips.cc
/branches/bleeding_edge/src/x64/code-stubs-x64.cc
=======================================
--- /branches/bleeding_edge/src/builtins-decls.h Thu Apr 11 05:40:37 2013
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright 2013 the V8 project authors. All rights reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following
-// disclaimer in the documentation and/or other materials provided
-// with the distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived
-// from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef V8_BUILTINS_DECLS_H_
-#define V8_BUILTINS_DECLS_H_
-
-#include "arguments.h"
-
-namespace v8 {
-namespace internal {
-
-DECLARE_RUNTIME_FUNCTION(MaybeObject*, ArrayConstructor_StubFailure);
-
-} } // namespace v8::internal
-
-#endif // V8_BUILTINS_DECLS_H_
=======================================
--- /branches/bleeding_edge/src/arguments.h Thu Apr 11 05:40:37 2013
+++ /branches/bleeding_edge/src/arguments.h Wed Apr 17 06:51:08 2013
@@ -115,18 +115,15 @@
#define DECLARE_RUNTIME_FUNCTION(Type, Name) \
-Type Name(int args_length, Object** args_object, Isolate* isolate)
+Type Name(Arguments args, Isolate* isolate)
-#define RUNTIME_FUNCTION(Type, Name) \
-static Type __RT_impl_##Name(Arguments args, Isolate* isolate); \
-Type Name(int args_length, Object** args_object, Isolate* isolate) { \
- Arguments args(args_length, args_object); \
- return __RT_impl_##Name(args, isolate); \
-} \
-static Type __RT_impl_##Name(Arguments args, Isolate* isolate)
+
+#define RUNTIME_FUNCTION(Type, Name) \
+Type Name(Arguments args, Isolate* isolate)
+
+
+#define RUNTIME_ARGUMENTS(isolate, args) args, isolate
-#define RUNTIME_ARGUMENTS(isolate, args) \
- args.length(), args.arguments(), isolate
} } // namespace v8::internal
=======================================
--- /branches/bleeding_edge/src/arm/code-stubs-arm.cc Tue Apr 16 05:16:55
2013
+++ /branches/bleeding_edge/src/arm/code-stubs-arm.cc Wed Apr 17 06:51:08
2013
@@ -30,7 +30,6 @@
#if defined(V8_TARGET_ARCH_ARM)
#include "bootstrapper.h"
-#include "builtins-decls.h"
#include "code-stubs.h"
#include "regexp-macro-assembler.h"
#include "stub-cache.h"
=======================================
--- /branches/bleeding_edge/src/arm/simulator-arm.cc Tue Apr 16 05:30:51
2013
+++ /branches/bleeding_edge/src/arm/simulator-arm.cc Wed Apr 17 06:51:08
2013
@@ -975,14 +975,12 @@
}
-// Runtime FP routines take up to two double arguments and zero
-// or one integer arguments. All are constructed here,
+// For use in calls that take two double values, constructed either
// from r0-r3 or d0 and d1.
-void Simulator::GetFpArgs(double* x, double* y, int32_t* z) {
+void Simulator::GetFpArgs(double* x, double* y) {
if (use_eabi_hardfloat()) {
*x = vfp_registers_[0];
*y = vfp_registers_[1];
- *z = registers_[1];
} else {
// We use a char buffer to get around the strict-aliasing rules which
// otherwise allow the compiler to optimize away the copy.
@@ -993,9 +991,41 @@
// Registers 2 and 3 -> y.
OS::MemCopy(buffer, registers_ + 2, sizeof(*y));
OS::MemCopy(y, buffer, sizeof(*y));
- // Register 2 -> z.
- OS::MemCopy(buffer, registers_ + 2, sizeof(*z));
- OS::MemCopy(z, buffer, sizeof(*z));
+ }
+}
+
+// For use in calls that take one double value, constructed either
+// from r0 and r1 or d0.
+void Simulator::GetFpArgs(double* x) {
+ if (use_eabi_hardfloat()) {
+ *x = vfp_registers_[0];
+ } else {
+ // We use a char buffer to get around the strict-aliasing rules which
+ // otherwise allow the compiler to optimize away the copy.
+ char buffer[sizeof(*x)];
+ // Registers 0 and 1 -> x.
+ OS::MemCopy(buffer, registers_, sizeof(*x));
+ OS::MemCopy(x, buffer, sizeof(*x));
+ }
+}
+
+
+// For use in calls that take one double value constructed either
+// from r0 and r1 or d0 and one integer value.
+void Simulator::GetFpArgs(double* x, int32_t* y) {
+ if (use_eabi_hardfloat()) {
+ *x = vfp_registers_[0];
+ *y = registers_[1];
+ } else {
+ // We use a char buffer to get around the strict-aliasing rules which
+ // otherwise allow the compiler to optimize away the copy.
+ char buffer[sizeof(*x)];
+ // Registers 0 and 1 -> x.
+ OS::MemCopy(buffer, registers_, sizeof(*x));
+ OS::MemCopy(x, buffer, sizeof(*x));
+ // Register 2 -> y.
+ OS::MemCopy(buffer, registers_ + 2, sizeof(*y));
+ OS::MemCopy(y, buffer, sizeof(*y));
}
}
@@ -1618,12 +1648,10 @@
int32_t arg3,
int32_t arg4,
int32_t arg5);
-
-// These prototypes handle the four types of FP calls.
-typedef int64_t (*SimulatorRuntimeCompareCall)(double darg0, double darg1);
-typedef double (*SimulatorRuntimeFPFPCall)(double darg0, double darg1);
-typedef double (*SimulatorRuntimeFPCall)(double darg0);
-typedef double (*SimulatorRuntimeFPIntCall)(double darg0, int32_t arg0);
+typedef double (*SimulatorRuntimeFPCall)(int32_t arg0,
+ int32_t arg1,
+ int32_t arg2,
+ int32_t arg3);
// This signature supports direct call in to API function native callback
// (refer to InvocationCallback in v8.h).
@@ -1689,27 +1717,27 @@
intptr_t external =
reinterpret_cast<intptr_t>(redirection->external_function());
if (fp_call) {
- double dval0, dval1; // one or two double parameters
- int32_t ival; // zero or one integer parameters
- int64_t iresult = 0; // integer return value
- double dresult = 0; // double return value
- GetFpArgs(&dval0, &dval1, &ival);
if (::v8::internal::FLAG_trace_sim || !stack_aligned) {
- SimulatorRuntimeCall generic_target =
- reinterpret_cast<SimulatorRuntimeCall>(external);
+ SimulatorRuntimeFPCall target =
+ reinterpret_cast<SimulatorRuntimeFPCall>(external);
+ double dval0, dval1;
+ int32_t ival;
switch (redirection->type()) {
case ExternalReference::BUILTIN_FP_FP_CALL:
case ExternalReference::BUILTIN_COMPARE_CALL:
+ GetFpArgs(&dval0, &dval1);
PrintF("Call to host function at %p with args %f, %f",
- FUNCTION_ADDR(generic_target), dval0, dval1);
+ FUNCTION_ADDR(target), dval0, dval1);
break;
case ExternalReference::BUILTIN_FP_CALL:
+ GetFpArgs(&dval0);
PrintF("Call to host function at %p with arg %f",
- FUNCTION_ADDR(generic_target), dval0);
+ FUNCTION_ADDR(target), dval0);
break;
case ExternalReference::BUILTIN_FP_INT_CALL:
+ GetFpArgs(&dval0, &ival);
PrintF("Call to host function at %p with args %f, %d",
- FUNCTION_ADDR(generic_target), dval0, ival);
+ FUNCTION_ADDR(target), dval0, ival);
break;
default:
UNREACHABLE();
@@ -1721,54 +1749,22 @@
PrintF("\n");
}
CHECK(stack_aligned);
- switch (redirection->type()) {
- case ExternalReference::BUILTIN_COMPARE_CALL: {
- SimulatorRuntimeCompareCall target =
- reinterpret_cast<SimulatorRuntimeCompareCall>(external);
- iresult = target(dval0, dval1);
- set_register(r0, static_cast<int32_t>(iresult));
- set_register(r1, static_cast<int32_t>(iresult >> 32));
- break;
- }
- case ExternalReference::BUILTIN_FP_FP_CALL: {
- SimulatorRuntimeFPFPCall target =
- reinterpret_cast<SimulatorRuntimeFPFPCall>(external);
- dresult = target(dval0, dval1);
- SetFpResult(dresult);
- break;
- }
- case ExternalReference::BUILTIN_FP_CALL: {
+ if (redirection->type() !=
ExternalReference::BUILTIN_COMPARE_CALL) {
SimulatorRuntimeFPCall target =
- reinterpret_cast<SimulatorRuntimeFPCall>(external);
- dresult = target(dval0);
- SetFpResult(dresult);
- break;
- }
- case ExternalReference::BUILTIN_FP_INT_CALL: {
- SimulatorRuntimeFPIntCall target =
- reinterpret_cast<SimulatorRuntimeFPIntCall>(external);
- dresult = target(dval0, ival);
- SetFpResult(dresult);
- break;
- }
- default:
- UNREACHABLE();
- break;
- }
- if (::v8::internal::FLAG_trace_sim || !stack_aligned) {
- switch (redirection->type()) {
- case ExternalReference::BUILTIN_COMPARE_CALL:
- PrintF("Returned %08x\n", static_cast<int32_t>(iresult));
- break;
- case ExternalReference::BUILTIN_FP_FP_CALL:
- case ExternalReference::BUILTIN_FP_CALL:
- case ExternalReference::BUILTIN_FP_INT_CALL:
- PrintF("Returned %f\n", dresult);
- break;
- default:
- UNREACHABLE();
- break;
+ reinterpret_cast<SimulatorRuntimeFPCall>(external);
+ double result = target(arg0, arg1, arg2, arg3);
+ SetFpResult(result);
+ } else {
+ SimulatorRuntimeCall target =
+ reinterpret_cast<SimulatorRuntimeCall>(external);
+ int64_t result = target(arg0, arg1, arg2, arg3, arg4, arg5);
+ int32_t lo_res = static_cast<int32_t>(result);
+ int32_t hi_res = static_cast<int32_t>(result >> 32);
+ if (::v8::internal::FLAG_trace_sim) {
+ PrintF("Returned %08x\n", lo_res);
}
+ set_register(r0, lo_res);
+ set_register(r1, hi_res);
}
} else if (redirection->type() ==
ExternalReference::DIRECT_API_CALL) {
SimulatorRuntimeDirectApiCall target =
=======================================
--- /branches/bleeding_edge/src/arm/simulator-arm.h Mon Apr 15 08:55:47 2013
+++ /branches/bleeding_edge/src/arm/simulator-arm.h Wed Apr 17 06:51:08 2013
@@ -348,8 +348,10 @@
void* external_function,
v8::internal::ExternalReference::Type type);
- // Handle arguments and return value for runtime FP functions.
- void GetFpArgs(double* x, double* y, int32_t* z);
+ // For use in calls that take double value arguments.
+ void GetFpArgs(double* x, double* y);
+ void GetFpArgs(double* x);
+ void GetFpArgs(double* x, int32_t* y);
void SetFpResult(const double& result);
void TrashCallerSaveRegisters();
=======================================
--- /branches/bleeding_edge/src/atomicops_internals_x86_gcc.h Thu Apr 11
05:40:37 2013
+++ /branches/bleeding_edge/src/atomicops_internals_x86_gcc.h Wed Apr 17
06:51:08 2013
@@ -168,7 +168,7 @@
return *ptr;
}
-#if defined(__x86_64__) && defined(V8_HOST_ARCH_64_BIT)
+#if defined(__x86_64__)
// 64-bit low-level operations on 64-bit platform.
=======================================
--- /branches/bleeding_edge/src/builtins.cc Tue Apr 16 05:30:51 2013
+++ /branches/bleeding_edge/src/builtins.cc Wed Apr 17 06:51:08 2013
@@ -125,31 +125,23 @@
#ifdef DEBUG
-#define BUILTIN(name) \
- MUST_USE_RESULT static MaybeObject* Builtin_Impl_##name( \
- name##ArgumentsType args, Isolate* isolate); \
- MUST_USE_RESULT static MaybeObject* Builtin_##name( \
- int args_length, Object** args_object, Isolate* isolate) { \
- name##ArgumentsType args(args_length, args_object); \
- ASSERT(isolate == Isolate::Current()); \
- args.Verify(); \
- return Builtin_Impl_##name(args, isolate); \
- } \
- MUST_USE_RESULT static MaybeObject* Builtin_Impl_##name( \
+#define BUILTIN(name) \
+ MUST_USE_RESULT static MaybeObject* Builtin_Impl_##name( \
+ name##ArgumentsType args, Isolate* isolate); \
+ MUST_USE_RESULT static MaybeObject* Builtin_##name( \
+ name##ArgumentsType args, Isolate* isolate) { \
+ ASSERT(isolate == Isolate::Current()); \
+ args.Verify(); \
+ return Builtin_Impl_##name(args, isolate); \
+ } \
+ MUST_USE_RESULT static MaybeObject* Builtin_Impl_##name( \
name##ArgumentsType args, Isolate* isolate)
#else // For release mode.
-#define BUILTIN(name) \
- static MaybeObject* Builtin_impl##name( \
- name##ArgumentsType args, Isolate* isolate); \
- static MaybeObject* Builtin_##name( \
- int args_length, Object** args_object, Isolate* isolate) { \
- name##ArgumentsType args(args_length, args_object); \
- return Builtin_impl##name(args, isolate); \
- } \
- static MaybeObject* Builtin_impl##name( \
- name##ArgumentsType args, Isolate* isolate)
+#define BUILTIN(name) \
+ static MaybeObject* Builtin_##name(name##ArgumentsType args, Isolate*
isolate)
+
#endif
=======================================
--- /branches/bleeding_edge/src/builtins.h Thu Apr 11 05:40:37 2013
+++ /branches/bleeding_edge/src/builtins.h Wed Apr 17 06:51:08 2013
@@ -274,6 +274,8 @@
V(APPLY_PREPARE, 1) \
V(APPLY_OVERFLOW, 1)
+MaybeObject* ArrayConstructor_StubFailure(Arguments args, Isolate*
isolate);
+
class BuiltinFunctionTable;
class ObjectVisitor;
=======================================
--- /branches/bleeding_edge/src/ia32/code-stubs-ia32.cc Tue Apr 16 05:16:55
2013
+++ /branches/bleeding_edge/src/ia32/code-stubs-ia32.cc Wed Apr 17 06:51:08
2013
@@ -30,7 +30,6 @@
#if defined(V8_TARGET_ARCH_IA32)
#include "bootstrapper.h"
-#include "builtins-decls.h"
#include "code-stubs.h"
#include "isolate.h"
#include "jsregexp.h"
=======================================
--- /branches/bleeding_edge/src/mips/code-stubs-mips.cc Tue Apr 16 14:35:42
2013
+++ /branches/bleeding_edge/src/mips/code-stubs-mips.cc Wed Apr 17 06:51:08
2013
@@ -30,7 +30,6 @@
#if defined(V8_TARGET_ARCH_MIPS)
#include "bootstrapper.h"
-#include "builtins-decls.h"
#include "code-stubs.h"
#include "codegen.h"
#include "regexp-macro-assembler.h"
=======================================
--- /branches/bleeding_edge/src/x64/code-stubs-x64.cc Wed Apr 17 03:25:36
2013
+++ /branches/bleeding_edge/src/x64/code-stubs-x64.cc Wed Apr 17 06:51:08
2013
@@ -30,7 +30,6 @@
#if defined(V8_TARGET_ARCH_X64)
#include "bootstrapper.h"
-#include "builtins-decls.h"
#include "code-stubs.h"
#include "regexp-macro-assembler.h"
#include "stub-cache.h"
--
--
v8-dev mailing list
[email protected]
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.