Ignore:
Timestamp:
May 22, 2008, 12:55:18 PM (17 years ago)
Author:
[email protected]
Message:

2008-05-22 Sam Weinig <[email protected]>

Reviewed by Oliver Hunt.

Rename register arguments for op_call, op_call_eval, op_end, and op_construct
to document what they are for.

  • VM/CodeGenerator.cpp: (KJS::CodeGenerator::emitCall): (KJS::CodeGenerator::emitCallEval): (KJS::CodeGenerator::emitEnd): (KJS::CodeGenerator::emitConstruct):
  • VM/CodeGenerator.h:
  • VM/Machine.cpp: (KJS::Machine::privateExecute):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/VM/CodeGenerator.cpp

    r33979 r34032  
    944944}
    945945
    946 RegisterID* CodeGenerator::emitCall(RegisterID* r0, RegisterID* r1, RegisterID* r2, ArgumentsNode* argumentsNode)
    947 {
    948     return emitCall(op_call, r0, r1, r2, argumentsNode);
    949 }
    950 
    951 RegisterID* CodeGenerator::emitCallEval(RegisterID* r0, RegisterID* r1, RegisterID* r2, ArgumentsNode* argumentsNode)
    952 {
    953     return emitCall(op_call_eval, r0, r1, r2, argumentsNode);
    954 }
    955 
    956 RegisterID* CodeGenerator::emitCall(OpcodeID opcodeID, RegisterID* r0, RegisterID* r1, RegisterID* r2, ArgumentsNode* argumentsNode)
     946RegisterID* CodeGenerator::emitCall(RegisterID* dst, RegisterID* func, RegisterID* base, ArgumentsNode* argumentsNode)
     947{
     948    return emitCall(op_call, dst, func, base, argumentsNode);
     949}
     950
     951RegisterID* CodeGenerator::emitCallEval(RegisterID* dst, RegisterID* func, RegisterID* base, ArgumentsNode* argumentsNode)
     952{
     953    return emitCall(op_call_eval, dst, func, base, argumentsNode);
     954}
     955
     956RegisterID* CodeGenerator::emitCall(OpcodeID opcodeID, RegisterID* dst, RegisterID* func, RegisterID* base, ArgumentsNode* argumentsNode)
    957957{
    958958    ASSERT(opcodeID == op_call || opcodeID == op_call_eval);
    959959
    960     RefPtr<RegisterID> ref1 = r1;
    961     RefPtr<RegisterID> ref2 = r2;
     960    RefPtr<RegisterID> refFunc = func;
     961    RefPtr<RegisterID> refBase = base;
    962962   
    963963    // Reserve space for call frame.
     
    975975
    976976    instructions().append(machine().getOpcode(opcodeID));
    977     instructions().append(r0->index());
    978     instructions().append(r1->index());
    979     instructions().append(r2 ? r2->index() : missingThisObjectMarker()); // We encode the "this" value in the instruction stream, to avoid an explicit instruction for copying or loading it.
     977    instructions().append(dst->index());
     978    instructions().append(func->index());
     979    instructions().append(base ? base->index() : missingThisObjectMarker()); // We encode the "this" value in the instruction stream, to avoid an explicit instruction for copying or loading it.
    980980    instructions().append(argv.size() ? argv[0]->index() : m_temporaries.size()); // argv
    981981    instructions().append(argv.size()); // argc
    982 
    983     return r0;
     982    return dst;
    984983}
    985984
     
    991990}
    992991
    993 RegisterID* CodeGenerator::emitEnd(RegisterID* r0)
     992RegisterID* CodeGenerator::emitEnd(RegisterID* dst)
    994993{
    995994    instructions().append(machine().getOpcode(op_end));
    996     instructions().append(r0->index());
    997     return r0;
    998 }
    999 
    1000 RegisterID* CodeGenerator::emitConstruct(RegisterID* r0, RegisterID* r1, ArgumentsNode* argumentsNode)
     995    instructions().append(dst->index());
     996    return dst;
     997}
     998
     999RegisterID* CodeGenerator::emitConstruct(RegisterID* dst, RegisterID* func, ArgumentsNode* argumentsNode)
    10011000{
    10021001    // Reserve space for call frame.
     
    10141013
    10151014    instructions().append(machine().getOpcode(op_construct));
    1016     instructions().append(r0->index());
    1017     instructions().append(r1->index());
     1015    instructions().append(dst->index());
     1016    instructions().append(func->index());
    10181017    instructions().append(argv.size() ? argv[0]->index() : m_temporaries.size()); // argv
    10191018    instructions().append(argv.size()); // argc
    1020     return r0;
     1019    return dst;
    10211020}
    10221021
Note: See TracChangeset for help on using the changeset viewer.