Ignore:
Timestamp:
Sep 15, 2008, 4:37:31 PM (17 years ago)
Author:
[email protected]
Message:

2008-09-15 Geoffrey Garen <[email protected]>

Reviewed by Sam Weinig.


Removed the CalledAsConstructor flag from the call frame header. Now,
we use an explicit opcode at the call site to fix up constructor results.

SunSpider says 0.4% faster.


cti_op_construct_verify is an out-of-line function call for now, but we
can fix that once StructureID holds type information like isObject.

  • VM/CTI.cpp: (JSC::CTI::privateCompileMainPass): Codegen for the new opcode.
  • VM/CodeBlock.cpp: (JSC::CodeBlock::dump):
  • VM/CodeGenerator.cpp: Codegen for the new opcode. Also... (JSC::CodeGenerator::emitCall): ... don't test for known non-zero value. (JSC::CodeGenerator::emitConstruct): ... ditto.
  • VM/Machine.cpp: No more CalledAsConstructor (JSC::Machine::privateExecute): Implementation for the new opcode. (JSC::Machine::cti_op_ret): The speedup: no need to check whether we were called as a constructor. (JSC::Machine::cti_op_construct_verify): Implementation for the new opcode.
  • VM/Machine.h:
  • VM/Opcode.h: Declare new opcode.
  • VM/RegisterFile.h: (JSC::RegisterFile::): No more CalledAsConstructor
File:
1 edited

Legend:

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

    r36427 r36463  
    10811081    instructions().append(func->index());
    10821082    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.
    1083     instructions().append(argv.size() ? argv[0]->index() : m_temporaries.size()); // argv
     1083    instructions().append(argv[0]->index()); // argv
    10841084    instructions().append(argv.size()); // argc
    10851085    return dst;
     
    11251125    instructions().append(func->index());
    11261126    instructions().append(funcProto->index());
    1127     instructions().append(argv.size() ? argv[0]->index() : m_temporaries.size()); // argv
     1127    instructions().append(argv[0]->index()); // argv
    11281128    instructions().append(argv.size()); // argc
     1129   
     1130    emitOpcode(op_construct_verify);
     1131    instructions().append(dst->index());
     1132    instructions().append(argv[0]->index());
     1133
    11291134    return dst;
    11301135}
Note: See TracChangeset for help on using the changeset viewer.