Title: [164971] trunk/Source/_javascript_Core
Revision
164971
Author
[email protected]
Date
2014-03-02 22:01:44 -0800 (Sun, 02 Mar 2014)

Log Message

PolymorphicPutByIdList should have a simpler construction API with basically a single entrypoint
https://bugs.webkit.org/show_bug.cgi?id=129591

Reviewed by Michael Saboff.

* bytecode/PolymorphicPutByIdList.cpp:
(JSC::PutByIdAccess::fromStructureStubInfo): This function can figure out the slow path target for itself.
(JSC::PolymorphicPutByIdList::PolymorphicPutByIdList): This constuctor should be private, only from() should call it.
(JSC::PolymorphicPutByIdList::from):
* bytecode/PolymorphicPutByIdList.h:
(JSC::PutByIdAccess::stubRoutine):
* jit/Repatch.cpp:
(JSC::tryBuildPutByIdList): Don't pass the slow path target since it can be derived from the stubInfo.

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (164970 => 164971)


--- trunk/Source/_javascript_Core/ChangeLog	2014-03-03 05:42:29 UTC (rev 164970)
+++ trunk/Source/_javascript_Core/ChangeLog	2014-03-03 06:01:44 UTC (rev 164971)
@@ -1,5 +1,21 @@
 2014-03-02  Filip Pizlo  <[email protected]>
 
+        PolymorphicPutByIdList should have a simpler construction API with basically a single entrypoint
+        https://bugs.webkit.org/show_bug.cgi?id=129591
+
+        Reviewed by Michael Saboff.
+
+        * bytecode/PolymorphicPutByIdList.cpp:
+        (JSC::PutByIdAccess::fromStructureStubInfo): This function can figure out the slow path target for itself.
+        (JSC::PolymorphicPutByIdList::PolymorphicPutByIdList): This constuctor should be private, only from() should call it.
+        (JSC::PolymorphicPutByIdList::from):
+        * bytecode/PolymorphicPutByIdList.h:
+        (JSC::PutByIdAccess::stubRoutine):
+        * jit/Repatch.cpp:
+        (JSC::tryBuildPutByIdList): Don't pass the slow path target since it can be derived from the stubInfo.
+
+2014-03-02  Filip Pizlo  <[email protected]>
+
         Debugging improvements from my gbemu investigation session
         https://bugs.webkit.org/show_bug.cgi?id=129599
 

Modified: trunk/Source/_javascript_Core/bytecode/PolymorphicPutByIdList.cpp (164970 => 164971)


--- trunk/Source/_javascript_Core/bytecode/PolymorphicPutByIdList.cpp	2014-03-03 05:42:29 UTC (rev 164970)
+++ trunk/Source/_javascript_Core/bytecode/PolymorphicPutByIdList.cpp	2014-03-03 06:01:44 UTC (rev 164971)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2012 Apple Inc. All rights reserved.
+ * Copyright (C) 2012, 2014 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -32,10 +32,11 @@
 
 namespace JSC {
 
-PutByIdAccess PutByIdAccess::fromStructureStubInfo(
-    StructureStubInfo& stubInfo,
-    MacroAssemblerCodePtr initialSlowPath)
+PutByIdAccess PutByIdAccess::fromStructureStubInfo(StructureStubInfo& stubInfo)
 {
+    MacroAssemblerCodePtr initialSlowPath =
+        stubInfo.callReturnLocation.labelAtOffset(stubInfo.patch.deltaCallToSlowCase);
+    
     PutByIdAccess result;
     
     switch (stubInfo.accessType) {
@@ -84,18 +85,14 @@
 }
 
 PolymorphicPutByIdList::PolymorphicPutByIdList(
-    PutKind putKind,
-    StructureStubInfo& stubInfo,
-    MacroAssemblerCodePtr initialSlowPath)
+    PutKind putKind, StructureStubInfo& stubInfo)
     : m_kind(putKind)
 {
-    m_list.append(PutByIdAccess::fromStructureStubInfo(stubInfo, initialSlowPath));
+    m_list.append(PutByIdAccess::fromStructureStubInfo(stubInfo));
 }
 
 PolymorphicPutByIdList* PolymorphicPutByIdList::from(
-    PutKind putKind,
-    StructureStubInfo& stubInfo,
-    MacroAssemblerCodePtr initialSlowPath)
+    PutKind putKind, StructureStubInfo& stubInfo)
 {
     if (stubInfo.accessType == access_put_by_id_list)
         return stubInfo.u.putByIdList.list;
@@ -105,7 +102,7 @@
            || stubInfo.accessType == access_put_by_id_transition_direct);
     
     PolymorphicPutByIdList* result =
