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/CodeBlock.cpp

    r34842 r34851  
    3131#include "CodeBlock.h"
    3232
     33#include "JSValue.h"
    3334#include "Machine.h"
    3435#include "debugger.h"
    35 #include "JSValue.h"
    3636#include <stdio.h>
    3737
     
    218218        }
    219219        case op_new_array: {
    220             int r0 = (++it)->u.operand;
    221             printf("[%4d] new_array\t %s\n", location, registerName(r0).c_str());
     220            int dst = (++it)->u.operand;
     221            int argv = (++it)->u.operand;
     222            int argc = (++it)->u.operand;
     223            printf("[%4d] new_array\t %s, %s, %d\n", location, registerName(dst).c_str(), registerName(argv).c_str(), argc);
    222224            break;
    223225        }
Note: See TracChangeset for help on using the changeset viewer.