Title: [236591] branches/safari-606-branch
Revision
236591
Author
[email protected]
Date
2018-09-27 23:08:11 -0700 (Thu, 27 Sep 2018)

Log Message

Cherry-pick r236576. rdar://problem/44855116

    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:

Modified Paths

Property Changed

Diff

Index: branches/safari-606-branch =================================================================== --- branches/safari-606-branch 2018-09-28 05:47:59 UTC (rev 236590) +++ branches/safari-606-branch 2018-09-28 06:08:11 UTC (rev 236591)

Property changes: branches/safari-606-branch


Modified: svn:mergeinfo

-/trunk:53455,235254,235419,235666 \ No newline at end of property +/trunk:53455,235254,235419,235666,236576 \ No newline at end of property

Modified: branches/safari-606-branch/Source/_javascript_Core/ChangeLog (236590 => 236591)


--- branches/safari-606-branch/Source/_javascript_Core/ChangeLog	2018-09-28 05:47:59 UTC (rev 236590)
+++ branches/safari-606-branch/Source/_javascript_Core/ChangeLog	2018-09-28 06:08:11 UTC (rev 236591)
@@ -1,3 +1,25 @@
+2018-09-27  Mark Lam  <[email protected]>
+
+        Cherry-pick r236576. rdar://problem/44855116
+
+    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  Saam barati  <[email protected]>
 
         Cherry-pick r236585. rdar://problem/44848947

Modified: branches/safari-606-branch/Source/_javascript_Core/dfg/DFGJITCode.h (236590 => 236591)


--- branches/safari-606-branch/Source/_javascript_Core/dfg/DFGJITCode.h	2018-09-28 05:47:59 UTC (rev 236590)
+++ branches/safari-606-branch/Source/_javascript_Core/dfg/DFGJITCode.h	2018-09-28 06:08:11 UTC (rev 236591)
@@ -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: branches/safari-606-branch/Source/_javascript_Core/dfg/DFGJITCompiler.cpp (236590 => 236591)


--- branches/safari-606-branch/Source/_javascript_Core/dfg/DFGJITCompiler.cpp	2018-09-28 05:47:59 UTC (rev 236590)
+++ branches/safari-606-branch/Source/_javascript_Core/dfg/DFGJITCompiler.cpp	2018-09-28 06:08:11 UTC (rev 236591)
@@ -574,7 +574,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: branches/safari-606-branch/Source/_javascript_Core/dfg/DFGOSREntry.cpp (236590 => 236591)


--- branches/safari-606-branch/Source/_javascript_Core/dfg/DFGOSREntry.cpp	2018-09-28 05:47:59 UTC (rev 236590)
+++ branches/safari-606-branch/Source/_javascript_Core/dfg/DFGOSREntry.cpp	2018-09-28 06:08:11 UTC (rev 236591)
@@ -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: branches/safari-606-branch/Source/_javascript_Core/dfg/DFGOSREntry.h (236590 => 236591)


--- branches/safari-606-branch/Source/_javascript_Core/dfg/DFGOSREntry.h	2018-09-28 05:47:59 UTC (rev 236590)
+++ branches/safari-606-branch/Source/_javascript_Core/dfg/DFGOSREntry.h	2018-09-28 06:08:11 UTC (rev 236591)
@@ -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: branches/safari-606-branch/Source/_javascript_Core/runtime/JSCPtrTag.h (236590 => 236591)


--- branches/safari-606-branch/Source/_javascript_Core/runtime/JSCPtrTag.h	2018-09-28 05:47:59 UTC (rev 236590)
+++ branches/safari-606-branch/Source/_javascript_Core/runtime/JSCPtrTag.h	2018-09-28 06:08:11 UTC (rev 236591)
@@ -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