Title: [238031] trunk/Source
Revision
238031
Author
[email protected]
Date
2018-11-09 08:40:07 -0800 (Fri, 09 Nov 2018)

Log Message

LLInt VectorSizeOffset should be based on offset extraction
https://bugs.webkit.org/show_bug.cgi?id=191468

Reviewed by Yusuke Suzuki.

Source/_javascript_Core:

This patch also adds some usings to LLIntOffsetsExtractor that
make it possible to use the bare names of Vector/RefCountedArray
in offsets extraction.

* llint/LLIntOffsetsExtractor.cpp:
* llint/LowLevelInterpreter.asm:

Source/WTF:

Make things friends with LLIntOffsetsExtractor.

* wtf/RefCountedArray.h:
* wtf/Vector.h:

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (238030 => 238031)


--- trunk/Source/_javascript_Core/ChangeLog	2018-11-09 16:15:04 UTC (rev 238030)
+++ trunk/Source/_javascript_Core/ChangeLog	2018-11-09 16:40:07 UTC (rev 238031)
@@ -1,3 +1,17 @@
+2018-11-09  Keith Miller  <[email protected]>
+
+        LLInt VectorSizeOffset should be based on offset extraction
+        https://bugs.webkit.org/show_bug.cgi?id=191468
+
+        Reviewed by Yusuke Suzuki.
+
+        This patch also adds some usings to LLIntOffsetsExtractor that
+        make it possible to use the bare names of Vector/RefCountedArray
+        in offsets extraction.
+
+        * llint/LLIntOffsetsExtractor.cpp:
+        * llint/LowLevelInterpreter.asm:
+
 2018-11-09  Yusuke Suzuki  <[email protected]>
 
         Unreviewed, rolling in CodeCache in r237254

Modified: trunk/Source/_javascript_Core/llint/LLIntOffsetsExtractor.cpp (238030 => 238031)


--- trunk/Source/_javascript_Core/llint/LLIntOffsetsExtractor.cpp	2018-11-09 16:15:04 UTC (rev 238030)
+++ trunk/Source/_javascript_Core/llint/LLIntOffsetsExtractor.cpp	2018-11-09 16:40:07 UTC (rev 238031)
@@ -73,6 +73,10 @@
 #define OFFLINE_ASM_OFFSETOF(clazz, field) (static_cast<unsigned>(OBJECT_OFFSETOF(clazz, field)))
 
 class LLIntOffsetsExtractor {
+    // These types are useful since we can't use '<...>' syntax in LLInt offsets extraction. e.g. Vector<int>::m_data
+    using Vector = WTF::Vector<int>;
+    using RefCountedArray = WTF::RefCountedArray<int>;
+
 public:
     static const int64_t* dummy();
 };

Modified: trunk/Source/_javascript_Core/llint/LowLevelInterpreter.asm (238030 => 238031)


--- trunk/Source/_javascript_Core/llint/LowLevelInterpreter.asm	2018-11-09 16:15:04 UTC (rev 238030)
+++ trunk/Source/_javascript_Core/llint/LowLevelInterpreter.asm	2018-11-09 16:40:07 UTC (rev 238031)
@@ -519,13 +519,8 @@
 
 const BlackThreshold = constexpr blackThreshold
 
-# This must match wtf/Vector.h
-const VectorBufferOffset = 0
-if JSVALUE64
-    const VectorSizeOffset = 12
-else
-    const VectorSizeOffset = 8
-end
+const VectorBufferOffset = Vector::m_buffer
+const VectorSizeOffset = Vector::m_size
 
 # Some common utilities.
 macro crash()
@@ -1216,7 +1211,7 @@
     addp -profileArgSkip, t0 # Use addi because that's what has the peephole
     assert(macro (ok) bpgteq t0, 0, ok end)
     btpz t0, .argumentProfileDone
-    loadp CodeBlock::m_argumentValueProfiles + VectorBufferOffset[t1], t3
+    loadp CodeBlock::m_argumentValueProfiles + RefCountedArray::m_data[t1], t3
     btpz t3, .argumentProfileDone # When we can't JIT, we don't allocate any argument value profiles.
     mulp sizeof ValueProfile, t0, t2 # Aaaaahhhh! Need strength reduction!
     lshiftp 3, t0

Modified: trunk/Source/WTF/ChangeLog (238030 => 238031)


--- trunk/Source/WTF/ChangeLog	2018-11-09 16:15:04 UTC (rev 238030)
+++ trunk/Source/WTF/ChangeLog	2018-11-09 16:40:07 UTC (rev 238031)
@@ -1,3 +1,15 @@
+2018-11-09  Keith Miller  <[email protected]>
+
+        LLInt VectorSizeOffset should be based on offset extraction
+        https://bugs.webkit.org/show_bug.cgi?id=191468
+
+        Reviewed by Yusuke Suzuki.
+
+        Make things friends with LLIntOffsetsExtractor.
+
+        * wtf/RefCountedArray.h:
+        * wtf/Vector.h:
+
 2018-11-09  Jim Mason  <[email protected]>
 
         [WTF] Changes in bug 188867 break non-Linux Unix builds

Modified: trunk/Source/WTF/wtf/RefCountedArray.h (238030 => 238031)


--- trunk/Source/WTF/wtf/RefCountedArray.h	2018-11-09 16:15:04 UTC (rev 238030)
+++ trunk/Source/WTF/wtf/RefCountedArray.h	2018-11-09 16:40:07 UTC (rev 238031)
@@ -235,6 +235,7 @@
             Header::fromPayload(data())->refCount++;
     }
 
+    friend class JSC::LLIntOffsetsExtractor;
     typename PtrTraits::StorageType m_data { nullptr };
 };
 

Modified: trunk/Source/WTF/wtf/Vector.h (238030 => 238031)


--- trunk/Source/WTF/wtf/Vector.h	2018-11-09 16:15:04 UTC (rev 238030)
+++ trunk/Source/WTF/wtf/Vector.h	2018-11-09 16:40:07 UTC (rev 238031)
@@ -40,6 +40,10 @@
 extern "C" void __sanitizer_annotate_contiguous_container(const void* begin, const void* end, const void* old_mid, const void* new_mid);
 #endif
 
+namespace JSC {
+class LLIntOffsetsExtractor;
+}
+
 namespace WTF {
 
 template <bool needsDestruction, typename T>
@@ -428,6 +432,7 @@
     using Base::m_size;
 
 private:
+    friend class JSC::LLIntOffsetsExtractor;
     using Base::m_buffer;
     using Base::m_capacity;
 };
@@ -607,6 +612,7 @@
 private:
     typedef VectorBuffer<T, inlineCapacity> Base;
     typedef VectorTypeOperations<T> TypeOperations;
+    friend class JSC::LLIntOffsetsExtractor;
 
 public:
     typedef T ValueType;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to