Commit 9c485e18 authored by danno@chromium.org's avatar danno@chromium.org

Introduce x87 port

Support x87-only platform (ia32 without SSE)

R=danno@chromium.org

Review URL: https://codereview.chromium.org/293743005

Patch from Weiliang Lin <weiliang.lin@intel.com>.

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21469 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 8d334ed1
......@@ -13,6 +13,7 @@ Bloomberg Finance L.P.
NVIDIA Corporation
BlackBerry Limited
Opera Software ASA
Intel Corporation
Akinori MUSHA <knu@FreeBSD.org>
Alexander Botero-Lowry <alexbl@FreeBSD.org>
......@@ -24,6 +25,7 @@ Baptiste Afsa <baptiste.afsa@arm.com>
Bert Belder <bertbelder@gmail.com>
Burcu Dogan <burcujdogan@gmail.com>
Craig Schlenter <craig.schlenter@gmail.com>
Chunyang Dai <chunyang.dai@intel.com>
Daniel Andersson <kodandersson@gmail.com>
Daniel James <dnljms@gmail.com>
Derek J Conrod <dconrod@codeaurora.org>
......@@ -64,6 +66,7 @@ Subrato K De <subratokde@codeaurora.org>
Tobias Burnus <burnus@net-b.de>
Vincent Belliard <vincent.belliard@arm.com>
Vlad Burlik <vladbph@gmail.com>
Weiliang Lin<weiliang.lin@intel.com>
Xi Qian <xi.qian@intel.com>
Yuqiang Xian <yuqiang.xian@intel.com>
Zaheer Ahmad <zahmad@codeaurora.org>
......
......@@ -217,11 +217,11 @@ endif
# Architectures and modes to be compiled. Consider these to be internal
# variables, don't override them (use the targets instead).
ARCHES = ia32 x64 arm arm64 mips mipsel
ARCHES = ia32 x64 arm arm64 mips mipsel x87
DEFAULT_ARCHES = ia32 x64 arm
MODES = release debug optdebug
DEFAULT_MODES = release debug
ANDROID_ARCHES = android_ia32 android_arm android_arm64 android_mipsel
ANDROID_ARCHES = android_ia32 android_arm android_arm64 android_mipsel android_x87
NACL_ARCHES = nacl_ia32 nacl_x64
# List of files that trigger Makefile regeneration:
......
......@@ -26,7 +26,7 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# Those definitions should be consistent with the main Makefile
ANDROID_ARCHES = android_ia32 android_arm android_arm64 android_mipsel
ANDROID_ARCHES = android_ia32 android_arm android_arm64 android_mipsel android_x87
MODES = release debug
# Generates all combinations of ANDROID ARCHES and MODES,
......@@ -73,7 +73,14 @@ else
TOOLCHAIN_PREFIX = i686-linux-android
TOOLCHAIN_VER = 4.6
else
$(error Target architecture "${ARCH}" is not supported)
ifeq ($(ARCH), android_x87)
DEFINES = target_arch=x87 v8_target_arch=x87 android_target_arch=x86 android_target_platform=14
TOOLCHAIN_ARCH = x86
TOOLCHAIN_PREFIX = i686-linux-android
TOOLCHAIN_VER = 4.6
else
$(error Target architecture "${ARCH}" is not supported)
endif
endif
endif
endif
......
......@@ -179,7 +179,7 @@
'-L<(android_stlport_libs)/mips',
],
}],
['target_arch=="ia32"', {
['target_arch=="ia32" or target_arch=="x87"', {
'ldflags': [
'-L<(android_stlport_libs)/x86',
],
......@@ -196,7 +196,7 @@
}],
],
}],
['target_arch=="ia32"', {
['target_arch=="ia32" or target_arch=="x87"', {
# The x86 toolchain currently has problems with stack-protector.
'cflags!': [
'-fstack-protector',
......
......@@ -115,7 +115,7 @@
}, {
'os_posix%': 1,
}],
['(v8_target_arch=="ia32" or v8_target_arch=="x64") and \
['(v8_target_arch=="ia32" or v8_target_arch=="x64" or v8_target_arch=="x87") and \
(OS=="linux" or OS=="mac")', {
'v8_enable_gdbjit%': 1,
}, {
......
......@@ -288,6 +288,13 @@
'V8_TARGET_ARCH_IA32',
],
}], # v8_target_arch=="ia32"
['v8_target_arch=="x87"', {
'defines': [
'V8_TARGET_ARCH_X87',
],
'cflags': ['-mfpmath=387'],
'ldflags': ['-mfpmath=387'],
}], # v8_target_arch=="x87"
['v8_target_arch=="mips"', {
'defines': [
'V8_TARGET_ARCH_MIPS',
......@@ -440,7 +447,7 @@
}],
['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \
or OS=="netbsd" or OS=="mac" or OS=="android" or OS=="qnx") and \
(v8_target_arch=="arm" or v8_target_arch=="ia32" or \
(v8_target_arch=="arm" or v8_target_arch=="ia32" or v8_target_arch=="x87" or\
v8_target_arch=="mips" or v8_target_arch=="mipsel")', {
# Check whether the host compiler and target compiler support the
# '-m32' option and set it if so.
......
......@@ -66,6 +66,8 @@
#include "arm/assembler-arm-inl.h"
#elif V8_TARGET_ARCH_MIPS
#include "mips/assembler-mips-inl.h"
#elif V8_TARGET_ARCH_X87
#include "x87/assembler-x87-inl.h"
#else
#error "Unknown architecture."
#endif
......@@ -82,6 +84,8 @@
#include "arm/regexp-macro-assembler-arm.h"
#elif V8_TARGET_ARCH_MIPS
#include "mips/regexp-macro-assembler-mips.h"
#elif V8_TARGET_ARCH_X87
#include "x87/regexp-macro-assembler-x87.h"
#else // Unknown architecture.
#error "Unknown architecture."
#endif // Target architecture.
......@@ -1345,6 +1349,8 @@ ExternalReference ExternalReference::re_check_stack_guard_state(
function = FUNCTION_ADDR(RegExpMacroAssemblerARM::CheckStackGuardState);
#elif V8_TARGET_ARCH_MIPS
function = FUNCTION_ADDR(RegExpMacroAssemblerMIPS::CheckStackGuardState);
#elif V8_TARGET_ARCH_X87
function = FUNCTION_ADDR(RegExpMacroAssemblerX87::CheckStackGuardState);
#else
UNREACHABLE();
#endif
......
......@@ -446,6 +446,8 @@ class RuntimeCallHelper {
#include "arm/code-stubs-arm.h"
#elif V8_TARGET_ARCH_MIPS
#include "mips/code-stubs-mips.h"
#elif V8_TARGET_ARCH_X87
#include "x87/code-stubs-x87.h"
#else
#error Unsupported target architecture.
#endif
......
......@@ -55,6 +55,8 @@ enum TypeofState { INSIDE_TYPEOF, NOT_INSIDE_TYPEOF };
#include "arm/codegen-arm.h"
#elif V8_TARGET_ARCH_MIPS
#include "mips/codegen-mips.h"
#elif V8_TARGET_ARCH_X87
#include "x87/codegen-x87.h"
#else
#error Unsupported target architecture.
#endif
......
......@@ -19,6 +19,8 @@
#include "arm/frames-arm.h"
#elif V8_TARGET_ARCH_MIPS
#include "mips/frames-mips.h"
#elif V8_TARGET_ARCH_X87
#include "x87/frames-x87.h"
#else
#error Unsupported target architecture.
#endif
......
......@@ -450,7 +450,7 @@ StackFrame::Type StackFrame::GetCallerState(State* state) const {
Address StackFrame::UnpaddedFP() const {
#if V8_TARGET_ARCH_IA32
#if V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_X87
if (!is_optimized()) return fp();
int32_t alignment_state = Memory::int32_at(
fp() + JavaScriptFrameConstants::kDynamicAlignmentStateOffset);
......
......@@ -99,7 +99,7 @@ class FullCodeGenerator: public AstVisitor {
static const int kMaxBackEdgeWeight = 127;
// Platform-specific code size multiplier.
#if V8_TARGET_ARCH_IA32
#if V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_X87
static const int kCodeSizeMultiplier = 105;
static const int kBootCodeSizeMultiplier = 100;
#elif V8_TARGET_ARCH_X64
......
......@@ -194,7 +194,7 @@ class DebugSectionBase : public ZoneObject {
struct MachOSectionHeader {
char sectname[16];
char segname[16];
#if V8_TARGET_ARCH_IA32
#if V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_X87
uint32_t addr;
uint32_t size;
#else
......@@ -511,7 +511,7 @@ class MachO BASE_EMBEDDED {
uint32_t cmd;
uint32_t cmdsize;
char segname[16];
#if V8_TARGET_ARCH_IA32
#if V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_X87
uint32_t vmaddr;
uint32_t vmsize;
uint32_t fileoff;
......@@ -537,7 +537,7 @@ class MachO BASE_EMBEDDED {
Writer::Slot<MachOHeader> WriteHeader(Writer* w) {
ASSERT(w->position() == 0);
Writer::Slot<MachOHeader> header = w->CreateSlotHere<MachOHeader>();
#if V8_TARGET_ARCH_IA32
#if V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_X87
header->magic = 0xFEEDFACEu;
header->cputype = 7; // i386
header->cpusubtype = 3; // CPU_SUBTYPE_I386_ALL
......@@ -562,7 +562,7 @@ class MachO BASE_EMBEDDED {
uintptr_t code_size) {
Writer::Slot<MachOSegmentCommand> cmd =
w->CreateSlotHere<MachOSegmentCommand>();
#if V8_TARGET_ARCH_IA32
#if V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_X87
cmd->cmd = LC_SEGMENT_32;
#else
cmd->cmd = LC_SEGMENT_64;
......@@ -649,7 +649,7 @@ class ELF BASE_EMBEDDED {
void WriteHeader(Writer* w) {
ASSERT(w->position() == 0);
Writer::Slot<ELFHeader> header = w->CreateSlotHere<ELFHeader>();
#if V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_ARM
#if V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_X87
const uint8_t ident[16] =
{ 0x7f, 'E', 'L', 'F', 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0};
#elif V8_TARGET_ARCH_X64
......@@ -660,7 +660,7 @@ class ELF BASE_EMBEDDED {
#endif
OS::MemCopy(header->ident, ident, 16);
header->type = 1;
#if V8_TARGET_ARCH_IA32
#if V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_X87
header->machine = 3;
#elif V8_TARGET_ARCH_X64
// Processor identification value for x64 is 62 as defined in
......@@ -762,7 +762,7 @@ class ELFSymbol BASE_EMBEDDED {
Binding binding() const {
return static_cast<Binding>(info >> 4);
}
#if V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_ARM
#if V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_X87
struct SerializedLayout {
SerializedLayout(uint32_t name,
uintptr_t value,
......@@ -1084,7 +1084,7 @@ class DebugInfoSection : public DebugSection {
w->Write<intptr_t>(desc_->CodeStart() + desc_->CodeSize());
Writer::Slot<uint32_t> fb_block_size = w->CreateSlotHere<uint32_t>();
uintptr_t fb_block_start = w->position();
#if V8_TARGET_ARCH_IA32
#if V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_X87
w->Write<uint8_t>(DW_OP_reg5); // The frame pointer's here on ia32
#elif V8_TARGET_ARCH_X64
w->Write<uint8_t>(DW_OP_reg6); // and here on x64.
......
......@@ -77,7 +77,7 @@ namespace internal {
// Target architecture detection. This may be set externally. If not, detect
// in the same way as the host architecture, that is, target the native
// environment as presented by the compiler.
#if !V8_TARGET_ARCH_X64 && !V8_TARGET_ARCH_IA32 && \
#if !V8_TARGET_ARCH_X64 && !V8_TARGET_ARCH_IA32 && !V8_TARGET_ARCH_X87 &&\
!V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_ARM64 && !V8_TARGET_ARCH_MIPS
#if defined(_M_X64) || defined(__x86_64__)
#define V8_TARGET_ARCH_X64 1
......@@ -141,6 +141,8 @@ namespace internal {
#else
#define V8_TARGET_LITTLE_ENDIAN 1
#endif
#elif V8_TARGET_ARCH_X87
#define V8_TARGET_LITTLE_ENDIAN 1
#else
#error Unknown target architecture endianness
#endif
......
......@@ -19,6 +19,8 @@
#include "arm/lithium-arm.h"
#elif V8_TARGET_ARCH_MIPS
#include "mips/lithium-mips.h"
#elif V8_TARGET_ARCH_X87
#include "x87/lithium-x87.h"
#else
#error Unsupported target architecture.
#endif
......
......@@ -51,6 +51,8 @@
#include "arm/lithium-codegen-arm.h"
#elif V8_TARGET_ARCH_MIPS
#include "mips/lithium-codegen-mips.h"
#elif V8_TARGET_ARCH_X87
#include "x87/lithium-codegen-x87.h"
#else
#error Unsupported target architecture.
#endif
......
......@@ -32,6 +32,8 @@
#include "arm/regexp-macro-assembler-arm.h"
#elif V8_TARGET_ARCH_MIPS
#include "mips/regexp-macro-assembler-mips.h"
#elif V8_TARGET_ARCH_X87
#include "x87/regexp-macro-assembler-x87.h"
#else
#error Unsupported target architecture.
#endif
......@@ -6075,6 +6077,9 @@ RegExpEngine::CompilationResult RegExpEngine::Compile(
#elif V8_TARGET_ARCH_MIPS
RegExpMacroAssemblerMIPS macro_assembler(mode, (data->capture_count + 1) * 2,
zone);
#elif V8_TARGET_ARCH_X87
RegExpMacroAssemblerX87 macro_assembler(mode, (data->capture_count + 1) * 2,
zone);
#else
#error "Unsupported architecture"
#endif
......
......@@ -17,6 +17,8 @@
#include "arm/lithium-arm.h"
#elif V8_TARGET_ARCH_MIPS
#include "mips/lithium-mips.h"
#elif V8_TARGET_ARCH_X87
#include "x87/lithium-x87.h"
#else
#error "Unknown architecture."
#endif
......
......@@ -18,6 +18,8 @@
#include "arm/lithium-arm.h"
#elif V8_TARGET_ARCH_MIPS
#include "mips/lithium-mips.h"
#elif V8_TARGET_ARCH_X87
#include "x87/lithium-x87.h"
#else
#error "Unknown architecture."
#endif
......
......@@ -21,6 +21,9 @@
#elif V8_TARGET_ARCH_MIPS
#include "mips/lithium-mips.h"
#include "mips/lithium-codegen-mips.h"
#elif V8_TARGET_ARCH_X87
#include "x87/lithium-x87.h"
#include "x87/lithium-codegen-x87.h"
#else
#error Unsupported target architecture.
#endif
......
......@@ -22,6 +22,9 @@
#elif V8_TARGET_ARCH_ARM64
#include "arm64/lithium-arm64.h"
#include "arm64/lithium-codegen-arm64.h"
#elif V8_TARGET_ARCH_X87
#include "x87/lithium-x87.h"
#include "x87/lithium-codegen-x87.h"
#else
#error "Unknown architecture."
#endif
......
......@@ -322,6 +322,7 @@ class PerfJitLogger : public CodeEventLogger {
static const uint32_t kElfMachX64 = 62;
static const uint32_t kElfMachARM = 40;
static const uint32_t kElfMachMIPS = 10;
static const uint32_t kElfMachX87 = 3;
struct jitheader {
uint32_t magic;
......@@ -361,6 +362,8 @@ class PerfJitLogger : public CodeEventLogger {
return kElfMachARM;
#elif V8_TARGET_ARCH_MIPS
return kElfMachMIPS;
#elif V8_TARGET_ARCH_X87
return kElfMachX87;
#else
UNIMPLEMENTED();
return 0;
......@@ -557,6 +560,8 @@ void LowLevelLogger::LogCodeInfo() {
const char arch[] = "arm";
#elif V8_TARGET_ARCH_MIPS
const char arch[] = "mips";
#elif V8_TARGET_ARCH_X87
const char arch[] = "x87";
#else
const char arch[] = "unknown";
#endif
......
......@@ -71,6 +71,12 @@ const int kInvalidProtoDepth = -1;
#include "mips/assembler-mips-inl.h"
#include "code.h" // must be after assembler_*.h
#include "mips/macro-assembler-mips.h"
#elif V8_TARGET_ARCH_X87
#include "assembler.h"
#include "x87/assembler-x87.h"
#include "x87/assembler-x87-inl.h"
#include "code.h" // must be after assembler_*.h
#include "x87/macro-assembler-x87.h"
#else
#error Unsupported target architecture.
#endif
......
......@@ -442,7 +442,7 @@ int OS::VSNPrintF(Vector<char> str,
}
#if V8_TARGET_ARCH_IA32
#if V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_X87
static void MemMoveWrapper(void* dest, const void* src, size_t size) {
memmove(dest, src, size);
}
......@@ -491,7 +491,7 @@ OS::MemCopyUint8Function CreateMemCopyUint8Function(
void OS::PostSetUp() {
#if V8_TARGET_ARCH_IA32
#if V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_X87
OS::MemMoveFunction generated_memmove = CreateMemMoveFunction();
if (generated_memmove != NULL) {
memmove_function = generated_memmove;
......
......@@ -107,7 +107,7 @@ intptr_t OS::MaxVirtualMemory() {
}
#if V8_TARGET_ARCH_IA32
#if V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_X87
static void MemMoveWrapper(void* dest, const void* src, size_t size) {
memmove(dest, src, size);
}
......@@ -127,7 +127,7 @@ void OS::MemMove(void* dest, const void* src, size_t size) {
(*memmove_function)(dest, src, size);
}
#endif // V8_TARGET_ARCH_IA32
#endif // V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_X87
class TimezoneCache {
......@@ -453,7 +453,7 @@ char* Win32Time::LocalTimezone(TimezoneCache* cache) {
void OS::PostSetUp() {
#if V8_TARGET_ARCH_IA32
#if V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_X87
OS::MemMoveFunction generated_memmove = CreateMemMoveFunction();
if (generated_memmove != NULL) {
memmove_function = generated_memmove;
......
......@@ -52,7 +52,7 @@ int strncasecmp(const char* s1, const char* s2, int n);
#if (_MSC_VER < 1800)
inline int lrint(double flt) {
int intgr;
#if V8_TARGET_ARCH_IA32
#if V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_X87
__asm {
fld flt
fistp intgr
......@@ -78,7 +78,7 @@ namespace internal {
#ifndef V8_NO_FAST_TLS
#if defined(_MSC_VER) && V8_HOST_ARCH_IA32
#if defined(_MSC_VER) && (V8_HOST_ARCH_IA32)
#define V8_FAST_TLS_SUPPORTED 1
......@@ -292,7 +292,7 @@ class OS {
// the platform doesn't care. Guaranteed to be a power of two.
static int ActivationFrameAlignment();
#if defined(V8_TARGET_ARCH_IA32)
#if defined(V8_TARGET_ARCH_IA32) || defined(V8_TARGET_ARCH_X87)
// Limit below which the extra overhead of the MemCopy function is likely
// to outweigh the benefits of faster copying.
static const int kMinComplexMemCopy = 64;
......
......@@ -17,7 +17,7 @@ RegExpMacroAssemblerTracer::RegExpMacroAssemblerTracer(
unsigned int type = assembler->Implementation();
ASSERT(type < 6);
const char* impl_names[] = {"IA32", "ARM", "ARM64",
"MIPS", "X64", "Bytecode"};
"MIPS", "X64", "X87", "Bytecode"};
PrintF("RegExpMacroAssembler%s();\n", impl_names[type]);
}
......
......@@ -33,6 +33,7 @@ class RegExpMacroAssembler {
kARM64Implementation,
kMIPSImplementation,
kX64Implementation,
kX87Implementation,
kBytecodeImplementation
};
......
......@@ -15,6 +15,8 @@
#include "arm/simulator-arm.h"
#elif V8_TARGET_ARCH_MIPS
#include "mips/simulator-mips.h"
#elif V8_TARGET_ARCH_X87
#include "x87/simulator-x87.h"
#else
#error Unsupported target architecture.
#endif
......
......@@ -153,7 +153,8 @@ static void ReadDiyFp(Vector<const char> buffer,
static bool DoubleStrtod(Vector<const char> trimmed,
int exponent,
double* result) {
#if (V8_TARGET_ARCH_IA32 || defined(USE_SIMULATOR)) && !defined(_MSC_VER)
#if (V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_X87 || defined(USE_SIMULATOR)) && \
!defined(_MSC_VER)
// On x86 the floating-point stack can be 64 or 80 bits wide. If it is
// 80 bits wide (as is the case on Linux) then double-rounding occurs and the
// result is not accurate.
......
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.
// Copyright 2011 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.
#ifndef V8_X87_CODEGEN_X87_H_
#define V8_X87_CODEGEN_X87_H_
#include "ast.h"
#include "ic-inl.h"
namespace v8 {
namespace internal {
class StringCharLoadGenerator : public AllStatic {
public:
// Generates the code for handling different string types and loading the
// indexed character into |result|. We expect |index| as untagged input and
// |result| as untagged output.
static void Generate(MacroAssembler* masm,
Factory* factory,
Register string,
Register index,
Register result,
Label* call_runtime);
private:
DISALLOW_COPY_AND_ASSIGN(StringCharLoadGenerator);
};
} } // namespace v8::internal
#endif // V8_X87_CODEGEN_X87_H_
// Copyright 2011 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.
// CPU specific code for ia32 independent of OS goes here.
#ifdef __GNUC__
#include "third_party/valgrind/valgrind.h"
#endif
#include "v8.h"
#if V8_TARGET_ARCH_X87
#include "cpu.h"
#include "macro-assembler.h"
namespace v8 {
namespace internal {
void CPU::FlushICache(void* start, size_t size) {
// No need to flush the instruction cache on Intel. On Intel instruction
// cache flushing is only necessary when multiple cores running the same
// code simultaneously. V8 (and JavaScript) is single threaded and when code
// is patched on an intel CPU the core performing the patching will have its
// own instruction cache updated automatically.
// If flushing of the instruction cache becomes necessary Windows has the
// API function FlushInstructionCache.
// By default, valgrind only checks the stack for writes that might need to
// invalidate already cached translated code. This leads to random
// instability when code patches or moves are sometimes unnoticed. One
// solution is to run valgrind with --smc-check=all, but this comes at a big
// performance cost. We can notify valgrind to invalidate its cache.
#ifdef VALGRIND_DISCARD_TRANSLATIONS
unsigned res = VALGRIND_DISCARD_TRANSLATIONS(start, size);
USE(res);
#endif
}
} } // namespace v8::internal
#endif // V8_TARGET_ARCH_X87
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
// Copyright 2006-2008 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 "v8.h"
#if V8_TARGET_ARCH_X87
#include "assembler.h"
#include "assembler-x87.h"
#include "assembler-x87-inl.h"
#include "frames.h"
namespace v8 {
namespace internal {
Register JavaScriptFrame::fp_register() { return ebp; }
Register JavaScriptFrame::context_register() { return esi; }
Register JavaScriptFrame::constant_pool_pointer_register() {
UNREACHABLE();
return no_reg;
}
Register StubFailureTrampolineFrame::fp_register() { return ebp; }
Register StubFailureTrampolineFrame::context_register() { return esi; }
Register StubFailureTrampolineFrame::constant_pool_pointer_register() {
UNREACHABLE();
return no_reg;
}
Object*& ExitFrame::constant_pool_slot() const {
UNREACHABLE();
return Memory::Object_at(NULL);
}
} } // namespace v8::internal
#endif // V8_TARGET_ARCH_X87
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.
// Copyright 2008 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.
// Since there is no simulator for the ia32 architecture this file is empty.
// 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.
#ifndef V8_X87_SIMULATOR_X87_H_
#define V8_X87_SIMULATOR_X87_H_
#include "allocation.h"
namespace v8 {
namespace internal {
// Since there is no simulator for the ia32 architecture the only thing we can
// do is to call the entry directly.
#define CALL_GENERATED_CODE(entry, p0, p1, p2, p3, p4) \
(entry(p0, p1, p2, p3, p4))
typedef int (*regexp_matcher)(String*, int, const byte*,
const byte*, int*, int, Address, int, Isolate*);
// Call the generated regexp code directly. The code at the entry address should
// expect eight int/pointer sized arguments and return an int.
#define CALL_GENERATED_REGEXP_CODE(entry, p0, p1, p2, p3, p4, p5, p6, p7, p8) \
(FUNCTION_CAST<regexp_matcher>(entry)(p0, p1, p2, p3, p4, p5, p6, p7, p8))
// The stack limit beyond which we will throw stack overflow errors in
// generated code. Because generated code on ia32 uses the C stack, we
// just use the C stack limit.
class SimulatorStack : public v8::internal::AllStatic {
public:
static inline uintptr_t JsLimitFromCLimit(Isolate* isolate,
uintptr_t c_limit) {
USE(isolate);
return c_limit;
}
static inline uintptr_t RegisterCTryCatch(uintptr_t try_catch_address) {
return try_catch_address;
}
static inline void UnregisterCTryCatch() { }
};
} } // namespace v8::internal
#endif // V8_X87_SIMULATOR_X87_H_
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