Changeset 88866 in webkit
- Timestamp:
- Jun 14, 2011 4:05:40 PM (13 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r88841 r88866 1 2011-06-14 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r88841. 4 http://trac.webkit.org/changeset/88841 5 https://bugs.webkit.org/show_bug.cgi?id=62672 6 7 Caused many tests to crash (Requested by rniwa on #webkit). 8 9 * bytecode/CodeBlock.cpp: 10 (JSC::CodeBlock::dump): 11 * bytecode/CodeBlock.h: 12 * bytecode/Opcode.h: 13 * bytecompiler/BytecodeGenerator.cpp: 14 (JSC::BytecodeGenerator::emitNewArray): 15 * bytecompiler/BytecodeGenerator.h: 16 * bytecompiler/NodesCodegen.cpp: 17 (JSC::ArrayNode::emitBytecode): 18 * interpreter/Interpreter.cpp: 19 (JSC::Interpreter::privateExecute): 20 * jit/JIT.cpp: 21 (JSC::JIT::privateCompileMainPass): 22 * jit/JIT.h: 23 * jit/JITOpcodes.cpp: 24 (JSC::JIT::emit_op_new_array): 25 * jit/JITOpcodes32_64.cpp: 26 (JSC::JIT::emit_op_new_array): 27 * jit/JITStubs.cpp: 28 * jit/JITStubs.h: 29 1 30 2011-06-14 Oliver Hunt <oliver@apple.com> 2 31 -
trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp
r88841 r88866 531 531 break; 532 532 } 533 case op_new_array_buffer: {534 int dst = (++it)->u.operand;535 int argv = (++it)->u.operand;536 int argc = (++it)->u.operand;537 printf("[%4d] new_array_buffer %s, %d, %d\n", location, registerName(exec, dst).data(), argv, argc);538 break;539 }540 533 case op_new_regexp: { 541 534 int r0 = (++it)->u.operand; -
trunk/Source/JavaScriptCore/bytecode/CodeBlock.h
r88841 r88866 457 457 RegExp* regexp(int index) const { ASSERT(m_rareData); return m_rareData->m_regexps[index].get(); } 458 458 459 unsigned addImmediateBuffer(unsigned length)460 {461 createRareDataIfNecessary();462 unsigned size = m_rareData->m_immediateBuffers.size();463 m_rareData->m_immediateBuffers.append(Vector<JSValue>(length));464 return size;465 }466 467 JSValue* immediateBuffer(unsigned index)468 {469 ASSERT(m_rareData);470 return m_rareData->m_immediateBuffers[index].data();471 }472 473 459 JSGlobalObject* globalObject() { return m_globalObject.get(); } 474 460 … … 574 560 Vector<WriteBarrier<RegExp> > m_regexps; 575 561 576 // Buffers used for large array literals577 Vector<Vector<JSValue> > m_immediateBuffers;578 579 562 // Jump Tables 580 563 Vector<SimpleJumpTable> m_immediateSwitchJumpTables; -
trunk/Source/JavaScriptCore/bytecode/Opcode.h
r88841 r88866 50 50 macro(op_new_object, 2) \ 51 51 macro(op_new_array, 4) \ 52 macro(op_new_array_buffer, 4) \53 52 macro(op_new_regexp, 3) \ 54 53 macro(op_mov, 3) \ -
trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
r88841 r88866 1542 1542 } 1543 1543 1544 unsigned BytecodeGenerator::addImmediateBuffer(unsigned length) 1545 { 1546 return m_codeBlock->addImmediateBuffer(length); 1547 } 1548 1549 RegisterID* BytecodeGenerator::emitNewArray(RegisterID* dst, ElementNode* elements, unsigned length) 1550 { 1551 #if !ASSERT_DISABLED 1552 unsigned checkLength = 0; 1553 #endif 1554 bool hadNonNumber = false; 1555 for (ElementNode* n = elements; n; n = n->next()) { 1556 #if !ASSERT_DISABLED 1557 checkLength++; 1558 #endif 1559 if (!n->value()->isNumber()) { 1560 hadNonNumber = true; 1561 break; 1562 } 1563 } 1564 if (!hadNonNumber) { 1565 ASSERT(length == checkLength); 1566 unsigned immediateBufferIndex = addImmediateBuffer(length); 1567 JSValue* immediateBuffer = m_codeBlock->immediateBuffer(immediateBufferIndex); 1568 unsigned index = 0; 1569 for (ElementNode* n = elements; n; n = n->next()) 1570 immediateBuffer[index++] = jsNumber(static_cast<NumberNode*>(n->value())->value()); 1571 emitOpcode(op_new_array_buffer); 1572 instructions().append(dst->index()); 1573 instructions().append(immediateBufferIndex); 1574 instructions().append(length); 1575 return dst; 1576 } 1577 1544 RegisterID* BytecodeGenerator::emitNewArray(RegisterID* dst, ElementNode* elements) 1545 { 1578 1546 Vector<RefPtr<RegisterID>, 16> argv; 1579 1547 for (ElementNode* n = elements; n; n = n->next()) { -
trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h
r88841 r88866 286 286 287 287 RegisterID* emitNewObject(RegisterID* dst); 288 RegisterID* emitNewArray(RegisterID* dst, ElementNode* , unsigned length); // stops at first elision288 RegisterID* emitNewArray(RegisterID* dst, ElementNode*); // stops at first elision 289 289 290 290 RegisterID* emitNewFunction(RegisterID* dst, FunctionBodyNode* body); … … 478 478 unsigned addRegExp(RegExp*); 479 479 480 unsigned addImmediateBuffer(unsigned length);481 482 480 FunctionExecutable* makeFunction(ExecState* exec, FunctionBodyNode* body) 483 481 { -
trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp
r88841 r88866 172 172 173 173 if (!firstPutElement && !m_elision) 174 return generator.emitNewArray(generator.finalDestination(dst), m_element , length);175 176 RefPtr<RegisterID> array = generator.emitNewArray(generator.tempDestination(dst), m_element , length);174 return generator.emitNewArray(generator.finalDestination(dst), m_element); 175 176 RefPtr<RegisterID> array = generator.emitNewArray(generator.tempDestination(dst), m_element); 177 177 178 178 for (ElementNode* n = firstPutElement; n; n = n->next()) { -
trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp
r88841 r88866 1552 1552 callFrame->uncheckedR(dst) = JSValue(constructArray(callFrame, args)); 1553 1553 1554 vPC += OPCODE_LENGTH(op_new_array);1555 NEXT_INSTRUCTION();1556 }1557 DEFINE_OPCODE(op_new_array_buffer) {1558 /* new_array_buffer dst(r) index(n) argCount(n)1559 1560 Constructs a new Array instance using the original1561 constructor, and puts the result in register dst.1562 The array be initialized with the values from immediateBuffer[index]1563 */1564 int dst = vPC[1].u.operand;1565 int firstArg = vPC[2].u.operand;1566 int argCount = vPC[3].u.operand;1567 ArgList args(codeBlock->immediateBuffer(firstArg), argCount);1568 callFrame->uncheckedR(dst) = JSValue(constructArray(callFrame, args));1569 1570 1554 vPC += OPCODE_LENGTH(op_new_array); 1571 1555 NEXT_INSTRUCTION(); -
trunk/Source/JavaScriptCore/jit/JIT.cpp
r88841 r88866 273 273 DEFINE_OP(op_neq_null) 274 274 DEFINE_OP(op_new_array) 275 DEFINE_OP(op_new_array_buffer)276 275 DEFINE_OP(op_new_func) 277 276 DEFINE_OP(op_new_func_exp) -
trunk/Source/JavaScriptCore/jit/JIT.h
r88841 r88866 779 779 void emit_op_neq_null(Instruction*); 780 780 void emit_op_new_array(Instruction*); 781 void emit_op_new_array_buffer(Instruction*);782 781 void emit_op_new_func(Instruction*); 783 782 void emit_op_new_func_exp(Instruction*); -
trunk/Source/JavaScriptCore/jit/JITOpcodes.cpp
r88841 r88866 580 580 } 581 581 582 void JIT::emit_op_new_array(Instruction* currentInstruction) 583 { 584 JITStubCall stubCall(this, cti_op_new_array); 585 stubCall.addArgument(Imm32(currentInstruction[2].u.operand)); 586 stubCall.addArgument(Imm32(currentInstruction[3].u.operand)); 587 stubCall.call(currentInstruction[1].u.operand); 588 } 589 582 590 void JIT::emit_op_resolve(Instruction* currentInstruction) 583 591 { … … 1727 1735 } 1728 1736 1729 void JIT::emit_op_new_array(Instruction* currentInstruction)1730 {1731 JITStubCall stubCall(this, cti_op_new_array);1732 stubCall.addArgument(Imm32(currentInstruction[2].u.operand));1733 stubCall.addArgument(Imm32(currentInstruction[3].u.operand));1734 stubCall.call(currentInstruction[1].u.operand);1735 }1736 1737 void JIT::emit_op_new_array_buffer(Instruction* currentInstruction)1738 {1739 JITStubCall stubCall(this, cti_op_new_array_buffer);1740 stubCall.addArgument(Imm32(currentInstruction[2].u.operand));1741 stubCall.addArgument(Imm32(currentInstruction[3].u.operand));1742 stubCall.call(currentInstruction[1].u.operand);1743 }1744 1745 1737 } // namespace JSC 1746 1738 -
trunk/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp
r88841 r88866 734 734 } 735 735 736 void JIT::emit_op_new_array(Instruction* currentInstruction) 737 { 738 JITStubCall stubCall(this, cti_op_new_array); 739 stubCall.addArgument(Imm32(currentInstruction[2].u.operand)); 740 stubCall.addArgument(Imm32(currentInstruction[3].u.operand)); 741 stubCall.call(currentInstruction[1].u.operand); 742 } 743 736 744 void JIT::emit_op_resolve(Instruction* currentInstruction) 737 745 { -
trunk/Source/JavaScriptCore/jit/JITStubs.cpp
r88841 r88866 2258 2258 2259 2259 ArgList argList(&stackFrame.callFrame->registers()[stackFrame.args[0].int32()], stackFrame.args[1].int32()); 2260 return constructArray(stackFrame.callFrame, argList);2261 }2262 2263 DEFINE_STUB_FUNCTION(JSObject*, op_new_array_buffer)2264 {2265 STUB_INIT_STACK_FRAME(stackFrame);2266 2267 ArgList argList(stackFrame.callFrame->codeBlock()->immediateBuffer(stackFrame.args[0].int32()), stackFrame.args[1].int32());2268 2260 return constructArray(stackFrame.callFrame, argList); 2269 2261 } -
trunk/Source/JavaScriptCore/jit/JITStubs.h
r88841 r88866 381 381 EncodedJSValue JIT_STUB cti_to_object(STUB_ARGS_DECLARATION); 382 382 JSObject* JIT_STUB cti_op_new_array(STUB_ARGS_DECLARATION); 383 JSObject* JIT_STUB cti_op_new_array_buffer(STUB_ARGS_DECLARATION);384 383 JSObject* JIT_STUB cti_op_new_func(STUB_ARGS_DECLARATION); 385 384 JSObject* JIT_STUB cti_op_new_func_exp(STUB_ARGS_DECLARATION);
Note: See TracChangeset
for help on using the changeset viewer.