summaryrefslogtreecommitdiffstats
path: root/JavaScriptCore/bytecode/CodeBlock.h
diff options
context:
space:
mode:
authorFeng Qian <fqian@google.com>2009-06-17 12:12:20 -0700
committerFeng Qian <fqian@google.com>2009-06-17 12:12:20 -0700
commit5f1ab04193ad0130ca8204aadaceae083aca9881 (patch)
tree5a92cd389e2cfe7fb67197ce14b38469462379f8 /JavaScriptCore/bytecode/CodeBlock.h
parent194315e5a908cc8ed67d597010544803eef1ac59 (diff)
downloadexternal_webkit-5f1ab04193ad0130ca8204aadaceae083aca9881.zip
external_webkit-5f1ab04193ad0130ca8204aadaceae083aca9881.tar.gz
external_webkit-5f1ab04193ad0130ca8204aadaceae083aca9881.tar.bz2
Get WebKit r44544.
Diffstat (limited to 'JavaScriptCore/bytecode/CodeBlock.h')
-rw-r--r--JavaScriptCore/bytecode/CodeBlock.h73
1 files changed, 33 insertions, 40 deletions
diff --git a/JavaScriptCore/bytecode/CodeBlock.h b/JavaScriptCore/bytecode/CodeBlock.h
index 9bd4090..ac29c6c 100644
--- a/JavaScriptCore/bytecode/CodeBlock.h
+++ b/JavaScriptCore/bytecode/CodeBlock.h
@@ -63,34 +63,6 @@ namespace JSC {
#endif
};
-#if ENABLE(JIT)
- // The code, and the associated pool from which it was allocated.
- struct JITCodeRef {
- JITCode code;
-#ifndef NDEBUG
- unsigned codeSize;
-#endif
- RefPtr<ExecutablePool> executablePool;
-
- JITCodeRef()
- : code(0)
-#ifndef NDEBUG
- , codeSize(0)
-#endif
- {
- }
-
- JITCodeRef(void* code, PassRefPtr<ExecutablePool> executablePool)
- : code(code)
-#ifndef NDEBUG
- , codeSize(0)
-#endif
- , executablePool(executablePool)
- {
- }
- };
-#endif
-
struct ExpressionRangeInfo {
enum {
MaxOffset = (1 << 7) - 1,
@@ -134,6 +106,17 @@ namespace JSC {
bool isLinked() { return callee; }
};
+ struct MethodCallLinkInfo {
+ MethodCallLinkInfo()
+ : cachedStructure(0)
+ {
+ }
+
+ MacroAssembler::CodeLocationCall callReturnLocation;
+ MacroAssembler::CodeLocationDataLabelPtr structureLabel;
+ Structure* cachedStructure;
+ };
+
struct FunctionRegisterInfo {
FunctionRegisterInfo(unsigned bytecodeOffset, int functionRegisterIndex)
: bytecodeOffset(bytecodeOffset)
@@ -185,6 +168,11 @@ namespace JSC {
return callLinkInfo->callReturnLocation.calleeReturnAddressValue();
}
+ inline void* getMethodCallLinkInfoReturnLocation(MethodCallLinkInfo* methodCallLinkInfo)
+ {
+ return methodCallLinkInfo->callReturnLocation.calleeReturnAddressValue();
+ }
+
inline unsigned getCallReturnOffset(CallReturnOffsetToBytecodeIndex* pc)
{
return pc->callReturnOffset;
@@ -264,9 +252,9 @@ namespace JSC {
return index >= m_numVars && index < m_numVars + m_numConstants;
}
- ALWAYS_INLINE JSValuePtr getConstant(int index)
+ ALWAYS_INLINE JSValue getConstant(int index)
{
- return m_constantRegisters[index - m_numVars].getJSValue();
+ return m_constantRegisters[index - m_numVars].jsValue();
}
ALWAYS_INLINE bool isTemporaryRegisterIndex(int index)
@@ -309,10 +297,15 @@ namespace JSC {
return *(binaryChop<CallLinkInfo, void*, getCallLinkInfoReturnLocation>(m_callLinkInfos.begin(), m_callLinkInfos.size(), returnAddress));
}
+ MethodCallLinkInfo& getMethodCallLinkInfo(void* returnAddress)
+ {
+ return *(binaryChop<MethodCallLinkInfo, void*, getMethodCallLinkInfoReturnLocation>(m_methodCallLinkInfos.begin(), m_methodCallLinkInfos.size(), returnAddress));
+ }
+
unsigned getBytecodeIndex(CallFrame* callFrame, void* nativePC)
{
reparseForExceptionInfoIfNecessary(callFrame);
- return binaryChop<CallReturnOffsetToBytecodeIndex, unsigned, getCallReturnOffset>(m_exceptionInfo->m_callReturnIndexVector.begin(), m_exceptionInfo->m_callReturnIndexVector.size(), m_jitCode.code.offsetOf(nativePC))->bytecodeIndex;
+ return binaryChop<CallReturnOffsetToBytecodeIndex, unsigned, getCallReturnOffset>(m_exceptionInfo->m_callReturnIndexVector.begin(), m_exceptionInfo->m_callReturnIndexVector.size(), ownerNode()->generatedJITCode().offsetOf(nativePC))->bytecodeIndex;
}
bool functionRegisterForBytecodeOffset(unsigned bytecodeOffset, int& functionRegisterIndex);
@@ -327,9 +320,8 @@ namespace JSC {
#endif
#if ENABLE(JIT)
- void setJITCode(JITCodeRef& jitCode);
- JITCode jitCode() { return m_jitCode.code; }
- ExecutablePool* executablePool() { return m_jitCode.executablePool.get(); }
+ void setJITCode(JITCode);
+ ExecutablePool* executablePool() { return ownerNode()->getExecutablePool(); }
#endif
ScopeNode* ownerNode() const { return m_ownerNode; }
@@ -373,6 +365,9 @@ namespace JSC {
void addCallLinkInfo() { m_callLinkInfos.append(CallLinkInfo()); }
CallLinkInfo& callLinkInfo(int index) { return m_callLinkInfos[index]; }
+ void addMethodCallLinkInfos(unsigned n) { m_methodCallLinkInfos.grow(n); }
+ MethodCallLinkInfo& methodCallLinkInfo(int index) { return m_methodCallLinkInfos[index]; }
+
void addFunctionRegisterInfo(unsigned bytecodeOffset, int functionIndex) { createRareDataIfNecessary(); m_rareData->m_functionRegisterInfos.append(FunctionRegisterInfo(bytecodeOffset, functionIndex)); }
#endif
@@ -414,8 +409,8 @@ namespace JSC {
bool hasFunctions() const { return m_functionExpressions.size() || (m_rareData && m_rareData->m_functions.size()); }
- unsigned addUnexpectedConstant(JSValuePtr v) { createRareDataIfNecessary(); unsigned size = m_rareData->m_unexpectedConstants.size(); m_rareData->m_unexpectedConstants.append(v); return size; }
- JSValuePtr unexpectedConstant(int index) const { ASSERT(m_rareData); return m_rareData->m_unexpectedConstants[index]; }
+ unsigned addUnexpectedConstant(JSValue v) { createRareDataIfNecessary(); unsigned size = m_rareData->m_unexpectedConstants.size(); m_rareData->m_unexpectedConstants.append(v); return size; }
+ JSValue unexpectedConstant(int index) const { ASSERT(m_rareData); return m_rareData->m_unexpectedConstants[index]; }
unsigned addRegExp(RegExp* r) { createRareDataIfNecessary(); unsigned size = m_rareData->m_regexps.size(); m_rareData->m_regexps.append(r); return size; }
RegExp* regexp(int index) const { ASSERT(m_rareData); return m_rareData->m_regexps[index].get(); }
@@ -473,9 +468,6 @@ namespace JSC {
#ifndef NDEBUG
unsigned m_instructionCount;
#endif
-#if ENABLE(JIT)
- JITCodeRef m_jitCode;
-#endif
int m_thisRegister;
@@ -496,6 +488,7 @@ namespace JSC {
Vector<StructureStubInfo> m_structureStubInfos;
Vector<GlobalResolveInfo> m_globalResolveInfos;
Vector<CallLinkInfo> m_callLinkInfos;
+ Vector<MethodCallLinkInfo> m_methodCallLinkInfos;
Vector<CallLinkInfo*> m_linkedCallerList;
#endif
@@ -524,7 +517,7 @@ namespace JSC {
// Rare Constants
Vector<RefPtr<FuncDeclNode> > m_functions;
- Vector<JSValuePtr> m_unexpectedConstants;
+ Vector<JSValue> m_unexpectedConstants;
Vector<RefPtr<RegExp> > m_regexps;
// Jump Tables