Changeset 39737 in webkit for trunk/JavaScriptCore/bytecompiler
- Timestamp:
- Jan 8, 2009, 9:41:01 PM (16 years ago)
- Location:
- trunk/JavaScriptCore/bytecompiler
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
r39720 r39737 116 116 117 117 #ifndef NDEBUG 118 static bools_dumpsGeneratedCode = false;118 bool BytecodeGenerator::s_dumpsGeneratedCode = false; 119 119 #endif 120 120 … … 212 212 : m_shouldEmitDebugHooks(!!debugger) 213 213 , m_shouldEmitProfileHooks(scopeChain.globalObject()->supportsProfiling()) 214 , m_regeneratingForExceptionInfo(false) 214 215 , m_scopeChain(&scopeChain) 215 216 , m_symbolTable(symbolTable) … … 225 226 , m_lastOpcodeID(op_end) 226 227 , m_emitNodeDepth(0) 227 , m_regeneratingForExceptionInfo(false)228 , m_codeBlockBeingRegeneratedFrom(0)229 228 { 230 229 if (m_shouldEmitDebugHooks) … … 296 295 : m_shouldEmitDebugHooks(!!debugger) 297 296 , m_shouldEmitProfileHooks(scopeChain.globalObject()->supportsProfiling()) 297 , m_regeneratingForExceptionInfo(false) 298 298 , m_scopeChain(&scopeChain) 299 299 , m_symbolTable(symbolTable) … … 307 307 , m_lastOpcodeID(op_end) 308 308 , m_emitNodeDepth(0) 309 , m_regeneratingForExceptionInfo(false)310 , m_codeBlockBeingRegeneratedFrom(0)311 309 { 312 310 if (m_shouldEmitDebugHooks) … … 369 367 : m_shouldEmitDebugHooks(!!debugger) 370 368 , m_shouldEmitProfileHooks(scopeChain.globalObject()->supportsProfiling()) 369 , m_regeneratingForExceptionInfo(false) 371 370 , m_scopeChain(&scopeChain) 372 371 , m_symbolTable(symbolTable) … … 376 375 , m_finallyDepth(0) 377 376 , m_dynamicScopeDepth(0) 378 , m_baseScopeDepth( codeBlock->baseScopeDepth())377 , m_baseScopeDepth(scopeChain.localDepth()) 379 378 , m_codeType(EvalCode) 380 379 , m_globalData(&scopeChain.globalObject()->globalExec()->globalData()) 381 380 , m_lastOpcodeID(op_end) 382 381 , m_emitNodeDepth(0) 383 , m_regeneratingForExceptionInfo(false)384 , m_codeBlockBeingRegeneratedFrom(0)385 382 { 386 383 if (m_shouldEmitDebugHooks || m_baseScopeDepth) … … 995 992 } 996 993 994 if (index != missingSymbolMarker()) { 995 // Directly index the property lookup across multiple scopes. Yay! 996 return emitGetScopedVar(dst, depth, index, globalObject); 997 } 998 997 999 if (globalObject) { 998 bool forceGlobalResolve = false;999 if (m_regeneratingForExceptionInfo) {1000 1000 #if ENABLE(JIT) 1001 forceGlobalResolve = m_codeBlockBeingRegeneratedFrom->hasGlobalResolveInfoAtBytecodeOffset(instructions().size()); 1002 #else 1003 forceGlobalResolve = m_codeBlockBeingRegeneratedFrom->hasGlobalResolveInstructionAtBytecodeOffset(instructions().size()); 1004 #endif 1005 } 1006 1007 if (index != missingSymbolMarker() && !forceGlobalResolve) { 1008 // Directly index the property lookup across multiple scopes. 1009 return emitGetScopedVar(dst, depth, index, globalObject); 1010 } 1011 1012 #if ENABLE(JIT) 1013 m_codeBlock->addGlobalResolveInfo(instructions().size()); 1001 m_codeBlock->addGlobalResolveInfo(); 1014 1002 #else 1015 1003 m_codeBlock->addGlobalResolveInstruction(instructions().size()); … … 1024 1012 } 1025 1013 1026 if (index != missingSymbolMarker()) {1027 // Directly index the property lookup across multiple scopes.1028 return emitGetScopedVar(dst, depth, index, globalObject);1029 }1030 1031 1014 // In this case we are at least able to drop a few scope chains from the 1032 1015 // lookup chain, although we still need to hash from then on. … … 1041 1024 { 1042 1025 if (globalObject) { 1026 // op_get_global_var must be the same length as op_resolve_global. 1043 1027 emitOpcode(op_get_global_var); 1044 1028 instructions().append(dst->index()); 1045 1029 instructions().append(asCell(globalObject)); 1046 1030 instructions().append(index); 1031 instructions().append(0); 1032 instructions().append(0); 1047 1033 return dst; 1048 1034 } -
trunk/JavaScriptCore/bytecompiler/BytecodeGenerator.h
r39720 r39737 330 330 CodeType codeType() const { return m_codeType; } 331 331 332 void setRegeneratingForExceptionInfo(CodeBlock* originalCodeBlock) 333 { 334 m_regeneratingForExceptionInfo = true; 335 m_codeBlockBeingRegeneratedFrom = originalCodeBlock; 336 } 332 void setRegeneratingForExceptionInfo() { m_regeneratingForExceptionInfo = true; } 337 333 338 334 private: … … 426 422 bool m_shouldEmitDebugHooks; 427 423 bool m_shouldEmitProfileHooks; 424 425 bool m_regeneratingForExceptionInfo; 428 426 429 427 const ScopeChain* m_scopeChain; … … 468 466 OpcodeID m_lastOpcodeID; 469 467 468 #ifndef NDEBUG 469 static bool s_dumpsGeneratedCode; 470 #endif 471 470 472 unsigned m_emitNodeDepth; 471 472 bool m_regeneratingForExceptionInfo;473 CodeBlock* m_codeBlockBeingRegeneratedFrom;474 473 475 474 static const unsigned s_maxEmitNodeDepth = 10000;
Note:
See TracChangeset
for help on using the changeset viewer.