Title: [236576] trunk/Source/_javascript_Core
Revision
236576
Author
[email protected]
Date
2018-09-27 15:33:24 -0700 (Thu, 27 Sep 2018)

Log Message

DFG::OSREntry::m_machineCodeOffset should be a CodeLocation.
https://bugs.webkit.org/show_bug.cgi?id=190054
<rdar://problem/44803543>

Reviewed by Saam Barati.

* dfg/DFGJITCode.h:
(JSC::DFG::JITCode::appendOSREntryData):
* dfg/DFGJITCompiler.cpp:
(JSC::DFG::JITCompiler::noticeOSREntry):
* dfg/DFGOSREntry.cpp:
(JSC::DFG::OSREntryData::dumpInContext const):
(JSC::DFG::prepareOSREntry):
* dfg/DFGOSREntry.h:
* runtime/JSCPtrTag.h:

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (236575 => 236576)


--- trunk/Source/_javascript_Core/ChangeLog	2018-09-27 22:29:26 UTC (rev 236575)
+++ trunk/Source/_javascript_Core/ChangeLog	2018-09-27 22:33:24 UTC (rev 236576)
@@ -1,5 +1,23 @@
 2018-09-27  Mark Lam  <[email protected]>
 
+        DFG::OSREntry::m_machineCodeOffset should be a CodeLocation.
+        https://bugs.webkit.org/show_bug.cgi?id=190054
+        <rdar://problem/44803543>
+
+        Reviewed by Saam Barati.
+
+        * dfg/DFGJITCode.h:
+        (JSC::DFG::JITCode::appendOSREntryData):
+        * dfg/DFGJITCompiler.cpp:
+        (JSC::DFG::JITCompiler::noticeOSREntry):
+        * dfg/DFGOSREntry.cpp:
+        (JSC::DFG::OSREntryData::dumpInContext const):
+        (JSC::DFG::prepareOSREntry):
+        * dfg/DFGOSREntry.h:
+        * runtime/JSCPtrTag.h:
+
+2018-09-27  Mark Lam  <[email protected]>
+
         JITMathIC should not use integer offsets into machine code.
         https://bugs.webkit.org/show_bug.cgi?id=190030
         <rdar://problem/44803307>

Modified: trunk/Source/_javascript_Core/dfg/DFGJITCode.h (236575 => 236576)


--- trunk/Source/_javascript_Core/dfg/DFGJITCode.h	2018-09-27 22:29:26 UTC (rev 236575)
+++ trunk/Source/_javascript_Core/dfg/DFGJITCode.h	2018-09-27 22:33:24 UTC (rev 236576)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2013-2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2013-2018 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -54,11 +54,11 @@
     CommonData* dfgCommon() override;
     JITCode* dfg() override;
     
-    OSREntryData* appendOSREntryData(unsigned bytecodeIndex, unsigned machineCodeOffset)
+    OSREntryData* appendOSREntryData(unsigned bytecodeIndex, CodeLocationLabel<OSREntryPtrTag> machineCode)
     {
         DFG::OSREntryData entry;
         entry.m_bytecodeIndex = bytecodeIndex;
-        entry.m_machineCodeOffset = machineCodeOffset;
+        entry.m_machineCode = machineCode;
         osrEntry.append(entry);
         return &osrEntry.last();
     }

Modified: trunk/Source/_javascript_Core/dfg/DFGJITCompiler.cpp (236575 => 236576)


--- trunk/Source/_javascript_Core/dfg/DFGJITCompiler.cpp	2018-09-27 22:29:26 UTC (rev 236575)
+++ trunk/Source/_javascript_Core/dfg/DFGJITCompiler.cpp	2018-09-27 22:33:24 UTC (rev 236576)
@@ -576,7 +576,7 @@
     if (!basicBlock.intersectionOfCFAHasVisited)
         return;
 
-    OSREntryData* entry = m_jitCode->appendOSREntryData(basicBlock.bytecodeBegin, linkBuffer.offsetOf(blockHead));
+    OSREntryData* entry = m_jitCode->appendOSREntryData(basicBlock.bytecodeBegin, linkBuffer.locationOf<OSREntryPtrTag>(blockHead));
 
     entry->m_expectedValues = basicBlock.intersectionOfPastValuesAtHead;
         

Modified: trunk/Source/_javascript_Core/dfg/DFGOSREntry.cpp (236575 => 236576)


--- trunk/Source/_javascript_Core/dfg/DFGOSREntry.cpp	2018-09-27 22:29:26 UTC (rev 236575)
+++ trunk/Source/_javascript_Core/dfg/DFGOSREntry.cpp	2018-09-27 22:33:24 UTC (rev 236576)
@@ -42,7 +42,7 @@
 
 void OSREntryData::dumpInContext(PrintStream& out, DumpContext* context) const
 {
-    out.print("bc#", m_bytecodeIndex, ", machine code offset = ", m_machineCodeOffset);
+    out.print("bc#", m_bytecodeIndex, ", machine code = ", RawPointer(m_machineCode.executableAddress()));
     out.print(", stack rules = [");
     
     auto printOperand = [&] (VirtualRegister reg) {
@@ -269,11 +269,12 @@
     
     *bitwise_cast<size_t*>(scratch + 0) = frameSize;
     
-    void* targetPC = codeBlock->jitCode()->executableAddressAtOffset(entry->m_machineCodeOffset);
+    void* targetPC = entry->m_machineCode.executableAddress();
+    RELEASE_ASSERT(codeBlock->jitCode()->contains(entry->m_machineCode.untaggedExecutableAddress()));
     if (Options::verboseOSR())
         dataLogF("    OSR using target PC %p.\n", targetPC);
     RELEASE_ASSERT(targetPC);
-    *bitwise_cast<void**>(scratch + 1) = retagCodePtr(targetPC, JSEntryPtrTag, bitwise_cast<PtrTag>(exec));
+    *bitwise_cast<void**>(scratch + 1) = retagCodePtr(targetPC, OSREntryPtrTag, bitwise_cast<PtrTag>(exec));
 
     Register* pivot = scratch + 2 + CallFrame::headerSizeInRegisters;
     

Modified: trunk/Source/_javascript_Core/dfg/DFGOSREntry.h (236575 => 236576)


--- trunk/Source/_javascript_Core/dfg/DFGOSREntry.h	2018-09-27 22:29:26 UTC (rev 236575)
+++ trunk/Source/_javascript_Core/dfg/DFGOSREntry.h	2018-09-27 22:33:24 UTC (rev 236576)
@@ -54,7 +54,7 @@
 
 struct OSREntryData {
     unsigned m_bytecodeIndex;
-    unsigned m_machineCodeOffset;
+    CodeLocationLabel<OSREntryPtrTag> m_machineCode;
     Operands<AbstractValue> m_expectedValues;
     // Use bitvectors here because they tend to only require one word.
     BitVector m_localsForcedDouble;

Modified: trunk/Source/_javascript_Core/runtime/JSCPtrTag.h (236575 => 236576)


--- trunk/Source/_javascript_Core/runtime/JSCPtrTag.h	2018-09-27 22:29:26 UTC (rev 236575)
+++ trunk/Source/_javascript_Core/runtime/JSCPtrTag.h	2018-09-27 22:33:24 UTC (rev 236576)
@@ -45,6 +45,7 @@
     v(JSSwitchPtrTag) \
     v(LinkBufferPtrTag) \
     v(OperationPtrTag) \
+    v(OSREntryPtrTag) \
     v(OSRExitPtrTag) \
     v(PlatformRegistersLRPtrTag) \
     v(PlatformRegistersPCPtrTag) \
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to