Ignore:
Timestamp:
Jun 16, 2017, 2:02:37 PM (8 years ago)
Author:
[email protected]
Message:

Interpreter methods for mapping between Opcode and OpcodeID need not be instance methods.
https://bugs.webkit.org/show_bug.cgi?id=173491

Reviewed by Keith Miller.

The implementation are based on static data. There's no need to get the
interpreter instance. Hence, we can make these methods static and avoid doing
unnecessary work to compute the interpreter this pointer.

Also removed the unused isCallBytecode method.

  • bytecode/BytecodeBasicBlock.cpp:

(JSC::BytecodeBasicBlock::computeImpl):

  • bytecode/BytecodeDumper.cpp:

(JSC::BytecodeDumper<Block>::printGetByIdOp):
(JSC::BytecodeDumper<Block>::printGetByIdCacheStatus):
(JSC::BytecodeDumper<Block>::dumpBytecode):
(JSC::BytecodeDumper<Block>::dumpBlock):

  • bytecode/BytecodeLivenessAnalysis.cpp:

(JSC::BytecodeLivenessAnalysis::dumpResults):

  • bytecode/BytecodeLivenessAnalysisInlines.h:

(JSC::BytecodeLivenessPropagation<DerivedAnalysis>::stepOverInstruction):

  • bytecode/BytecodeRewriter.cpp:

(JSC::BytecodeRewriter::adjustJumpTargetsInFragment):

  • bytecode/CallLinkStatus.cpp:

(JSC::CallLinkStatus::computeFromLLInt):

  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::finishCreation):
(JSC::CodeBlock::propagateTransitions):
(JSC::CodeBlock::finalizeLLIntInlineCaches):
(JSC::CodeBlock::hasOpDebugForLineAndColumn):
(JSC::CodeBlock::usesOpcode):
(JSC::CodeBlock::valueProfileForBytecodeOffset):
(JSC::CodeBlock::arithProfileForPC):
(JSC::CodeBlock::insertBasicBlockBoundariesForControlFlowProfiler):

  • bytecode/PreciseJumpTargets.cpp:

(JSC::getJumpTargetsForBytecodeOffset):
(JSC::computePreciseJumpTargetsInternal):
(JSC::findJumpTargetsForBytecodeOffset):

  • bytecode/PreciseJumpTargetsInlines.h:

(JSC::extractStoredJumpTargetsForBytecodeOffset):

  • bytecode/UnlinkedCodeBlock.cpp:

(JSC::UnlinkedCodeBlock::applyModification):

  • dfg/DFGByteCodeParser.cpp:

(JSC::DFG::ByteCodeParser::getPredictionWithoutOSRExit):
(JSC::DFG::ByteCodeParser::parseBlock):

  • dfg/DFGCapabilities.cpp:

(JSC::DFG::capabilityLevel):

  • interpreter/Interpreter.cpp:

(JSC::Interpreter::Interpreter):
(JSC::Interpreter::isOpcode):
(): Deleted.

  • interpreter/Interpreter.h:

(JSC::Interpreter::getOpcode): Deleted.
(JSC::Interpreter::getOpcodeID): Deleted.
(JSC::Interpreter::isCallBytecode): Deleted.

  • interpreter/InterpreterInlines.h:

(JSC::Interpreter::getOpcode):
(JSC::Interpreter::getOpcodeID):

  • jit/JIT.cpp:

(JSC::JIT::privateCompileMainPass):
(JSC::JIT::privateCompileSlowCases):

  • jit/JITOpcodes.cpp:

(JSC::JIT::emitNewFuncCommon):
(JSC::JIT::emitNewFuncExprCommon):

  • jit/JITPropertyAccess.cpp:

(JSC::JIT::emitSlow_op_put_by_val):
(JSC::JIT::privateCompilePutByVal):

  • jit/JITPropertyAccess32_64.cpp:

(JSC::JIT::emitSlow_op_put_by_val):

  • llint/LLIntSlowPaths.cpp:

(JSC::LLInt::llint_trace_operand):
(JSC::LLInt::llint_trace_value):
(JSC::LLInt::LLINT_SLOW_PATH_DECL):

  • profiler/ProfilerBytecodeSequence.cpp:

(JSC::Profiler::BytecodeSequence::BytecodeSequence):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/profiler/ProfilerBytecodeSequence.cpp

    r208968 r218412  
    11/*
    2  * Copyright (C) 2012-2014, 2016 Apple Inc. All rights reserved.
     2 * Copyright (C) 2012-2017 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2828
    2929#include "CodeBlock.h"
    30 #include "Interpreter.h"
     30#include "InterpreterInlines.h"
    3131#include "JSCInlines.h"
    3232#include "JSGlobalObject.h"
     
    5656        out.reset();
    5757        codeBlock->dumpBytecode(out, bytecodeIndex, stubInfos);
    58         m_sequence.append(Bytecode(bytecodeIndex, codeBlock->vm()->interpreter->getOpcodeID(codeBlock->instructions()[bytecodeIndex].u.opcode), out.toCString()));
    59         bytecodeIndex += opcodeLength(
    60             codeBlock->vm()->interpreter->getOpcodeID(
    61                 codeBlock->instructions()[bytecodeIndex].u.opcode));
     58        OpcodeID opcodeID = Interpreter::getOpcodeID(codeBlock->instructions()[bytecodeIndex].u.opcode);
     59        m_sequence.append(Bytecode(bytecodeIndex, opcodeID, out.toCString()));
     60        bytecodeIndex += opcodeLength(opcodeID);
    6261    }
    6362}
Note: See TracChangeset for help on using the changeset viewer.