Title: [178693] trunk/Source/_javascript_Core
Revision
178693
Author
fpi...@apple.com
Date
2015-01-19 21:01:26 -0800 (Mon, 19 Jan 2015)

Log Message

ClosureCallStubRoutine no longer needs codeOrigin
https://bugs.webkit.org/show_bug.cgi?id=140659

Reviewed by Michael Saboff.
        
Once upon a time, we would look for the CodeOrigin associated with a return PC. This search
would start with the CodeBlock according to the caller frame's call frame header. But if the
call was a closure call, the return PC would be inside some closure call stub. So if the
CodeBlock search failed, we would search *all* closure call stub routines to see which one
encompasses the return PC. Then, we would use the CodeOrigin stored in the stub routine
object. This was all a bunch of madness, and we actually got rid of it - we now determine
the CodeOrigin for a call frame using the encoded code origin bits inside the tag of the
argument count.
        
This patch removes the final vestiges of the madness:
        
- Remove the totally unused method declaration for the thing that did the closure call stub
  search.
        
- Remove the CodeOrigin field from the ClosureCallStubRoutine. Except for that crazy search
  that we no longer do, everyone else who finds a ClosureCallStubRoutine will find it via
  the CallLinkInfo. The CallLinkInfo also has the CodeOrigin, so we don't need this field
  anymore.

* bytecode/CodeBlock.h:
* jit/ClosureCallStubRoutine.cpp:
(JSC::ClosureCallStubRoutine::ClosureCallStubRoutine):
* jit/ClosureCallStubRoutine.h:
(JSC::ClosureCallStubRoutine::executable):
(JSC::ClosureCallStubRoutine::codeOrigin): Deleted.
* jit/Repatch.cpp:
(JSC::linkClosureCall):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (178692 => 178693)


--- trunk/Source/_javascript_Core/ChangeLog	2015-01-20 04:47:55 UTC (rev 178692)
+++ trunk/Source/_javascript_Core/ChangeLog	2015-01-20 05:01:26 UTC (rev 178693)
@@ -1,3 +1,38 @@
+2015-01-19  Filip Pizlo  <fpi...@apple.com>
+
+        ClosureCallStubRoutine no longer needs codeOrigin
+        https://bugs.webkit.org/show_bug.cgi?id=140659
+
+        Reviewed by Michael Saboff.
+        
+        Once upon a time, we would look for the CodeOrigin associated with a return PC. This search
+        would start with the CodeBlock according to the caller frame's call frame header. But if the
+        call was a closure call, the return PC would be inside some closure call stub. So if the
+        CodeBlock search failed, we would search *all* closure call stub routines to see which one
+        encompasses the return PC. Then, we would use the CodeOrigin stored in the stub routine
+        object. This was all a bunch of madness, and we actually got rid of it - we now determine
+        the CodeOrigin for a call frame using the encoded code origin bits inside the tag of the
+        argument count.
+        
+        This patch removes the final vestiges of the madness:
+        
+        - Remove the totally unused method declaration for the thing that did the closure call stub
+          search.
+        
+        - Remove the CodeOrigin field from the ClosureCallStubRoutine. Except for that crazy search
+          that we no longer do, everyone else who finds a ClosureCallStubRoutine will find it via
+          the CallLinkInfo. The CallLinkInfo also has the CodeOrigin, so we don't need this field
+          anymore.
+
+        * bytecode/CodeBlock.h:
+        * jit/ClosureCallStubRoutine.cpp:
+        (JSC::ClosureCallStubRoutine::ClosureCallStubRoutine):
+        * jit/ClosureCallStubRoutine.h:
+        (JSC::ClosureCallStubRoutine::executable):
+        (JSC::ClosureCallStubRoutine::codeOrigin): Deleted.
+        * jit/Repatch.cpp:
+        (JSC::linkClosureCall):
+
 2015-01-19  Saam Barati  <saambara...@gmail.com>
 
         Basic block start offsets should never be larger than end offsets in the control flow profiler

Modified: trunk/Source/_javascript_Core/bytecode/CodeBlock.h (178692 => 178693)


