Changeset 37450 in webkit
- Timestamp:
- Oct 9, 2008 2:47:31 PM (16 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r37446 r37450 1 2008-10-09 Cameron Zwarich <zwarich@apple.com> 2 3 Reviewed by Oliver Hunt. 4 5 Bug 21459: REGRESSION (r37324): Safari crashes inside JavaScriptCore while browsing hulu.com 6 <https://bugs.webkit.org/show_bug.cgi?id=21459> 7 8 After r37324, an Arguments object does not mark an associated activation 9 object. This change was made because Arguments no longer directly used 10 the activation object in any way. However, if an activation is torn off, 11 then the backing store of Arguments becomes the register array of the 12 activation object. Arguments directly marks all of the arguments, but 13 the activation object is being collected, which causes its register 14 array to be freed and new memory to be allocated in its place. 15 16 Unfortunately, it does not seem possible to reproduce this issue in a 17 layout test. 18 19 * kjs/Arguments.cpp: 20 (JSC::Arguments::mark): 21 * kjs/Arguments.h: 22 (JSC::Arguments::setActivation): 23 (JSC::Arguments::Arguments): 24 (JSC::JSActivation::copyRegisters): 25 1 26 2008-10-09 Ariya Hidayat <ariya.hidayat@trolltech.com> 2 27 -
trunk/JavaScriptCore/kjs/Arguments.cpp
r37324 r37450 65 65 if (!d->callee->marked()) 66 66 d->callee->mark(); 67 68 if (d->activation && !d->activation->marked()) 69 d->activation->mark(); 67 70 } 68 71 -
trunk/JavaScriptCore/kjs/Arguments.h
r37433 r37450 33 33 34 34 struct ArgumentsData : Noncopyable { 35 JSActivation* activation; 36 35 37 unsigned numParameters; 36 38 ptrdiff_t firstParameterIndex; … … 63 65 void copyRegisters(); 64 66 bool isTornOff() const { return d->registerArray; } 65 void setRegisters(Register* registers) { d->registers = registers; } 67 void setActivation(JSActivation* activation) 68 { 69 d->activation = activation; 70 d->registers = &activation->registerAt(0); 71 } 66 72 67 73 private: … … 94 100 d->numArguments = numArguments; 95 101 102 d->activation = 0; 96 103 d->registers = callFrame->registers(); 97 104 … … 150 157 setRegisters(registerArray + registerOffset, registerArray); 151 158 if (arguments && !arguments->isTornOff()) 152 static_cast<Arguments*>(arguments)->set Registers(registerArray + registerOffset);159 static_cast<Arguments*>(arguments)->setActivation(this); 153 160 } 154 161
Note: See TracChangeset
for help on using the changeset viewer.