Changeset 288885 in webkit for trunk/Source/JavaScriptCore/runtime/VM.cpp
- Timestamp:
- Feb 1, 2022, 9:33:58 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/runtime/VM.cpp
r288537 r288885 1 1 /* 2 * Copyright (C) 2008-202 1Apple Inc. All rights reserved.2 * Copyright (C) 2008-2022 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 243 243 244 244 interpreter = new Interpreter(*this); 245 StackBounds stack = Thread::current().stack();246 245 updateSoftReservedZoneSize(Options::softReservedZoneSize()); 247 setLastStackTop( stack.origin());246 setLastStackTop(Thread::current()); 248 247 249 248 JSRunLoopTimer::Manager::shared().registerVM(*this); … … 504 503 } 505 504 506 void VM::setLastStackTop(void* lastStackTop) 507 { 508 m_lastStackTop = lastStackTop; 505 void VM::setLastStackTop(const Thread& thread) 506 { 507 m_lastStackTop = thread.savedLastStackTop(); 508 auto& stack = thread.stack(); 509 RELEASE_ASSERT(stack.contains(m_lastStackTop), 0x5510, m_lastStackTop, stack.origin(), stack.end()); 509 510 } 510 511 … … 1051 1052 } 1052 1053 1053 void logSanitizeStack(VM& vm) 1054 { 1055 if (Options::verboseSanitizeStack() && vm.topCallFrame) { 1056 int dummy; 1054 static void logSanitizeStack(VM& vm) 1055 { 1056 if (UNLIKELY(Options::verboseSanitizeStack())) { 1057 1057 auto& stackBounds = Thread::current().stack(); 1058 dataLog( 1059 "Sanitizing stack for VM = ", RawPointer(&vm), " with top call frame at ", RawPointer(vm.topCallFrame), 1060 ", current stack pointer at ", RawPointer(&dummy), ", in ", 1061 pointerDump(vm.topCallFrame->codeBlock()), ", last code origin = ", 1062 vm.topCallFrame->codeOrigin(), ", last stack top = ", RawPointer(vm.lastStackTop()), ", in stack range [", RawPointer(stackBounds.origin()), ", ", RawPointer(stackBounds.end()), "]\n"); 1058 dataLogLn("Sanitizing stack for VM = ", RawPointer(&vm), ", current stack pointer at ", RawPointer(currentStackPointer()), ", last stack top = ", RawPointer(vm.lastStackTop()), ", in stack range (", RawPointer(stackBounds.end()), ", ", RawPointer(stackBounds.origin()), "]"); 1063 1059 } 1064 1060 } … … 1271 1267 void sanitizeStackForVM(VM& vm) 1272 1268 { 1269 auto& thread = Thread::current(); 1270 auto& stack = thread.stack(); 1271 if (!vm.currentThreadIsHoldingAPILock()) 1272 return; // vm.lastStackTop() may not be set up correctly if JSLock is not held. 1273 1273 1274 logSanitizeStack(vm); 1274 if (vm.topCallFrame) { 1275 auto& stackBounds = Thread::current().stack(); 1276 ASSERT(vm.currentThreadIsHoldingAPILock()); 1277 ASSERT_UNUSED(stackBounds, stackBounds.contains(vm.lastStackTop())); 1278 } 1275 1276 RELEASE_ASSERT(stack.contains(vm.lastStackTop()), 0xaa10, vm.lastStackTop(), stack.origin(), stack.end()); 1279 1277 #if ENABLE(C_LOOP) 1280 1278 vm.interpreter->cloopStack().sanitizeStack(); … … 1282 1280 sanitizeStackForVMImpl(&vm); 1283 1281 #endif 1282 RELEASE_ASSERT(stack.contains(vm.lastStackTop()), 0xaa20, vm.lastStackTop(), stack.origin(), stack.end()); 1284 1283 } 1285 1284
Note:
See TracChangeset
for help on using the changeset viewer.