--- trunk/Source/_javascript_Core/bytecode/CodeBlock.h	2015-01-20 04:47:55 UTC (rev 178692)
+++ trunk/Source/_javascript_Core/bytecode/CodeBlock.h	2015-01-20 05:01:26 UTC (rev 178693)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2008, 2009, 2010, 2011, 2012, 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2008-2015 Apple Inc. All rights reserved.
  * Copyright (C) 2008 Cameron Zwarich <cwzwar...@uwaterloo.ca>
  *
  * Redistribution and use in source and binary forms, with or without
@@ -987,10 +987,6 @@
     
     double optimizationThresholdScalingFactor();
 
-#if ENABLE(JIT)
-    ClosureCallStubRoutine* findClosureCallForReturnPC(ReturnAddressPtr);
-#endif
-        
     void updateAllPredictionsAndCountLiveness(unsigned& numberOfLiveNonArgumentValueProfiles, unsigned& numberOfSamplesInProfiles);
 
     void setConstantRegisters(const Vector<WriteBarrier<Unknown>>& constants)

Modified: trunk/Source/_javascript_Core/jit/ClosureCallStubRoutine.cpp (178692 => 178693)


--- trunk/Source/_javascript_Core/jit/ClosureCallStubRoutine.cpp	2015-01-20 04:47:55 UTC (rev 178692)
+++ trunk/Source/_javascript_Core/jit/ClosureCallStubRoutine.cpp	2015-01-20 05:01:26 UTC (rev 178693)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2012, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2012, 2014, 2015 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -39,10 +39,9 @@
 
 ClosureCallStubRoutine::ClosureCallStubRoutine(
     const MacroAssemblerCodeRef& code, VM& vm, const JSCell* owner,
-    ExecutableBase* executable, const CodeOrigin& codeOrigin)
+    ExecutableBase* executable)
     : GCAwareJITStubRoutine(code, vm)
     , m_executable(vm, owner, executable)
-    , m_codeOrigin(codeOrigin)
 {
 }
 

Modified: trunk/Source/_javascript_Core/jit/ClosureCallStubRoutine.h (178692 => 178693)


--- trunk/Source/_javascript_Core/jit/ClosureCallStubRoutine.h	2015-01-20 04:47:55 UTC (rev 178692)
+++ trunk/Source/_javascript_Core/jit/ClosureCallStubRoutine.h	2015-01-20 05:01:26 UTC (rev 178693)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2012, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2012, 2014, 2015 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -37,21 +37,17 @@
 public:
     ClosureCallStubRoutine(
         const MacroAssemblerCodeRef&, VM&, const JSCell* owner,
-        ExecutableBase*, const CodeOrigin&);
+        ExecutableBase*);
     
     virtual ~ClosureCallStubRoutine();
     
     ExecutableBase* executable() const { return m_executable.get(); }
-    const CodeOrigin& codeOrigin() const { return m_codeOrigin; }
 
 protected:
     virtual void markRequiredObjectsInternal(SlotVisitor&) override;
 
 private:
     WriteBarrier<ExecutableBase> m_executable;
-    // This allows us to figure out who a call is linked to by searching through
-    // stub routines.
-    CodeOrigin m_codeOrigin;
 };
 
 } // namespace JSC

Modified: trunk/Source/_javascript_Core/jit/Repatch.cpp (178692 => 178693)


--- trunk/Source/_javascript_Core/jit/Repatch.cpp	2015-01-20 04:47:55 UTC (rev 178692)
+++ trunk/Source/_javascript_Core/jit/Repatch.cpp	2015-01-20 05:01:26 UTC (rev 178693)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011, 2012, 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2011-2015 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -1731,7 +1731,7 @@
             ("Closure call stub for %s, return point %p, target %p (%s)",
                 toCString(*callerCodeBlock).data(), callLinkInfo.callReturnLocation.labelAtOffset(0).executableAddress(),
                 codePtr.executableAddress(), toCString(pointerDump(calleeCodeBlock)).data())),
-        *vm, callerCodeBlock->ownerExecutable(), executable, callLinkInfo.codeOrigin));
+        *vm, callerCodeBlock->ownerExecutable(), executable));
     
     RepatchBuffer repatchBuffer(callerCodeBlock);
     
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to