Changeset 39752 in webkit for trunk/JavaScriptCore/bytecode/CodeBlock.h
- Timestamp:
- Jan 9, 2009, 10:47:37 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/bytecode/CodeBlock.h
r39737 r39752 67 67 struct JITCodeRef { 68 68 void* code; 69 #ifndef NDEBUG 70 unsigned codeSize; 71 #endif 69 72 RefPtr<ExecutablePool> executablePool; 70 73 71 74 JITCodeRef() 72 75 : code(0) 76 #ifndef NDEBUG 77 , codeSize(0) 78 #endif 73 79 { 74 80 } … … 76 82 JITCodeRef(void* code, PassRefPtr<ExecutablePool> executablePool) 77 83 : code(code) 84 #ifndef NDEBUG 85 , codeSize(0) 86 #endif 78 87 , executablePool(executablePool) 79 88 { … … 141 150 142 151 struct GlobalResolveInfo { 143 GlobalResolveInfo( )152 GlobalResolveInfo(unsigned bytecodeOffset) 144 153 : structure(0) 145 154 , offset(0) 155 , bytecodeOffset(bytecodeOffset) 146 156 { 147 157 } … … 149 159 Structure* structure; 150 160 unsigned offset; 161 unsigned bytecodeOffset; 151 162 }; 152 163 … … 298 309 } 299 310 300 unsigned getBytecodeIndex(void* nativePC) 301 { 311 unsigned getBytecodeIndex(CallFrame* callFrame, void* nativePC) 312 { 313 reparseForExceptionInfoIfNecessary(callFrame); 302 314 ptrdiff_t nativePCOffset = reinterpret_cast<void**>(nativePC) - reinterpret_cast<void**>(m_jitCode.code); 303 return binaryChop<PC, ptrdiff_t, getNativePCOffset>(m_ pcVector.begin(),m_pcVector.size(), nativePCOffset)->bytecodeIndex;315 return binaryChop<PC, ptrdiff_t, getNativePCOffset>(m_exceptionInfo->m_pcVector.begin(), m_exceptionInfo->m_pcVector.size(), nativePCOffset)->bytecodeIndex; 304 316 } 305 317 … … 344 356 #if !ENABLE(JIT) 345 357 void addPropertyAccessInstruction(unsigned propertyAccessInstruction) { m_propertyAccessInstructions.append(propertyAccessInstruction); } 346 void addGlobalResolveInstruction(unsigned globalResolveInstructions) { m_globalResolveInstructions.append(globalResolveInstructions); } 358 void addGlobalResolveInstruction(unsigned globalResolveInstruction) { m_globalResolveInstructions.append(globalResolveInstruction); } 359 bool hasGlobalResolveInstructionAtBytecodeOffset(unsigned bytecodeOffset); 347 360 #else 348 361 size_t numberOfStructureStubInfos() const { return m_structureStubInfos.size(); } … … 350 363 StructureStubInfo& structureStubInfo(int index) { return m_structureStubInfos[index]; } 351 364 352 void addGlobalResolveInfo( ) { m_globalResolveInfos.append(GlobalResolveInfo()); }365 void addGlobalResolveInfo(unsigned globalResolveInstruction) { m_globalResolveInfos.append(GlobalResolveInfo(globalResolveInstruction)); } 353 366 GlobalResolveInfo& globalResolveInfo(int index) { return m_globalResolveInfos[index]; } 367 bool hasGlobalResolveInfoAtBytecodeOffset(unsigned bytecodeOffset); 354 368 355 369 size_t numberOfCallLinkInfos() const { return m_callLinkInfos.size(); } … … 358 372 359 373 void addFunctionRegisterInfo(unsigned bytecodeOffset, int functionIndex) { createRareDataIfNecessary(); m_rareData->m_functionRegisterInfos.append(FunctionRegisterInfo(bytecodeOffset, functionIndex)); } 360 361 Vector<PC>& pcVector() { return m_pcVector; }362 374 #endif 363 375 … … 368 380 HandlerInfo& exceptionHandler(int index) { ASSERT(m_rareData); return m_rareData->m_exceptionHandlers[index]; } 369 381 382 bool hasExceptionInfo() const { return m_exceptionInfo; } 370 383 void clearExceptionInfo() { m_exceptionInfo.clear(); } 371 384 … … 376 389 void addLineInfo(const LineInfo& lineInfo) { ASSERT(m_exceptionInfo); m_exceptionInfo->m_lineInfo.append(lineInfo); } 377 390 LineInfo& lastLineInfo() { ASSERT(m_exceptionInfo); return m_exceptionInfo->m_lineInfo.last(); } 391 392 #if ENABLE(JIT) 393 Vector<PC>& pcVector() { ASSERT(m_exceptionInfo); return m_exceptionInfo->m_pcVector; } 394 #endif 378 395 379 396 // Constant Pool … … 475 492 Vector<CallLinkInfo> m_callLinkInfos; 476 493 Vector<CallLinkInfo*> m_linkedCallerList; 477 478 Vector<PC> m_pcVector;479 494 #endif 480 495 … … 492 507 Vector<LineInfo> m_lineInfo; 493 508 Vector<GetByIdExceptionInfo> m_getByIdExceptionInfo; 509 510 #if ENABLE(JIT) 511 Vector<PC> m_pcVector; 512 #endif 494 513 }; 495 514 OwnPtr<ExceptionInfo> m_exceptionInfo; … … 543 562 class EvalCodeBlock : public ProgramCodeBlock { 544 563 public: 545 EvalCodeBlock(ScopeNode* ownerNode, JSGlobalObject* globalObject, PassRefPtr<SourceProvider> sourceProvider )564 EvalCodeBlock(ScopeNode* ownerNode, JSGlobalObject* globalObject, PassRefPtr<SourceProvider> sourceProvider, int baseScopeDepth) 546 565 : ProgramCodeBlock(ownerNode, EvalCode, globalObject, sourceProvider) 547 { 548 } 566 , m_baseScopeDepth(baseScopeDepth) 567 { 568 } 569 570 int baseScopeDepth() const { return m_baseScopeDepth; } 571 572 private: 573 int m_baseScopeDepth; 549 574 }; 550 575
Note:
See TracChangeset
for help on using the changeset viewer.