From 5f1ab04193ad0130ca8204aadaceae083aca9881 Mon Sep 17 00:00:00 2001 From: Feng Qian Date: Wed, 17 Jun 2009 12:12:20 -0700 Subject: Get WebKit r44544. --- JavaScriptCore/bytecode/CodeBlock.h | 73 +++++++++++++++++-------------------- 1 file changed, 33 insertions(+), 40 deletions(-) (limited to 'JavaScriptCore/bytecode/CodeBlock.h') 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; - - JITCodeRef() - : code(0) -#ifndef NDEBUG - , codeSize(0) -#endif - { - } - - JITCodeRef(void* code, PassRefPtr 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(m_callLinkInfos.begin(), m_callLinkInfos.size(), returnAddress)); } + MethodCallLinkInfo& getMethodCallLinkInfo(void* returnAddress) + { + return *(binaryChop(m_methodCallLinkInfos.begin(), m_methodCallLinkInfos.size(), returnAddress)); + } + unsigned getBytecodeIndex(CallFrame* callFrame, void* nativePC) { reparseForExceptionInfoIfNecessary(callFrame); - return binaryChop(m_exceptionInfo->m_callReturnIndexVector.begin(), m_exceptionInfo->m_callReturnIndexVector.size(), m_jitCode.code.offsetOf(nativePC))->bytecodeIndex; + return binaryChop(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 m_structureStubInfos; Vector m_globalResolveInfos; Vector m_callLinkInfos; + Vector m_methodCallLinkInfos; Vector m_linkedCallerList; #endif @@ -524,7 +517,7 @@ namespace JSC { // Rare Constants Vector > m_functions; - Vector m_unexpectedConstants; + Vector m_unexpectedConstants; Vector > m_regexps; // Jump Tables -- cgit v1.1