Changeset 236369 in webkit for trunk/Source/JavaScriptCore/runtime/JSString.cpp
- Timestamp:
- Sep 21, 2018, 4:18:15 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/runtime/JSString.cpp
r236296 r236369 251 251 } 252 252 253 void JSRopeString::resolveRope(ExecState* exec) const253 void JSRopeString::resolveRope(ExecState* nullOrExecForOOM) const 254 254 { 255 255 ASSERT(isRope()); … … 265 265 LChar* buffer; 266 266 if (auto newImpl = StringImpl::tryCreateUninitialized(length(), buffer)) { 267 exec->vm().heap.reportExtraMemoryAllocated(newImpl->cost());267 Heap::heap(this)->reportExtraMemoryAllocated(newImpl->cost()); 268 268 m_value = WTFMove(newImpl); 269 269 } else { 270 outOfMemory( exec);270 outOfMemory(nullOrExecForOOM); 271 271 return; 272 272 } … … 279 279 UChar* buffer; 280 280 if (auto newImpl = StringImpl::tryCreateUninitialized(length(), buffer)) { 281 exec->vm().heap.reportExtraMemoryAllocated(newImpl->cost());281 Heap::heap(this)->reportExtraMemoryAllocated(newImpl->cost()); 282 282 m_value = WTFMove(newImpl); 283 283 } else { 284 outOfMemory( exec);284 outOfMemory(nullOrExecForOOM); 285 285 return; 286 286 } … … 381 381 } 382 382 383 void JSRopeString::outOfMemory(ExecState* exec) const 384 { 385 VM& vm = exec->vm(); 386 auto scope = DECLARE_THROW_SCOPE(vm); 387 383 void JSRopeString::outOfMemory(ExecState* nullOrExecForOOM) const 384 { 388 385 clearFibers(); 389 386 ASSERT(isRope()); 390 387 ASSERT(m_value.isNull()); 391 if (exec) 392 throwOutOfMemoryError(exec, scope); 388 if (nullOrExecForOOM) { 389 VM& vm = nullOrExecForOOM->vm(); 390 auto scope = DECLARE_THROW_SCOPE(vm); 391 throwOutOfMemoryError(nullOrExecForOOM, scope); 392 } 393 393 } 394 394
Note:
See TracChangeset
for help on using the changeset viewer.