summaryrefslogtreecommitdiffstats
path: root/JavaScriptCore/jit/JIT.cpp
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2010-05-26 10:11:43 +0100
committerSteve Block <steveblock@google.com>2010-05-27 11:14:42 +0100
commite78cbe89e6f337f2f1fe40315be88f742b547151 (patch)
treed778000b84a04f24bbad50c7fa66244365e960e9 /JavaScriptCore/jit/JIT.cpp
parent7b582e96e4e909ed7dba1e07153d20fbddaec3f7 (diff)
downloadexternal_webkit-e78cbe89e6f337f2f1fe40315be88f742b547151.zip
external_webkit-e78cbe89e6f337f2f1fe40315be88f742b547151.tar.gz
external_webkit-e78cbe89e6f337f2f1fe40315be88f742b547151.tar.bz2
Merge WebKit at r60074: Initial merge by git
Change-Id: I18a2dc5439e36c928351ea829d8fb4e39b062fc7
Diffstat (limited to 'JavaScriptCore/jit/JIT.cpp')
-rw-r--r--JavaScriptCore/jit/JIT.cpp54
1 files changed, 27 insertions, 27 deletions
diff --git a/JavaScriptCore/jit/JIT.cpp b/JavaScriptCore/jit/JIT.cpp
index c7a4056..eeffd5c 100644
--- a/JavaScriptCore/jit/JIT.cpp
+++ b/JavaScriptCore/jit/JIT.cpp
@@ -24,6 +24,8 @@
*/
#include "config.h"
+
+#if ENABLE(JIT)
#include "JIT.h"
// This probably does not belong here; adding here for now as a quick Windows build fix.
@@ -32,8 +34,6 @@
JSC::MacroAssemblerX86Common::SSE2CheckState JSC::MacroAssemblerX86Common::s_sse2CheckState = NotCheckedSSE2;
#endif
-#if ENABLE(JIT)
-
#include "CodeBlock.h"
#include "Interpreter.h"
#include "JITInlineMethods.h"
@@ -78,10 +78,10 @@ JIT::JIT(JSGlobalData* globalData, CodeBlock* codeBlock)
, m_labels(codeBlock ? codeBlock->instructions().size() : 0)
, m_propertyAccessCompilationInfo(codeBlock ? codeBlock->numberOfStructureStubInfos() : 0)
, m_callStructureStubCompilationInfo(codeBlock ? codeBlock->numberOfCallLinkInfos() : 0)
- , m_bytecodeIndex((unsigned)-1)
+ , m_bytecodeOffset((unsigned)-1)
#if USE(JSVALUE32_64)
, m_jumpTargetIndex(0)
- , m_mappedBytecodeIndex((unsigned)-1)
+ , m_mappedBytecodeOffset((unsigned)-1)
, m_mappedVirtualRegisterIndex((unsigned)-1)
, m_mappedTag((RegisterID)-1)
, m_mappedPayload((RegisterID)-1)
@@ -114,7 +114,7 @@ void JIT::emitTimeoutCheck()
#endif
#define NEXT_OPCODE(name) \
- m_bytecodeIndex += OPCODE_LENGTH(name); \
+ m_bytecodeOffset += OPCODE_LENGTH(name); \
break;
#if USE(JSVALUE32_64)
@@ -176,21 +176,21 @@ void JIT::privateCompileMainPass()
m_globalResolveInfoIndex = 0;
m_callLinkInfoIndex = 0;
- for (m_bytecodeIndex = 0; m_bytecodeIndex < instructionCount; ) {
- Instruction* currentInstruction = instructionsBegin + m_bytecodeIndex;
- ASSERT_WITH_MESSAGE(m_interpreter->isOpcode(currentInstruction->u.opcode), "privateCompileMainPass gone bad @ %d", m_bytecodeIndex);
+ for (m_bytecodeOffset = 0; m_bytecodeOffset < instructionCount; ) {
+ Instruction* currentInstruction = instructionsBegin + m_bytecodeOffset;
+ ASSERT_WITH_MESSAGE(m_interpreter->isOpcode(currentInstruction->u.opcode), "privateCompileMainPass gone bad @ %d", m_bytecodeOffset);
#if ENABLE(OPCODE_SAMPLING)
- if (m_bytecodeIndex > 0) // Avoid the overhead of sampling op_enter twice.
+ if (m_bytecodeOffset > 0) // Avoid the overhead of sampling op_enter twice.
sampleInstruction(currentInstruction);
#endif
#if !USE(JSVALUE32_64)
- if (m_labels[m_bytecodeIndex].isUsed())
+ if (m_labels[m_bytecodeOffset].isUsed())
killLastResultRegister();
#endif
- m_labels[m_bytecodeIndex] = label();
+ m_labels[m_bytecodeOffset] = label();
switch (m_interpreter->getOpcodeID(currentInstruction->u.opcode)) {
DEFINE_BINARY_OP(op_del_by_val)
@@ -221,7 +221,6 @@ void JIT::privateCompileMainPass()
DEFINE_OP(op_call_varargs)
DEFINE_OP(op_catch)
DEFINE_OP(op_construct)
- DEFINE_OP(op_construct_verify)
DEFINE_OP(op_convert_this)
DEFINE_OP(op_init_arguments)
DEFINE_OP(op_create_arguments)
@@ -302,6 +301,8 @@ void JIT::privateCompileMainPass()
DEFINE_OP(op_resolve_skip)
DEFINE_OP(op_resolve_with_base)
DEFINE_OP(op_ret)
+ DEFINE_OP(op_call_put_result)
+ DEFINE_OP(op_ret_object_or_this)
DEFINE_OP(op_rshift)
DEFINE_OP(op_urshift)
DEFINE_OP(op_sret)
@@ -347,7 +348,7 @@ void JIT::privateCompileMainPass()
#ifndef NDEBUG
// Reset this, in order to guard its use with ASSERTs.
- m_bytecodeIndex = (unsigned)-1;
+ m_bytecodeOffset = (unsigned)-1;
#endif
}
@@ -356,7 +357,7 @@ void JIT::privateCompileLinkPass()
{
unsigned jmpTableCount = m_jmpTable.size();
for (unsigned i = 0; i < jmpTableCount; ++i)
- m_jmpTable[i].from.linkTo(m_labels[m_jmpTable[i].toBytecodeIndex], this);
+ m_jmpTable[i].from.linkTo(m_labels[m_jmpTable[i].toBytecodeOffset], this);
m_jmpTable.clear();
}
@@ -373,11 +374,11 @@ void JIT::privateCompileSlowCases()
killLastResultRegister();
#endif
- m_bytecodeIndex = iter->to;
+ m_bytecodeOffset = iter->to;
#ifndef NDEBUG
- unsigned firstTo = m_bytecodeIndex;
+ unsigned firstTo = m_bytecodeOffset;
#endif
- Instruction* currentInstruction = instructionsBegin + m_bytecodeIndex;
+ Instruction* currentInstruction = instructionsBegin + m_bytecodeOffset;
switch (m_interpreter->getOpcodeID(currentInstruction->u.opcode)) {
DEFINE_SLOWCASE_OP(op_add)
@@ -389,7 +390,6 @@ void JIT::privateCompileSlowCases()
DEFINE_SLOWCASE_OP(op_call_eval)
DEFINE_SLOWCASE_OP(op_call_varargs)
DEFINE_SLOWCASE_OP(op_construct)
- DEFINE_SLOWCASE_OP(op_construct_verify)
DEFINE_SLOWCASE_OP(op_convert_this)
#if !USE(JSVALUE32)
DEFINE_SLOWCASE_OP(op_div)
@@ -450,7 +450,7 @@ void JIT::privateCompileSlowCases()
#ifndef NDEBUG
// Reset this, in order to guard its use with ASSERTs.
- m_bytecodeIndex = (unsigned)-1;
+ m_bytecodeOffset = (unsigned)-1;
#endif
}
@@ -483,10 +483,10 @@ JITCode JIT::privateCompile()
if (m_codeBlock->codeType() == FunctionCode) {
registerFileCheck.link(this);
- m_bytecodeIndex = 0;
+ m_bytecodeOffset = 0;
JITStubCall(this, cti_register_file_check).call();
#ifndef NDEBUG
- m_bytecodeIndex = (unsigned)-1; // Reset this, in order to guard its use with ASSERTs.
+ m_bytecodeOffset = (unsigned)-1; // Reset this, in order to guard its use with ASSERTs.
#endif
jump(functionBody);
}
@@ -498,27 +498,27 @@ JITCode JIT::privateCompile()
// Translate vPC offsets into addresses in JIT generated code, for switch tables.
for (unsigned i = 0; i < m_switches.size(); ++i) {
SwitchRecord record = m_switches[i];
- unsigned bytecodeIndex = record.bytecodeIndex;
+ unsigned bytecodeOffset = record.bytecodeOffset;
if (record.type != SwitchRecord::String) {
ASSERT(record.type == SwitchRecord::Immediate || record.type == SwitchRecord::Character);
ASSERT(record.jumpTable.simpleJumpTable->branchOffsets.size() == record.jumpTable.simpleJumpTable->ctiOffsets.size());
- record.jumpTable.simpleJumpTable->ctiDefault = patchBuffer.locationOf(m_labels[bytecodeIndex + record.defaultOffset]);
+ record.jumpTable.simpleJumpTable->ctiDefault = patchBuffer.locationOf(m_labels[bytecodeOffset + record.defaultOffset]);
for (unsigned j = 0; j < record.jumpTable.simpleJumpTable->branchOffsets.size(); ++j) {
unsigned offset = record.jumpTable.simpleJumpTable->branchOffsets[j];
- record.jumpTable.simpleJumpTable->ctiOffsets[j] = offset ? patchBuffer.locationOf(m_labels[bytecodeIndex + offset]) : record.jumpTable.simpleJumpTable->ctiDefault;
+ record.jumpTable.simpleJumpTable->ctiOffsets[j] = offset ? patchBuffer.locationOf(m_labels[bytecodeOffset + offset]) : record.jumpTable.simpleJumpTable->ctiDefault;
}
} else {
ASSERT(record.type == SwitchRecord::String);
- record.jumpTable.stringJumpTable->ctiDefault = patchBuffer.locationOf(m_labels[bytecodeIndex + record.defaultOffset]);
+ record.jumpTable.stringJumpTable->ctiDefault = patchBuffer.locationOf(m_labels[bytecodeOffset + record.defaultOffset]);
StringJumpTable::StringOffsetTable::iterator end = record.jumpTable.stringJumpTable->offsetTable.end();
for (StringJumpTable::StringOffsetTable::iterator it = record.jumpTable.stringJumpTable->offsetTable.begin(); it != end; ++it) {
unsigned offset = it->second.branchOffset;
- it->second.ctiOffset = offset ? patchBuffer.locationOf(m_labels[bytecodeIndex + offset]) : record.jumpTable.stringJumpTable->ctiDefault;
+ it->second.ctiOffset = offset ? patchBuffer.locationOf(m_labels[bytecodeOffset + offset]) : record.jumpTable.stringJumpTable->ctiDefault;
}
}
}
@@ -536,7 +536,7 @@ JITCode JIT::privateCompile()
if (m_codeBlock->hasExceptionInfo()) {
m_codeBlock->callReturnIndexVector().reserveCapacity(m_calls.size());
for (Vector<CallRecord>::iterator iter = m_calls.begin(); iter != m_calls.end(); ++iter)
- m_codeBlock->callReturnIndexVector().append(CallReturnOffsetToBytecodeIndex(patchBuffer.returnAddressOffset(iter->from), iter->bytecodeIndex));
+ m_codeBlock->callReturnIndexVector().append(CallReturnOffsetToBytecodeOffset(patchBuffer.returnAddressOffset(iter->from), iter->bytecodeOffset));
}
// Link absolute addresses for jsr