Changeset 242100 in webkit
- Timestamp:
- Feb 26, 2019, 12:49:50 PM (6 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/API/JSCallbackObject.h
r239557 r242100 1 1 /* 2 * Copyright (C) 2006-201 8Apple Inc. All rights reserved.2 * Copyright (C) 2006-2019 Apple Inc. All rights reserved. 3 3 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> 4 4 * … … 229 229 230 230 WTF::PoisonedUniquePtr<JSCallbackObjectPoison, JSCallbackObjectData> m_callbackObjectData; 231 PoisonedClassInfoPtr m_classInfo;231 const ClassInfo* m_classInfo { nullptr }; 232 232 }; 233 233 -
trunk/Source/JavaScriptCore/API/JSObjectRef.cpp
r237009 r242100 1 1 /* 2 * Copyright (C) 2006-201 7Apple Inc. All rights reserved.2 * Copyright (C) 2006-2019 Apple Inc. All rights reserved. 3 3 * Copyright (C) 2008 Kelvin W Sherlock (ksherlock@gmail.com) 4 4 * … … 552 552 return jsObject->classInfo(vm); 553 553 554 return vm.currentlyDestructingCallbackObjectClassInfo .unpoisoned();554 return vm.currentlyDestructingCallbackObjectClassInfo; 555 555 } 556 556 -
trunk/Source/JavaScriptCore/ChangeLog
r242096 r242100 1 2019-02-26 Mark Lam <mark.lam@apple.com> 2 3 Unpoison MacroAssemblerCodePtr, ClassInfo pointers, and a few other things. 4 https://bugs.webkit.org/show_bug.cgi?id=195039 5 6 Reviewed by Saam Barati. 7 8 1. Unpoison MacroAssemblerCodePtrs, ReturnAddressPtr. 9 2. Replace PoisonedClassInfoPtr with ClassInfo*. 10 3. Replace PoisonedMasmPtr with const void*. 11 4. Remove all references to CodeBlockPoison, JITCodePoison, and GlobalDataPoison. 12 13 * API/JSCallbackObject.h: 14 * API/JSObjectRef.cpp: 15 (classInfoPrivate): 16 * assembler/MacroAssemblerCodeRef.h: 17 (JSC::FunctionPtr::FunctionPtr): 18 (JSC::FunctionPtr::executableAddress const): 19 (JSC::FunctionPtr::retaggedExecutableAddress const): 20 (JSC::ReturnAddressPtr::ReturnAddressPtr): 21 (JSC::ReturnAddressPtr::value const): 22 (JSC::MacroAssemblerCodePtr::MacroAssemblerCodePtr): 23 (JSC::MacroAssemblerCodePtr::createFromExecutableAddress): 24 (JSC::MacroAssemblerCodePtr:: const): 25 (JSC::MacroAssemblerCodePtr::operator! const): 26 (JSC::MacroAssemblerCodePtr::operator== const): 27 (JSC::MacroAssemblerCodePtr::hash const): 28 (JSC::MacroAssemblerCodePtr::emptyValue): 29 (JSC::MacroAssemblerCodePtr::deletedValue): 30 (JSC::FunctionPtr<tag>::FunctionPtr): 31 (JSC::MacroAssemblerCodePtr::poisonedPtr const): Deleted. 32 * b3/B3LowerMacros.cpp: 33 * b3/testb3.cpp: 34 (JSC::B3::testInterpreter): 35 * dfg/DFGOSRExitCompilerCommon.h: 36 (JSC::DFG::adjustFrameAndStackInOSRExitCompilerThunk): 37 * dfg/DFGSpeculativeJIT.cpp: 38 (JSC::DFG::SpeculativeJIT::compileCheckSubClass): 39 (JSC::DFG::SpeculativeJIT::compileNewStringObject): 40 (JSC::DFG::SpeculativeJIT::emitSwitchIntJump): 41 (JSC::DFG::SpeculativeJIT::emitSwitchImm): 42 (JSC::DFG::SpeculativeJIT::emitSwitchCharStringJump): 43 (JSC::DFG::SpeculativeJIT::emitSwitchChar): 44 * dfg/DFGSpeculativeJIT.h: 45 * ftl/FTLLowerDFGToB3.cpp: 46 (JSC::FTL::DFG::LowerDFGToB3::compileNewStringObject): 47 (JSC::FTL::DFG::LowerDFGToB3::compileCheckSubClass): 48 * jit/AssemblyHelpers.h: 49 (JSC::AssemblyHelpers::emitAllocateDestructibleObject): 50 * jit/ThunkGenerators.cpp: 51 (JSC::virtualThunkFor): 52 (JSC::boundThisNoArgsFunctionCallGenerator): 53 * runtime/JSCPoison.h: 54 * runtime/JSDestructibleObject.h: 55 (JSC::JSDestructibleObject::classInfo const): 56 * runtime/JSSegmentedVariableObject.h: 57 (JSC::JSSegmentedVariableObject::classInfo const): 58 * runtime/Structure.h: 59 * runtime/VM.h: 60 * wasm/WasmB3IRGenerator.cpp: 61 (JSC::Wasm::B3IRGenerator::addCall): 62 (JSC::Wasm::B3IRGenerator::addCallIndirect): 63 * wasm/WasmBinding.cpp: 64 (JSC::Wasm::wasmToWasm): 65 1 66 2019-02-26 Mark Lam <mark.lam@apple.com> 2 67 -
trunk/Source/JavaScriptCore/assembler/MacroAssemblerCodeRef.h
r237547 r242100 1 1 /* 2 * Copyright (C) 2009-201 8Apple Inc. All rights reserved.2 * Copyright (C) 2009-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 27 27 28 28 #include "ExecutableAllocator.h" 29 #include "JSCPoison.h"30 29 #include "JSCPtrTag.h" 31 30 #include <wtf/DataLog.h> … … 75 74 { 76 75 assertIsNullOrCFunctionPtr(value); 77 PoisonedMasmPtr::assertIsNotPoisoned(m_value);78 76 ASSERT_NULL_OR_VALID_CODE_POINTER(m_value); 79 77 } … … 88 86 { 89 87 assertIsNullOrCFunctionPtr(value); 90 PoisonedMasmPtr::assertIsNotPoisoned(m_value);91 88 ASSERT_NULL_OR_VALID_CODE_POINTER(m_value); 92 89 } … … 101 98 { 102 99 assertIsNullOrCFunctionPtr(value); 103 PoisonedMasmPtr::assertIsNotPoisoned(m_value);104 100 ASSERT_NULL_OR_VALID_CODE_POINTER(m_value); 105 101 } … … 115 111 { 116 112 assertIsNullOrCFunctionPtr(value); 117 PoisonedMasmPtr::assertIsNotPoisoned(m_value);118 113 ASSERT_NULL_OR_VALID_CODE_POINTER(m_value); 119 114 } … … 131 126 void* executableAddress() const 132 127 { 133 PoisonedMasmPtr::assertIsNotPoisoned(m_value);134 128 return m_value; 135 129 } … … 138 132 void* retaggedExecutableAddress() const 139 133 { 140 PoisonedMasmPtr::assertIsNotPoisoned(m_value);141 134 return retagCodePtr<tag, newTag>(m_value); 142 135 } … … 153 146 : m_value(retagCodePtr<otherTag, tag>(other.executableAddress())) 154 147 { 155 PoisonedMasmPtr::assertIsNotPoisoned(m_value);156 148 ASSERT_NULL_OR_VALID_CODE_POINTER(m_value); 157 149 } … … 180 172 : m_value(value) 181 173 { 182 PoisonedMasmPtr::assertIsNotPoisoned(m_value);183 174 ASSERT_VALID_CODE_POINTER(m_value); 184 175 } … … 188 179 : m_value(untagCodePtr<tag>(function.executableAddress())) 189 180 { 190 PoisonedMasmPtr::assertIsNotPoisoned(m_value);191 181 ASSERT_VALID_CODE_POINTER(m_value); 192 182 } … … 194 184 const void* value() const 195 185 { 196 PoisonedMasmPtr::assertIsNotPoisoned(m_value);197 186 return m_value; 198 187 } … … 232 221 { 233 222 assertIsTaggedWith(value, tag); 234 m_value.assertIsPoisoned();235 223 ASSERT(value); 236 224 #if CPU(ARM_THUMB2) 237 225 ASSERT(!(reinterpret_cast<uintptr_t>(value) & 1)); 238 226 #endif 239 ASSERT_VALID_CODE_POINTER(m_value .unpoisoned());227 ASSERT_VALID_CODE_POINTER(m_value); 240 228 } 241 229 … … 246 234 assertIsTaggedWith(value, tag); 247 235 MacroAssemblerCodePtr result; 248 result.m_value = PoisonedMasmPtr(value); 249 result.m_value.assertIsPoisoned(); 236 result.m_value = value; 250 237 return result; 251 238 } … … 256 243 assertIsNotTagged(ra.value()); 257 244 ASSERT(ra.value()); 258 m_value.assertIsPoisoned(); 259 ASSERT_VALID_CODE_POINTER(m_value.unpoisoned()); 260 } 261 262 PoisonedMasmPtr poisonedPtr() const { return m_value; } 245 ASSERT_VALID_CODE_POINTER(m_value); 246 } 263 247 264 248 template<PtrTag newTag> … … 273 257 T executableAddress() const 274 258 { 275 m_value.assertIsPoisoned(); 276 return m_value.unpoisoned<T>(); 259 return bitwise_cast<T>(m_value); 277 260 } 278 261 … … 280 263 T untaggedExecutableAddress() const 281 264 { 282 m_value.assertIsPoisoned(); 283 return untagCodePtr<T, tag>(m_value.unpoisoned()); 265 return untagCodePtr<T, tag>(m_value); 284 266 } 285 267 … … 287 269 T retaggedExecutableAddress() const 288 270 { 289 m_value.assertIsPoisoned(); 290 return retagCodePtr<T, tag, newTag>(m_value.unpoisoned()); 271 return retagCodePtr<T, tag, newTag>(m_value); 291 272 } 292 273 … … 296 277 T dataLocation() const 297 278 { 298 m_value.assertIsPoisoned(); 299 ASSERT_VALID_CODE_POINTER(m_value.unpoisoned()); 300 return bitwise_cast<T>(m_value ? m_value.unpoisoned<char*>() - 1 : nullptr); 279 ASSERT_VALID_CODE_POINTER(m_value); 280 return bitwise_cast<T>(m_value ? bitwise_cast<char*>(m_value) - 1 : nullptr); 301 281 } 302 282 #else … … 304 284 T dataLocation() const 305 285 { 306 m_value.assertIsPoisoned(); 307 ASSERT_VALID_CODE_POINTER(m_value); 308 return untagCodePtr<T, tag>(m_value.unpoisoned()); 286 ASSERT_VALID_CODE_POINTER(m_value); 287 return untagCodePtr<T, tag>(m_value); 309 288 } 310 289 #endif … … 312 291 bool operator!() const 313 292 { 314 #if ENABLE(POISON_ASSERTS)315 if (!isEmptyValue() && !isDeletedValue())316 m_value.assertIsPoisoned();317 #endif318 293 return !m_value; 319 294 } … … 322 297 bool operator==(const MacroAssemblerCodePtr& other) const 323 298 { 324 #if ENABLE(POISON_ASSERTS)325 if (!isEmptyValue() && !isDeletedValue())326 m_value.assertIsPoisoned();327 if (!other.isEmptyValue() && !other.isDeletedValue())328 other.m_value.assertIsPoisoned();329 #endif330 299 return m_value == other.m_value; 331 300 } 332 301 333 302 // Disallow any casting operations (except for booleans). Instead, the client 334 // should be asking for poisonedPtr() orexecutableAddress() explicitly.303 // should be asking executableAddress() explicitly. 335 304 template<typename T, typename = std::enable_if_t<!std::is_same<T, bool>::value>> 336 305 operator T() = delete; … … 357 326 bool isDeletedValue() const { return m_value == deletedValue(); } 358 327 359 unsigned hash() const { return IntHash<uintptr_t>::hash(m_value.bits()); }328 unsigned hash() const { return PtrHash<const void*>::hash(m_value); } 360 329 361 330 static void initialize(); 362 331 363 332 private: 364 static PoisonedMasmPtr emptyValue() { return PoisonedMasmPtr(AlreadyPoisoned, 1); }365 static PoisonedMasmPtr deletedValue() { return PoisonedMasmPtr(AlreadyPoisoned, 2); }366 367 PoisonedMasmPtr m_value;333 static const void* emptyValue() { return bitwise_cast<void*>(static_cast<intptr_t>(1)); } 334 static const void* deletedValue() { return bitwise_cast<void*>(static_cast<intptr_t>(2)); } 335 336 const void* m_value { nullptr }; 368 337 }; 369 338 … … 489 458 : m_value(ptr.executableAddress()) 490 459 { 491 PoisonedMasmPtr::assertIsNotPoisoned(m_value);492 460 } 493 461 -
trunk/Source/JavaScriptCore/b3/B3LowerMacros.cpp
r241217 r242100 1 1 /* 2 * Copyright (C) 2015-201 8Apple Inc. All rights reserved.2 * Copyright (C) 2015-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 508 508 GPRReg index = params[0].gpr(); 509 509 GPRReg scratch = params.gpScratch(0); 510 GPRReg poisonScratch = params.gpScratch(1); 511 512 jit.move(CCallHelpers::TrustedImm64(JITCodePoison::key()), poisonScratch); 510 513 511 jit.move(CCallHelpers::TrustedImmPtr(jumpTable), scratch); 514 512 jit.load64(CCallHelpers::BaseIndex(scratch, index, CCallHelpers::timesPtr()), scratch); 515 jit.xor64(poisonScratch, scratch);516 513 jit.jump(scratch, JSSwitchPtrTag); 517 514 -
trunk/Source/JavaScriptCore/b3/testb3.cpp
r242068 r242100 1 1 /* 2 * Copyright (C) 2015-201 8Apple Inc. All rights reserved.2 * Copyright (C) 2015-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 13463 13463 13464 13464 GPRReg scratch = params.gpScratch(0); 13465 GPRReg poisonScratch = params.gpScratch(1);13466 13465 13467 13466 jit.move(CCallHelpers::TrustedImmPtr(jumpTable), scratch); 13468 jit.move(CCallHelpers::TrustedImm64(JITCodePoison::key()), poisonScratch);13469 13467 jit.load64(CCallHelpers::BaseIndex(scratch, params[0].gpr(), CCallHelpers::timesPtr()), scratch); 13470 jit.xor64(poisonScratch, scratch);13471 13468 jit.jump(scratch, B3CompilationPtrTag); 13472 13469 -
trunk/Source/JavaScriptCore/dfg/DFGOSRExitCompilerCommon.h
r227527 r242100 1 1 /* 2 * Copyright (C) 2013-201 8Apple Inc. All rights reserved.2 * Copyright (C) 2013-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 88 88 jit.loadPtr(MacroAssembler::Address(GPRInfo::callFrameRegister, CallFrameSlot::codeBlock * static_cast<int>(sizeof(Register))), GPRInfo::regT0); 89 89 jit.loadPtr(MacroAssembler::Address(GPRInfo::regT0, CodeBlock::jitCodeOffset()), GPRInfo::regT0); 90 jit.xorPtr(MacroAssembler::TrustedImmPtr(CodeBlockPoison::key()), GPRInfo::regT0);91 90 jit.addPtr(MacroAssembler::TrustedImm32(JITCodeType::commonDataOffset()), GPRInfo::regT0); 92 91 jit.load32(MacroAssembler::Address(GPRInfo::regT0, CommonData::frameRegisterCountOffset()), GPRInfo::regT0); -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
r242015 r242100 9342 9342 m_jit.emitLoadStructure(*m_jit.vm(), baseGPR, otherGPR, specifiedGPR); 9343 9343 m_jit.loadPtr(CCallHelpers::Address(otherGPR, Structure::classInfoOffset()), otherGPR); 9344 #if USE(JSVALUE64)9345 m_jit.move(CCallHelpers::TrustedImm64(GlobalDataPoison::key()), specifiedGPR);9346 m_jit.xor64(specifiedGPR, otherGPR);9347 #endif9348 9344 m_jit.move(CCallHelpers::TrustedImmPtr(node->classInfo()), specifiedGPR); 9349 9345 … … 9639 9635 9640 9636 m_jit.storePtr( 9641 TrustedImmPtr( PoisonedClassInfoPtr(StringObject::info()).bits()),9637 TrustedImmPtr(StringObject::info()), 9642 9638 JITCompiler::Address(resultGPR, JSDestructibleObject::classInfoOffset())); 9643 9639 #if USE(JSVALUE64) … … 10482 10478 10483 10479 void SpeculativeJIT::emitSwitchIntJump( 10484 SwitchData* data, GPRReg value, GPRReg scratch , GPRReg poisonScratch)10480 SwitchData* data, GPRReg value, GPRReg scratch) 10485 10481 { 10486 10482 SimpleJumpTable& table = m_jit.codeBlock()->switchJumpTable(data->switchTableIndex); … … 10490 10486 m_jit.branch32(JITCompiler::AboveOrEqual, value, Imm32(table.ctiOffsets.size())), 10491 10487 data->fallThrough.block); 10492 UNUSED_PARAM(poisonScratch); // Placate the 32-bit build.10493 #if USE(JSVALUE64)10494 m_jit.move(TrustedImm64(JITCodePoison::key()), poisonScratch);10495 #endif10496 10488 m_jit.move(TrustedImmPtr(table.ctiOffsets.begin()), scratch); 10497 10489 m_jit.loadPtr(JITCompiler::BaseIndex(scratch, value, JITCompiler::timesPtr()), scratch); 10498 10490 10499 #if USE(JSVALUE64)10500 m_jit.xor64(poisonScratch, scratch);10501 #endif10502 10491 m_jit.jump(scratch, JSSwitchPtrTag); 10503 10492 data->didUseJumpTable = true; … … 10510 10499 SpeculateInt32Operand value(this, node->child1()); 10511 10500 GPRTemporary temp(this); 10512 GPRTemporary temp2(this); 10513 emitSwitchIntJump(data, value.gpr(), temp.gpr(), temp2.gpr()); 10501 emitSwitchIntJump(data, value.gpr(), temp.gpr()); 10514 10502 noResult(node); 10515 10503 break; … … 10519 10507 JSValueOperand value(this, node->child1()); 10520 10508 GPRTemporary temp(this); 10521 GPRTemporary temp2(this);10522 10509 JSValueRegs valueRegs = value.jsValueRegs(); 10523 10510 GPRReg scratch = temp.gpr(); 10524 GPRReg scratch2 = temp2.gpr();10525 10511 10526 10512 value.use(); 10527 10513 10528 10514 auto notInt32 = m_jit.branchIfNotInt32(valueRegs); 10529 emitSwitchIntJump(data, valueRegs.payloadGPR(), scratch , scratch2);10515 emitSwitchIntJump(data, valueRegs.payloadGPR(), scratch); 10530 10516 notInt32.link(&m_jit); 10531 10517 addBranch(m_jit.branchIfNotNumber(valueRegs, scratch), data->fallThrough.block); … … 10546 10532 10547 10533 void SpeculativeJIT::emitSwitchCharStringJump( 10548 SwitchData* data, GPRReg value, GPRReg scratch , GPRReg scratch2)10534 SwitchData* data, GPRReg value, GPRReg scratch) 10549 10535 { 10550 10536 addBranch( … … 10577 10563 10578 10564 ready.link(&m_jit); 10579 emitSwitchIntJump(data, scratch, value , scratch2);10565 emitSwitchIntJump(data, scratch, value); 10580 10566 } 10581 10567 … … 10586 10572 SpeculateCellOperand op1(this, node->child1()); 10587 10573 GPRTemporary temp(this); 10588 GPRTemporary temp2(this);10589 10574 10590 10575 GPRReg op1GPR = op1.gpr(); 10591 10576 GPRReg tempGPR = temp.gpr(); 10592 GPRReg temp2GPR = temp2.gpr();10593 10577 10594 10578 op1.use(); 10595 10579 10596 10580 speculateString(node->child1(), op1GPR); 10597 emitSwitchCharStringJump(data, op1GPR, tempGPR , temp2GPR);10581 emitSwitchCharStringJump(data, op1GPR, tempGPR); 10598 10582 noResult(node, UseChildrenCalledExplicitly); 10599 10583 break; … … 10603 10587 JSValueOperand op1(this, node->child1()); 10604 10588 GPRTemporary temp(this); 10605 GPRTemporary temp2(this);10606 10589 10607 10590 JSValueRegs op1Regs = op1.jsValueRegs(); 10608 10591 GPRReg tempGPR = temp.gpr(); 10609 GPRReg temp2GPR = temp2.gpr();10610 10592 10611 10593 op1.use(); … … 10615 10597 addBranch(m_jit.branchIfNotString(op1Regs.payloadGPR()), data->fallThrough.block); 10616 10598 10617 emitSwitchCharStringJump(data, op1Regs.payloadGPR(), tempGPR , temp2GPR);10599 emitSwitchCharStringJump(data, op1Regs.payloadGPR(), tempGPR); 10618 10600 noResult(node, UseChildrenCalledExplicitly); 10619 10601 break; -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h
r240327 r242100 1 1 /* 2 * Copyright (C) 2011-201 8Apple Inc. All rights reserved.2 * Copyright (C) 2011-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 1237 1237 }; 1238 1238 1239 void emitSwitchIntJump(SwitchData*, GPRReg value, GPRReg scratch , GPRReg scratch2);1239 void emitSwitchIntJump(SwitchData*, GPRReg value, GPRReg scratch); 1240 1240 void emitSwitchImm(Node*, SwitchData*); 1241 void emitSwitchCharStringJump(SwitchData*, GPRReg value, GPRReg scratch , GPRReg scratch2);1241 void emitSwitchCharStringJump(SwitchData*, GPRReg value, GPRReg scratch); 1242 1242 void emitSwitchChar(Node*, SwitchData*); 1243 1243 void emitBinarySwitchStringRecurse( -
trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp
r242096 r242100 5646 5646 5647 5647 LValue fastResultValue = allocateObject<StringObject>(structure, m_out.intPtrZero, slowCase); 5648 m_out.storePtr(m_out.constIntPtr( PoisonedClassInfoPtr(StringObject::info()).bits()), fastResultValue, m_heaps.JSDestructibleObject_classInfo);5648 m_out.storePtr(m_out.constIntPtr(StringObject::info()), fastResultValue, m_heaps.JSDestructibleObject_classInfo); 5649 5649 m_out.store64(string, fastResultValue, m_heaps.JSWrapperObject_internalValue); 5650 5650 mutatorFence(); … … 12154 12154 12155 12155 LValue structure = loadStructure(cell); 12156 LValue poisonedClassInfo = m_out.loadPtr(structure, m_heaps.Structure_classInfo); 12157 LValue classInfo = m_out.bitXor(poisonedClassInfo, m_out.constInt64(GlobalDataPoison::key())); 12156 LValue classInfo = m_out.loadPtr(structure, m_heaps.Structure_classInfo); 12158 12157 ValueFromBlock otherAtStart = m_out.anchor(classInfo); 12159 12158 m_out.jump(loop); -
trunk/Source/JavaScriptCore/jit/AssemblyHelpers.h
r242096 r242100 1799 1799 auto butterfly = TrustedImmPtr(nullptr); 1800 1800 emitAllocateJSObject<ClassType>(vm, resultGPR, TrustedImmPtr(structure), butterfly, scratchGPR1, scratchGPR2, slowPath); 1801 storePtr(TrustedImmPtr( PoisonedClassInfoPtr(structure->classInfo()).bits()), Address(resultGPR, JSDestructibleObject::classInfoOffset()));1801 storePtr(TrustedImmPtr(structure->classInfo()), Address(resultGPR, JSDestructibleObject::classInfoOffset())); 1802 1802 } 1803 1803 -
trunk/Source/JavaScriptCore/jit/ThunkGenerators.cpp
r241214 r242100 1 1 /* 2 * Copyright (C) 2010-201 8Apple Inc. All rights reserved.2 * Copyright (C) 2010-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 214 214 // Now we know that we have a CodeBlock, and we're committed to making a fast 215 215 // call. 216 #if USE(JSVALUE64)217 jit.move(CCallHelpers::TrustedImm64(JITCodePoison::key()), GPRInfo::regT1);218 jit.xor64(GPRInfo::regT1, GPRInfo::regT4);219 #endif220 216 221 217 // Make a tail call. This will return back to JIT code. … … 1249 1245 CCallHelpers::Jump noCode = jit.branchTestPtr(CCallHelpers::Zero, GPRInfo::regT0); 1250 1246 1251 #if USE(JSVALUE64)1252 jit.move(CCallHelpers::TrustedImm64(JITCodePoison::key()), GPRInfo::regT1);1253 jit.xor64(GPRInfo::regT1, GPRInfo::regT0);1254 #endif1255 1247 emitPointerValidation(jit, GPRInfo::regT0, JSEntryPtrTag); 1256 1248 jit.call(GPRInfo::regT0, JSEntryPtrTag); -
trunk/Source/JavaScriptCore/runtime/JSCPoison.h
r241649 r242100 1 1 /* 2 * Copyright (C) 2017-201 8Apple Inc. All rights reserved.2 * Copyright (C) 2017-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 33 33 #define FOR_EACH_JSC_POISON(v) \ 34 34 v(ArrayPrototype) \ 35 v(CodeBlock) \36 v(GlobalData) \37 v(JITCode) \38 35 v(JSAPIWrapperObject) \ 39 36 v(JSArrayBuffer) \ … … 66 63 #undef DECLARE_POISON 67 64 68 struct ClassInfo;69 70 using PoisonedClassInfoPtr = Poisoned<GlobalDataPoison, const ClassInfo*>;71 using PoisonedMasmPtr = Poisoned<JITCodePoison, const void*>;72 73 65 void initializePoison(); 74 66 -
trunk/Source/JavaScriptCore/runtime/JSDestructibleObject.h
r240965 r242100 1 1 /* 2 * Copyright (C) 2012-201 7Apple Inc. All rights reserved.2 * Copyright (C) 2012-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 44 44 } 45 45 46 const ClassInfo* classInfo() const { return m_classInfo .unpoisoned(); }46 const ClassInfo* classInfo() const { return m_classInfo; } 47 47 48 48 static ptrdiff_t classInfoOffset() { return OBJECT_OFFSETOF(JSDestructibleObject, m_classInfo); } … … 57 57 58 58 private: 59 PoisonedClassInfoPtrm_classInfo;59 const ClassInfo* m_classInfo; 60 60 }; 61 61 -
trunk/Source/JavaScriptCore/runtime/JSSegmentedVariableObject.h
r240965 r242100 1 1 /* 2 * Copyright (C) 2012-201 7Apple Inc. All rights reserved.2 * Copyright (C) 2012-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 97 97 } 98 98 99 const ClassInfo* classInfo() const { return m_classInfo .unpoisoned(); }99 const ClassInfo* classInfo() const { return m_classInfo; } 100 100 101 101 protected: … … 108 108 private: 109 109 SegmentedVector<WriteBarrier<Unknown>, 16> m_variables; 110 PoisonedClassInfoPtrm_classInfo;110 const ClassInfo* m_classInfo; 111 111 ConcurrentJSLock m_lock; 112 112 bool m_alreadyDestroyed { false }; // We use these assertions to check that we aren't doing ancient hacks that result in this being destroyed more than once. -
trunk/Source/JavaScriptCore/runtime/Structure.h
r240965 r242100 1 1 /* 2 * Copyright (C) 2008-201 8Apple Inc. All rights reserved.2 * Copyright (C) 2008-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 491 491 void setObjectToStringValue(ExecState*, VM&, JSString* value, PropertySlot toStringTagSymbolSlot); 492 492 493 const ClassInfo* classInfo() const { return m_classInfo .unpoisoned(); }493 const ClassInfo* classInfo() const { return m_classInfo; } 494 494 495 495 static ptrdiff_t structureIDOffset() … … 769 769 RefPtr<UniquedStringImpl> m_nameInPrevious; 770 770 771 PoisonedClassInfoPtrm_classInfo;771 const ClassInfo* m_classInfo; 772 772 773 773 StructureTransitionTable m_transitionTable; -
trunk/Source/JavaScriptCore/runtime/VM.h
r242015 r242100 547 547 548 548 JSCell* currentlyDestructingCallbackObject; 549 PoisonedClassInfoPtr currentlyDestructingCallbackObjectClassInfo;549 const ClassInfo* currentlyDestructingCallbackObjectClassInfo { nullptr }; 550 550 551 551 AtomicStringTable* m_atomicStringTable; -
trunk/Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp
r241657 r242100 1 1 /* 2 * Copyright (C) 2016-201 8Apple Inc. All rights reserved.2 * Copyright (C) 2016-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 1129 1129 Value* jumpDestination = isEmbedderBlock->appendNew<MemoryValue>(m_proc, 1130 1130 Load, pointerType(), origin(), instanceValue(), safeCast<int32_t>(Instance::offsetOfWasmToEmbedderStub(functionIndex))); 1131 if (Options::usePoisoning())1132 jumpDestination = isEmbedderBlock->appendNew<Value>(m_proc, BitXor, origin(), jumpDestination, isEmbedderBlock->appendNew<Const64Value>(m_proc, origin(), g_JITCodePoison));1133 1131 1134 1132 Value* embedderCallResult = wasmCallingConvention().setupCall(m_proc, isEmbedderBlock, origin(), args, toB3Type(returnType), … … 1309 1307 m_currentBlock->appendNew<MemoryValue>(m_proc, Load, pointerType(), origin(), callableFunction, 1310 1308 safeCast<int32_t>(WasmToWasmImportableFunction::offsetOfEntrypointLoadLocation()))); 1311 if (Options::usePoisoning())1312 calleeCode = m_currentBlock->appendNew<Value>(m_proc, BitXor, origin(), calleeCode, m_currentBlock->appendNew<Const64Value>(m_proc, origin(), g_JITCodePoison));1313 1309 1314 1310 Type returnType = signature.returnType(); -
trunk/Source/JavaScriptCore/wasm/WasmBinding.cpp
r230748 r242100 1 1 /* 2 * Copyright (C) 2016-201 8Apple Inc. All rights reserved.2 * Copyright (C) 2016-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 79 79 // Tail call into the callee WebAssembly function. 80 80 jit.loadPtr(scratch, scratch); 81 if (Options::usePoisoning())82 jit.xorPtr(JIT::TrustedImmPtr(g_JITCodePoison), scratch);83 81 jit.jump(scratch, WasmEntryPtrTag); 84 82
Note:
See TracChangeset
for help on using the changeset viewer.