Ignore:
Timestamp:
Jun 28, 2008, 8:50:49 AM (17 years ago)
Author:
Darin Adler
Message:

2008-06-28 Darin Adler <Darin Adler>

Reviewed by Oliver.

SunSpider says 0.8% faster.

  • VM/CodeBlock.cpp: (KJS::CodeBlock::dump): Added argv and argc parameters to new_array.
  • VM/Machine.cpp: (KJS::Machine::privateExecute): Ditto.
  • VM/CodeGenerator.cpp: (KJS::CodeGenerator::emitNewArray): Added.
  • VM/CodeGenerator.h: Added ElementNode* argument to emitNewArray.
  • kjs/nodes.cpp: (KJS::ArrayNode::emitCode): Pass the ElementNode to emitNewArray so it can be initialized with as many elements as possible. If the array doesn't have any holes in it, that's all that's needed. If there are holes, then emit some separate put operations for the other values in the array and for the length as needed.
  • kjs/nodes.h: Added some accessors to ElementNode so the code generator can iterate through elements and generate code to evaluate them. Now ArrayNode does not need to be a friend. Also took out some unused PlacementNewAdoptType constructors.
File:
1 edited

Legend:

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

    r34838 r34851  
    200200
    201201        RegisterID* emitNewObject(RegisterID* dst) { return emitNullaryOp(op_new_object, dst); }
    202         RegisterID* emitNewArray(RegisterID* dst) { return emitNullaryOp(op_new_array, dst); }
     202        RegisterID* emitNewArray(RegisterID* dst, ElementNode*); // stops at first elision
    203203
    204204        RegisterID* emitNewFunction(RegisterID* dst, FuncDeclNode* func);
Note: See TracChangeset for help on using the changeset viewer.