Changeset 39752 in webkit for trunk/JavaScriptCore/bytecode/CodeBlock.cpp
- Timestamp:
- Jan 9, 2009, 10:47:37 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/bytecode/CodeBlock.cpp
r39737 r39752 725 725 } 726 726 case op_get_global_var: { 727 int r0 = it[1].u.operand;728 JSValuePtr scope = JSValuePtr( it[2].u.jsCell);729 int index = it[3].u.operand;727 int r0 = (++it)->u.operand; 728 JSValuePtr scope = JSValuePtr((++it)->u.jsCell); 729 int index = (++it)->u.operand; 730 730 printf("[%4d] get_global_var\t %s, %s, %d\n", location, registerName(r0).c_str(), valueToSourceString(exec, scope).ascii(), index); 731 it += OPCODE_LENGTH(op_get_global_var);732 731 break; 733 732 } … … 1092 1091 macro(identifiers) \ 1093 1092 macro(functionExpressions) \ 1094 macro(constantRegisters) \ 1095 macro(pcVector) 1093 macro(constantRegisters) 1096 1094 1097 1095 #define FOR_EACH_MEMBER_VECTOR_RARE_DATA(macro) \ … … 1108 1106 macro(expressionInfo) \ 1109 1107 macro(lineInfo) \ 1110 macro(getByIdExceptionInfo) 1108 macro(getByIdExceptionInfo) \ 1109 macro(pcVector) 1111 1110 1112 1111 template<typename T> … … 1393 1392 1394 1393 ScopeChainNode* scopeChain = callFrame->scopeChain(); 1394 if (m_needsFullScopeChain) { 1395 ScopeChain sc(scopeChain); 1396 int scopeDelta = sc.localDepth(); 1397 if (m_codeType == EvalCode) 1398 scopeDelta -= static_cast<EvalCodeBlock*>(this)->baseScopeDepth(); 1399 else if (m_codeType == FunctionCode) 1400 scopeDelta++; // Compilation of function code assumes activation is not on the scope chain yet. 1401 ASSERT(scopeDelta >= 0); 1402 while (scopeDelta--) 1403 scopeChain = scopeChain->next; 1404 } 1395 1405 1396 1406 switch (m_codeType) { … … 1399 1409 RefPtr<FunctionBodyNode> newFunctionBody = m_globalData->parser->reparse<FunctionBodyNode>(m_globalData, ownerFunctionBodyNode); 1400 1410 newFunctionBody->finishParsing(ownerFunctionBodyNode->copyParameters(), ownerFunctionBodyNode->parameterCount()); 1401 CodeBlock& newCodeBlock = newFunctionBody->bytecodeForExceptionInfoReparse(scopeChain );1411 CodeBlock& newCodeBlock = newFunctionBody->bytecodeForExceptionInfoReparse(scopeChain, this); 1402 1412 ASSERT(newCodeBlock.m_exceptionInfo); 1403 1413 ASSERT(newCodeBlock.m_instructionCount == m_instructionCount); 1414 1415 #if ENABLE(JIT) 1416 JIT::compile(m_globalData, &newCodeBlock); 1417 ASSERT(newCodeBlock.m_jitCode.codeSize == m_jitCode.codeSize); 1418 #endif 1419 1404 1420 m_exceptionInfo.set(newCodeBlock.m_exceptionInfo.release()); 1405 1421 break; … … 1408 1424 EvalNode* ownerEvalNode = static_cast<EvalNode*>(m_ownerNode); 1409 1425 RefPtr<EvalNode> newEvalBody = m_globalData->parser->reparse<EvalNode>(m_globalData, ownerEvalNode); 1410 EvalCodeBlock& newCodeBlock = newEvalBody->bytecodeForExceptionInfoReparse(scopeChain );1426 EvalCodeBlock& newCodeBlock = newEvalBody->bytecodeForExceptionInfoReparse(scopeChain, this); 1411 1427 ASSERT(newCodeBlock.m_exceptionInfo); 1412 1428 ASSERT(newCodeBlock.m_instructionCount == m_instructionCount); 1429 1430 #if ENABLE(JIT) 1431 JIT::compile(m_globalData, &newCodeBlock); 1432 ASSERT(newCodeBlock.m_jitCode.codeSize == m_jitCode.codeSize); 1433 #endif 1434 1413 1435 m_exceptionInfo.set(newCodeBlock.m_exceptionInfo.release()); 1414 1436 break; … … 1554 1576 return true; 1555 1577 } 1556 1578 #endif 1579 1580 #if !ENABLE(JIT) 1581 bool CodeBlock::hasGlobalResolveInstructionAtBytecodeOffset(unsigned bytecodeOffset) 1582 { 1583 if (m_globalResolveInstructions.isEmpty()) 1584 return false; 1585 1586 int low = 0; 1587 int high = m_globalResolveInstructions.size(); 1588 while (low < high) { 1589 int mid = low + (high - low) / 2; 1590 if (m_globalResolveInstructions[mid] <= bytecodeOffset) 1591 low = mid + 1; 1592 else 1593 high = mid; 1594 } 1595 1596 if (!low || m_globalResolveInstructions[low - 1] != bytecodeOffset) 1597 return false; 1598 return true; 1599 } 1600 #else 1601 bool CodeBlock::hasGlobalResolveInfoAtBytecodeOffset(unsigned bytecodeOffset) 1602 { 1603 if (m_globalResolveInfos.isEmpty()) 1604 return false; 1605 1606 int low = 0; 1607 int high = m_globalResolveInfos.size(); 1608 while (low < high) { 1609 int mid = low + (high - low) / 2; 1610 if (m_globalResolveInfos[mid].bytecodeOffset <= bytecodeOffset) 1611 low = mid + 1; 1612 else 1613 high = mid; 1614 } 1615 1616 if (!low || m_globalResolveInfos[low - 1].bytecodeOffset != bytecodeOffset) 1617 return false; 1618 return true; 1619 } 1620 #endif 1621 1622 #if ENABLE(JIT) 1557 1623 void CodeBlock::setJITCode(JITCodeRef& jitCode) 1558 1624 {
Note:
See TracChangeset
for help on using the changeset viewer.