Skip to content
Permalink
Browse files
2010-03-06 Patrick Gansterer <paroga@paroga.com>
        Reviewed by Eric Seidel.

        Implemented JIT_OPTIMIZE_NATIVE_CALL for WinCE
        https://bugs.webkit.org/show_bug.cgi?id=33426

        * jit/JITOpcodes.cpp:
        (JSC::JIT::privateCompileCTIMachineTrampolines):

Canonical link: https://commits.webkit.org/46912@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@55615 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
eseidel committed Mar 6, 2010
1 parent 8da44b2 commit b0c2d45079adfaab75109de1a1ce2cd1e89add86
Showing 2 changed files with 66 additions and 2 deletions.
@@ -1,3 +1,13 @@
2010-03-06 Patrick Gansterer <paroga@paroga.com>

Reviewed by Eric Seidel.

Implemented JIT_OPTIMIZE_NATIVE_CALL for WinCE
https://bugs.webkit.org/show_bug.cgi?id=33426

* jit/JITOpcodes.cpp:
(JSC::JIT::privateCompileCTIMachineTrampolines):

2010-03-05 Oliver Hunt <oliver@apple.com>

Reviewed by NOBODY (build fix).
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2009 Apple Inc. All rights reserved.
* Copyright (C) 2010 Patrick Gansterer <paroga@paroga.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -282,6 +283,33 @@ void JIT::privateCompileCTIMachineTrampolines(RefPtr<ExecutablePool>* executable
// r2 - callee
// stack: this(JSValue) and a pointer to ArgList

#if OS(WINCE)
// Setup arg4:
push(stackPointerRegister);

// Setup arg3:
// regT1 currently points to the first argument, regT1-sizeof(Register) points to 'this'
load32(Address(regT1, -(int32_t)sizeof(void*) * 2), ARMRegisters::r3);
push(ARMRegisters::r3);
load32(Address(regT1, -(int32_t)sizeof(void*)), regT3);
storePtr(regT3, Address(stackPointerRegister));

// Setup arg2:
emitGetFromCallFrameHeaderPtr(RegisterFile::Callee, regT2);

// Setup arg1:
move(callFrameRegister, regT1);

// Setup arg0:
move(stackPointerRegister, regT0);

call(Address(regT2, OBJECT_OFFSETOF(JSFunction, m_data)));

load32(Address(stackPointerRegister, 0), regT0);
load32(Address(stackPointerRegister, 4), regT1);

addPtr(Imm32(sizeof(ArgList) + 8), stackPointerRegister);
#else // OS(WINCE)
move(stackPointerRegister, regT3);
subPtr(Imm32(8), stackPointerRegister);
move(stackPointerRegister, regT0);
@@ -290,7 +318,7 @@ void JIT::privateCompileCTIMachineTrampolines(RefPtr<ExecutablePool>* executable
// Setup arg4:
storePtr(regT3, Address(stackPointerRegister, 8));

// Setup arg3
// Setup arg3:
// regT1 currently points to the first argument, regT1-sizeof(Register) points to 'this'
load32(Address(regT1, -(int32_t)sizeof(void*) * 2), regT3);
storePtr(regT3, Address(stackPointerRegister, 0));
@@ -310,6 +338,8 @@ void JIT::privateCompileCTIMachineTrampolines(RefPtr<ExecutablePool>* executable
load32(Address(stackPointerRegister, 20), regT1);

addPtr(Imm32(sizeof(ArgList) + 16 + 8), stackPointerRegister);
#endif // OS(WINCE)

#endif

// Check for an exception
@@ -1764,7 +1794,30 @@ void JIT::privateCompileCTIMachineTrampolines(RefPtr<ExecutablePool>* executable
// push pointer to arguments
storePtr(regT1, Address(stackPointerRegister, OBJECT_OFFSETOF(ArgList, m_args)));

// Setup arg3: regT1 currently points to the first argument, regT1-sizeof(Register) points to 'this'
// regT1 currently points to the first argument, regT1-sizeof(Register) points to 'this'

#if OS(WINCE)
// Setup arg3:
loadPtr(Address(regT1, -(int32_t)sizeof(Register)), ARMRegisters::r3);

// Setup arg2:
emitGetFromCallFrameHeaderPtr(RegisterFile::Callee, regT2);

// Setup arg1:
move(callFrameRegister, regT1);

// Setup arg0:
move(stackPointerRegister, regT0);
subPtr(Imm32(sizeof(Register)), stackPointerRegister);
storePtr(regT0, Address(stackPointerRegister));

call(Address(regT2, OBJECT_OFFSETOF(JSFunction, m_data)));

loadPtr(Address(regT0), regT0);

addPtr(Imm32(sizeof(Register) + sizeof(ArgList)), stackPointerRegister);
#else // OS(WINCE)
// Setup arg3:
loadPtr(Address(regT1, -(int32_t)sizeof(Register)), regT2);

// Setup arg2:
@@ -1779,6 +1832,7 @@ void JIT::privateCompileCTIMachineTrampolines(RefPtr<ExecutablePool>* executable
call(Address(regT1, OBJECT_OFFSETOF(JSFunction, m_data)));

addPtr(Imm32(sizeof(ArgList)), stackPointerRegister);
#endif // OS(WINCE)

#elif ENABLE(JIT_OPTIMIZE_NATIVE_CALL)
#error "JIT_OPTIMIZE_NATIVE_CALL not yet supported on this platform."

0 comments on commit b0c2d45

Please sign in to comment.