Changeset 39737 in webkit for trunk/JavaScriptCore/bytecode/CodeBlock.cpp
- Timestamp:
- Jan 8, 2009, 9:41:01 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/bytecode/CodeBlock.cpp
r39720 r39737 725 725 } 726 726 case op_get_global_var: { 727 int r0 = (++it)->u.operand;728 JSValuePtr scope = JSValuePtr( (++it)->u.jsCell);729 int index = (++it)->u.operand;727 int r0 = it[1].u.operand; 728 JSValuePtr scope = JSValuePtr(it[2].u.jsCell); 729 int index = it[3].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); 731 732 break; 732 733 } … … 1091 1092 macro(identifiers) \ 1092 1093 macro(functionExpressions) \ 1093 macro(constantRegisters) 1094 macro(constantRegisters) \ 1095 macro(pcVector) 1094 1096 1095 1097 #define FOR_EACH_MEMBER_VECTOR_RARE_DATA(macro) \ … … 1106 1108 macro(expressionInfo) \ 1107 1109 macro(lineInfo) \ 1108 macro(getByIdExceptionInfo) \ 1109 macro(pcVector) 1110 macro(getByIdExceptionInfo) 1110 1111 1111 1112 template<typename T> … … 1392 1393 1393 1394 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 }1405 1395 1406 1396 switch (m_codeType) { … … 1409 1399 RefPtr<FunctionBodyNode> newFunctionBody = m_globalData->parser->reparse<FunctionBodyNode>(m_globalData, ownerFunctionBodyNode); 1410 1400 newFunctionBody->finishParsing(ownerFunctionBodyNode->copyParameters(), ownerFunctionBodyNode->parameterCount()); 1411 CodeBlock& newCodeBlock = newFunctionBody->bytecodeForExceptionInfoReparse(scopeChain , this);1401 CodeBlock& newCodeBlock = newFunctionBody->bytecodeForExceptionInfoReparse(scopeChain); 1412 1402 ASSERT(newCodeBlock.m_exceptionInfo); 1413 1403 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 #endif1419 1420 1404 m_exceptionInfo.set(newCodeBlock.m_exceptionInfo.release()); 1421 1405 break; … … 1424 1408 EvalNode* ownerEvalNode = static_cast<EvalNode*>(m_ownerNode); 1425 1409 RefPtr<EvalNode> newEvalBody = m_globalData->parser->reparse<EvalNode>(m_globalData, ownerEvalNode); 1426 EvalCodeBlock& newCodeBlock = newEvalBody->bytecodeForExceptionInfoReparse(scopeChain , this);1410 EvalCodeBlock& newCodeBlock = newEvalBody->bytecodeForExceptionInfoReparse(scopeChain); 1427 1411 ASSERT(newCodeBlock.m_exceptionInfo); 1428 1412 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 #endif1434 1435 1413 m_exceptionInfo.set(newCodeBlock.m_exceptionInfo.release()); 1436 1414 break; … … 1576 1554 return true; 1577 1555 } 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) 1556 1623 1557 void CodeBlock::setJITCode(JITCodeRef& jitCode) 1624 1558 {
Note:
See TracChangeset
for help on using the changeset viewer.