Changeset 182050 in webkit
- Timestamp:
- Mar 26, 2015, 7:55:57 PM (10 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r182047 r182050 1 2015-03-26 Joseph Pecoraro <pecoraro@apple.com> 2 3 WebContent Crash when instantiating class with Type Profiling enabled 4 https://bugs.webkit.org/show_bug.cgi?id=143037 5 6 Reviewed by Ryosuke Niwa. 7 8 * bytecompiler/BytecodeGenerator.h: 9 * bytecompiler/BytecodeGenerator.cpp: 10 (JSC::BytecodeGenerator::BytecodeGenerator): 11 (JSC::BytecodeGenerator::emitMoveEmptyValue): 12 We cannot profile the type of an uninitialized empty JSValue. 13 Nor do we expect this to be necessary, since it is effectively 14 an unseen undefined value. So add a way to put the empty value 15 without profiling. 16 17 (JSC::BytecodeGenerator::emitMove): 18 Add an assert to try to catch this issue early on, and force 19 callers to explicitly use emitMoveEmptyValue instead. 20 21 * tests/typeProfiler/classes.js: Added. 22 (wrapper.Base): 23 (wrapper.Derived): 24 (wrapper): 25 Add test coverage both for this case and classes in general. 26 1 27 2015-03-26 Joseph Pecoraro <pecoraro@apple.com> 2 28 -
trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
r181993 r182050 474 474 m_newTargetRegister = addVar(); 475 475 emitMove(m_newTargetRegister, &m_thisRegister); 476 emitMove (&m_thisRegister, addConstantEmptyValue());476 emitMoveEmptyValue(&m_thisRegister); 477 477 } else 478 478 emitCreateThis(&m_thisRegister); … … 993 993 } 994 994 995 RegisterID* BytecodeGenerator::emitMoveEmptyValue(RegisterID* dst) 996 { 997 RefPtr<RegisterID> emptyValue = addConstantEmptyValue(); 998 999 emitOpcode(op_mov); 1000 instructions().append(dst->index()); 1001 instructions().append(emptyValue->index()); 1002 return dst; 1003 } 1004 995 1005 RegisterID* BytecodeGenerator::emitMove(RegisterID* dst, RegisterID* src) 996 1006 { 1007 ASSERT(src != m_emptyValueRegister); 1008 997 1009 m_staticPropertyAnalyzer.mov(dst->index(), src->index()); 998 1010 emitOpcode(op_mov); -
trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h
r181993 r182050 457 457 RegisterID* emitNewRegExp(RegisterID* dst, RegExp*); 458 458 459 RegisterID* emitMoveEmptyValue(RegisterID* dst); 459 460 RegisterID* emitMove(RegisterID* dst, RegisterID* src); 460 461
Note:
See TracChangeset
for help on using the changeset viewer.