From 470286ecfe79d59df14944e5b5d34630fc739391 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Thu, 22 Nov 2012 09:09:45 +0100 Subject: Imported WebKit commit e89504fa9195b2063b2530961d4b73dd08de3242 (http://svn.webkit.org/repository/webkit/trunk@135485) Change-Id: I03774e5ac79721c13ffa30d152537a74d0b12e66 Reviewed-by: Simon Hausmann --- Source/JavaScriptCore/bytecode/CodeBlock.h | 54 +++++++++++++++++++----------- 1 file changed, 35 insertions(+), 19 deletions(-) (limited to 'Source/JavaScriptCore/bytecode/CodeBlock.h') diff --git a/Source/JavaScriptCore/bytecode/CodeBlock.h b/Source/JavaScriptCore/bytecode/CodeBlock.h index a28064940..63a03630e 100644 --- a/Source/JavaScriptCore/bytecode/CodeBlock.h +++ b/Source/JavaScriptCore/bytecode/CodeBlock.h @@ -163,7 +163,8 @@ namespace JSC { static void dumpStatistics(); - void dump(ExecState*); + void dump(); + void dump(unsigned bytecodeOffset); void printStructures(const Instruction*); void printStructure(const char* name, const Instruction*, int operand); @@ -245,6 +246,7 @@ namespace JSC { CallLinkInfo& getCallLinkInfo(unsigned bytecodeIndex) { + ASSERT(JITCode::isBaselineCode(getJITType())); return *(binarySearch(m_callLinkInfos.begin(), m_callLinkInfos.size(), bytecodeIndex)); } #endif // ENABLE(JIT) @@ -274,6 +276,11 @@ namespace JSC { { m_incomingCalls.push(incoming); } + + bool isIncomingCallAlreadyLinked(CallLinkInfo* incoming) + { + return m_incomingCalls.isOnList(incoming); + } #endif // ENABLE(JIT) #if ENABLE(LLINT) @@ -755,6 +762,13 @@ namespace JSC { } ArrayProfile* getArrayProfile(unsigned bytecodeOffset); ArrayProfile* getOrAddArrayProfile(unsigned bytecodeOffset); + + unsigned numberOfArrayAllocationProfiles() const { return m_arrayAllocationProfiles.size(); } + ArrayAllocationProfile* addArrayAllocationProfile() + { + m_arrayAllocationProfiles.append(ArrayAllocationProfile()); + return &m_arrayAllocationProfiles.last(); + } #endif // Exception handling support @@ -806,17 +820,7 @@ namespace JSC { return m_rareData && !!m_rareData->m_codeOrigins.size(); } - bool codeOriginForReturn(ReturnAddressPtr returnAddress, CodeOrigin& codeOrigin) - { - if (!hasCodeOrigins()) - return false; - unsigned offset = getJITCode().offsetOf(returnAddress.value()); - CodeOriginAtCallReturnOffset* entry = binarySearch(codeOrigins().begin(), codeOrigins().size(), offset, WTF::KeyMustNotBePresentInArray); - if (entry->callReturnOffset != offset) - return false; - codeOrigin = entry->codeOrigin; - return true; - } + bool codeOriginForReturn(ReturnAddressPtr, CodeOrigin&); CodeOrigin codeOrigin(unsigned index) { @@ -1145,9 +1149,13 @@ namespace JSC { #if ENABLE(VALUE_PROFILER) bool shouldOptimizeNow(); + void updateAllValueProfilePredictions(OperationInProgress = NoOperation); + void updateAllArrayPredictions(OperationInProgress = NoOperation); void updateAllPredictions(OperationInProgress = NoOperation); #else bool shouldOptimizeNow() { return false; } + void updateAllValueProfilePredictions(OperationInProgress = NoOperation) { } + void updateAllArrayPredictions(OperationInProgress = NoOperation) { } void updateAllPredictions(OperationInProgress = NoOperation) { } #endif @@ -1176,6 +1184,10 @@ namespace JSC { private: friend class DFGCodeBlocks; + +#if ENABLE(JIT) + ClosureCallStubRoutine* findClosureCallForReturnPC(ReturnAddressPtr); +#endif #if ENABLE(DFG_JIT) void tallyFrequentExitSites(); @@ -1200,17 +1212,17 @@ namespace JSC { m_constantRegisters[i].set(*m_globalData, ownerExecutable(), constants[i].get()); } - void dump(ExecState*, const Vector::const_iterator& begin, Vector::const_iterator&); + void dump(ExecState*, const Instruction* begin, const Instruction*&); CString registerName(ExecState*, int r) const; - void printUnaryOp(ExecState*, int location, Vector::const_iterator&, const char* op); - void printBinaryOp(ExecState*, int location, Vector::const_iterator&, const char* op); - void printConditionalJump(ExecState*, const Vector::const_iterator&, Vector::const_iterator&, int location, const char* op); - void printGetByIdOp(ExecState*, int location, Vector::const_iterator&); + void printUnaryOp(ExecState*, int location, const Instruction*&, const char* op); + void printBinaryOp(ExecState*, int location, const Instruction*&, const char* op); + void printConditionalJump(ExecState*, const Instruction*, const Instruction*&, int location, const char* op); + void printGetByIdOp(ExecState*, int location, const Instruction*&); void printGetByIdCacheStatus(ExecState*, int location); enum CacheDumpMode { DumpCaches, DontDumpCaches }; - void printCallOp(ExecState*, int location, Vector::const_iterator&, const char* op, CacheDumpMode); - void printPutByIdOp(ExecState*, int location, Vector::const_iterator&, const char* op); + void printCallOp(ExecState*, int location, const Instruction*&, const char* op, CacheDumpMode); + void printPutByIdOp(ExecState*, int location, const Instruction*&, const char* op); void visitStructures(SlotVisitor&, Instruction* vPC); #if ENABLE(DFG_JIT) @@ -1228,6 +1240,9 @@ namespace JSC { // allow them to continue to execute soundly. if (m_dfgData->mayBeExecuting) return true; + + if (Options::forceDFGCodeBlockLiveness()) + return true; return false; } @@ -1330,6 +1345,7 @@ namespace JSC { SegmentedVector m_valueProfiles; SegmentedVector m_rareCaseProfiles; SegmentedVector m_specialFastCaseProfiles; + SegmentedVector m_arrayAllocationProfiles; ArrayProfileVector m_arrayProfiles; unsigned m_executionEntryCount; #endif -- cgit v1.2.1