-        new PolymorphicPutByIdList(putKind, stubInfo, initialSlowPath);
+        new PolymorphicPutByIdList(putKind, stubInfo);
     
     stubInfo.initPutByIdList(result);
     

Modified: trunk/Source/_javascript_Core/bytecode/PolymorphicPutByIdList.h (164970 => 164971)


--- trunk/Source/_javascript_Core/bytecode/PolymorphicPutByIdList.h	2014-03-03 05:42:29 UTC (rev 164970)
+++ trunk/Source/_javascript_Core/bytecode/PolymorphicPutByIdList.h	2014-03-03 06:01:44 UTC (rev 164971)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2012 Apple Inc. All rights reserved.
+ * Copyright (C) 2012, 2014 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -83,9 +83,7 @@
         return result;
     }
     
-    static PutByIdAccess fromStructureStubInfo(
-        StructureStubInfo&,
-        MacroAssemblerCodePtr initialSlowPath);
+    static PutByIdAccess fromStructureStubInfo(StructureStubInfo&);
     
     bool isSet() const { return m_type != Invalid; }
     bool operator!() const { return !isSet(); }
@@ -122,10 +120,10 @@
         return m_chain.get();
     }
     
-    PassRefPtr<JITStubRoutine> stubRoutine() const
+    JITStubRoutine* stubRoutine() const
     {
         ASSERT(isTransition() || isReplace());
-        return m_stubRoutine;
+        return m_stubRoutine.get();
     }
     
     bool visitWeak() const;
@@ -143,20 +141,9 @@
 class PolymorphicPutByIdList {
     WTF_MAKE_FAST_ALLOCATED;
 public:
-    // Initialize from a stub info; this will place one element in the list and it will
-    // be created by converting the stub info's put by id access information into our
-    // PutByIdAccess.
-    PolymorphicPutByIdList(
-        PutKind,
-        StructureStubInfo&,
-        MacroAssemblerCodePtr initialSlowPath);
-
     // Either creates a new polymorphic put list, or returns the one that is already
     // in place.
-    static PolymorphicPutByIdList* from(
-        PutKind,
-        StructureStubInfo&,
-        MacroAssemblerCodePtr initialSlowPath);
+    static PolymorphicPutByIdList* from(PutKind, StructureStubInfo&);
     
     ~PolymorphicPutByIdList();
     
@@ -181,6 +168,11 @@
 private:
     friend class CodeBlock;
     
+    // Initialize from a stub info; this will place one element in the list and it will
+    // be created by converting the stub info's put by id access information into our
+    // PutByIdAccess.
+    PolymorphicPutByIdList(PutKind, StructureStubInfo&);
+
     Vector<PutByIdAccess, 2> m_list;
     PutKind m_kind;
 };

Modified: trunk/Source/_javascript_Core/jit/Repatch.cpp (164970 => 164971)


--- trunk/Source/_javascript_Core/jit/Repatch.cpp	2014-03-03 05:42:29 UTC (rev 164970)
+++ trunk/Source/_javascript_Core/jit/Repatch.cpp	2014-03-03 06:01:44 UTC (rev 164971)
@@ -1245,9 +1245,7 @@
             StructureChain* prototypeChain = structure->prototypeChain(exec);
             
             // We're now committed to creating the stub. Mogrify the meta-data accordingly.
-            list = PolymorphicPutByIdList::from(
-                putKind, stubInfo,
-                stubInfo.callReturnLocation.labelAtOffset(stubInfo.patch.deltaCallToSlowCase));
+            list = PolymorphicPutByIdList::from(putKind, stubInfo);
             
             emitPutTransitionStub(
                 exec, baseValue, propertyName, slot, stubInfo, putKind,
@@ -1262,9 +1260,7 @@
                     stubRoutine));
         } else {
             // We're now committed to creating the stub. Mogrify the meta-data accordingly.
-            list = PolymorphicPutByIdList::from(
-                putKind, stubInfo,
-                stubInfo.callReturnLocation.labelAtOffset(stubInfo.patch.deltaCallToSlowCase));
+            list = PolymorphicPutByIdList::from(putKind, stubInfo);
             
             emitPutReplaceStub(
                 exec, baseValue, propertyName, slot, stubInfo, putKind,
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to