Changeset 84660 in webkit
- Timestamp:
- Apr 22, 2011 12:26:04 PM (13 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/API/JSCallbackObjectFunctions.h
r84650 r84660 97 97 HandleHeap::heapFor(slot)->makeWeak(slot, m_callbackObjectData.get(), classRef()); 98 98 HandleHeap::heapFor(slot)->writeBarrier(slot, this); 99 slot->fromJSValue(this);99 *slot = this; 100 100 } 101 101 } -
trunk/Source/JavaScriptCore/ChangeLog
r84654 r84660 1 2011-04-22 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r84650 and r84654. 4 http://trac.webkit.org/changeset/84650 5 http://trac.webkit.org/changeset/84654 6 https://bugs.webkit.org/show_bug.cgi?id=59218 7 8 Broke Windows build (Requested by bweinstein on #webkit). 9 10 * API/JSCallbackObjectFunctions.h: 11 (JSC::::init): 12 * JavaScriptCore.exp: 13 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 14 * heap/Handle.h: 15 (JSC::HandleBase::operator!): 16 (JSC::HandleBase::operator UnspecifiedBoolType*): 17 (JSC::HandleTypes::getFromSlot): 18 * heap/HandleHeap.cpp: 19 (JSC::HandleHeap::markStrongHandles): 20 (JSC::HandleHeap::markWeakHandles): 21 (JSC::HandleHeap::finalizeWeakHandles): 22 (JSC::HandleHeap::writeBarrier): 23 (JSC::HandleHeap::protectedGlobalObjectCount): 24 (JSC::HandleHeap::isValidWeakNode): 25 * heap/HandleHeap.h: 26 (JSC::HandleHeap::copyWeak): 27 (JSC::HandleHeap::makeWeak): 28 (JSC::HandleHeap::Node::slot): 29 * heap/HandleStack.cpp: 30 (JSC::HandleStack::mark): 31 (JSC::HandleStack::grow): 32 * heap/HandleStack.h: 33 (JSC::HandleStack::zapTo): 34 (JSC::HandleStack::push): 35 * heap/Heap.cpp: 36 (JSC::HandleHeap::protectedObjectTypeCounts): 37 * heap/Local.h: 38 (JSC::::set): 39 * heap/Strong.h: 40 (JSC::Strong::set): 41 * heap/Weak.h: 42 (JSC::Weak::set): 43 * runtime/StructureTransitionTable.h: 44 (JSC::StructureTransitionTable::singleTransition): 45 (JSC::StructureTransitionTable::setSingleTransition): 46 * runtime/WeakGCMap.h: 47 (JSC::WeakGCMap::add): 48 (JSC::WeakGCMap::set): 49 * runtime/WriteBarrier.h: 50 1 51 2011-04-22 Brian Weinstein <bweinstein@apple.com> 2 52 -
trunk/Source/JavaScriptCore/JavaScriptCore.exp
r84650 r84660 98 98 _WTFReportFatalError 99 99 __ZN14OpaqueJSString6createERKN3JSC7UStringE 100 __ZN3JSC10HandleHeap12writeBarrierEPNS_ 13OpaqueJSValueERKNS_7JSValueE100 __ZN3JSC10HandleHeap12writeBarrierEPNS_7JSValueERKS1_ 101 101 __ZN3JSC10HandleHeap4growEv 102 102 __ZN3JSC10Identifier11addSlowCaseEPNS_12JSGlobalDataEPN3WTF10StringImplE -
trunk/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def
r84654 r84660 369 369 ?waitForThreadCompletion@WTF@@YAHIPAPAX@Z 370 370 ?writable@PropertyDescriptor@JSC@@QBE_NXZ 371 ?writeBarrier@HandleHeap@JSC@@QAEXPAVJSValue@2@ABV32@@Z 371 372 ?yield@WTF@@YAXXZ 372 373 WTFLog -
trunk/Source/JavaScriptCore/heap/Handle.h
r84650 r84660 54 54 55 55 public: 56 bool operator!() const { return !m_slot || ! m_slot->toJSValue(); }56 bool operator!() const { return !m_slot || !*m_slot; } 57 57 58 58 // This conversion operator allows implicit conversion to bool but not to other integer types. 59 59 typedef JSValue (HandleBase::*UnspecifiedBoolType); 60 operator UnspecifiedBoolType*() const { return (m_slot && m_slot->toJSValue()) ? reinterpret_cast<UnspecifiedBoolType*>(1) : 0; }60 operator UnspecifiedBoolType*() const { return (m_slot && *m_slot) ? reinterpret_cast<UnspecifiedBoolType*>(1) : 0; } 61 61 62 62 protected: … … 80 80 template <typename T> struct HandleTypes { 81 81 typedef T* ExternalType; 82 static ExternalType getFromSlot(HandleSlot slot) { return (slot && slot->toJSValue()) ? reinterpret_cast<ExternalType>(slot->toJSValue().asCell()) : 0; }82 static ExternalType getFromSlot(HandleSlot slot) { return (slot && *slot) ? reinterpret_cast<ExternalType>(slot->asCell()) : 0; } 83 83 static JSValue toJSValue(T* cell) { return reinterpret_cast<JSCell*>(cell); } 84 84 template <typename U> static void validateUpcast() { T* temp; temp = (U*)0; } … … 87 87 template <> struct HandleTypes<Unknown> { 88 88 typedef JSValue ExternalType; 89 static ExternalType getFromSlot(HandleSlot slot) { return slot ? slot->toJSValue(): JSValue(); }89 static ExternalType getFromSlot(HandleSlot slot) { return slot ? *slot : JSValue(); } 90 90 static JSValue toJSValue(const JSValue& v) { return v; } 91 91 template <typename U> static void validateUpcast() {} -
trunk/Source/JavaScriptCore/heap/HandleHeap.cpp
r84650 r84660 65 65 Node* end = m_strongList.end(); 66 66 for (Node* node = m_strongList.begin(); node != end; node = node->next()) 67 heapRootMarker.mark(node->slot() ->toJSValueRef());67 heapRootMarker.mark(node->slot()); 68 68 } 69 69 … … 75 75 for (Node* node = m_weakList.begin(); node != end; node = node->next()) { 76 76 ASSERT(isValidWeakNode(node)); 77 JSCell* cell = node->slot()-> toJSValue().asCell();77 JSCell* cell = node->slot()->asCell(); 78 78 if (Heap::isMarked(cell)) 79 79 continue; … … 86 86 continue; 87 87 88 heapRootVisitor.mark(node->slot() ->toJSValueRef());88 heapRootVisitor.mark(node->slot()); 89 89 } 90 90 } … … 97 97 98 98 ASSERT(isValidWeakNode(node)); 99 JSCell* cell = node->slot()-> toJSValue().asCell();99 JSCell* cell = node->slot()->asCell(); 100 100 if (Heap::isMarked(cell)) 101 101 continue; … … 107 107 } 108 108 109 node->slot()->fromJSValue(JSValue());109 *node->slot() = JSValue(); 110 110 SentinelLinkedList<Node>::remove(node); 111 111 m_immediateList.push(node); … … 119 119 ASSERT(!m_nextToFinalize); // Forbid assignment to handles during the finalization phase, since it would violate many GC invariants. 120 120 121 if (!value == ! slot->toJSValue() && slot->toJSValue().isCell() == value.isCell())121 if (!value == !*slot && slot->isCell() == value.isCell()) 122 122 return; 123 123 … … 142 142 Node* end = m_strongList.end(); 143 143 for (Node* node = m_strongList.begin(); node != end; node = node->next()) { 144 JSValue value = node->slot()->toJSValue();144 JSValue value = *node->slot(); 145 145 if (value.isObject() && asObject(value.asCell())->isGlobalObject()) 146 146 count++; … … 155 155 return false; 156 156 157 JSValue value = node->slot()->toJSValue();157 JSValue value = *node->slot(); 158 158 if (!value || !value.isCell()) 159 159 return false; -
trunk/Source/JavaScriptCore/heap/HandleHeap.h
r84650 r84660 174 174 Node* node = toNode(allocate()); 175 175 node->makeWeak(toNode(other)->weakOwner(), toNode(other)->weakOwnerContext()); 176 writeBarrier(node->slot(), other->toJSValue());177 node->slot()->fromJSValue(other->toJSValue());176 writeBarrier(node->slot(), *other); 177 *node->slot() = *other; 178 178 return toHandle(node); 179 179 } … … 185 185 186 186 SentinelLinkedList<Node>::remove(node); 187 if (! handle->toJSValue() || !handle->toJSValue().isCell()) {187 if (!*handle || !handle->isCell()) { 188 188 m_immediateList.push(node); 189 189 return; … … 216 216 inline HandleSlot HandleHeap::Node::slot() 217 217 { 218 return reinterpret_cast<HandleSlot>(&m_value);218 return &m_value; 219 219 } 220 220 -
trunk/Source/JavaScriptCore/heap/HandleStack.cpp
r84650 r84660 42 42 void HandleStack::mark(HeapRootVisitor& heapRootMarker) 43 43 { 44 const Vector< JSValue*>& blocks = m_blockStack.blocks();44 const Vector<HandleSlot>& blocks = m_blockStack.blocks(); 45 45 size_t blockLength = m_blockStack.blockLength; 46 46 47 47 int end = blocks.size() - 1; 48 48 for (int i = 0; i < end; ++i) { 49 JSValue*block = blocks[i];49 HandleSlot block = blocks[i]; 50 50 heapRootMarker.mark(block, blockLength); 51 51 } 52 JSValue*block = blocks[end];52 HandleSlot block = blocks[end]; 53 53 heapRootMarker.mark(block, m_frame.m_next - block); 54 54 } … … 56 56 void HandleStack::grow() 57 57 { 58 JSValue*block = m_blockStack.grow();58 HandleSlot block = m_blockStack.grow(); 59 59 m_frame.m_next = block; 60 60 m_frame.m_end = block + m_blockStack.blockLength; -
trunk/Source/JavaScriptCore/heap/HandleStack.h
r84650 r84660 42 42 class Frame { 43 43 public: 44 JSValue*m_next;45 JSValue*m_end;44 HandleSlot m_next; 45 HandleSlot m_end; 46 46 }; 47 47 … … 83 83 UNUSED_PARAM(lastFrame); 84 84 #else 85 const Vector< JSValue*>& blocks = m_blockStack.blocks();85 const Vector<HandleSlot>& blocks = m_blockStack.blocks(); 86 86 87 87 if (lastFrame.m_end != m_frame.m_end) { // Zapping to a frame in a different block. … … 92 92 } 93 93 94 for ( JSValue*it = blocks[i] + m_blockStack.blockLength - 1; it != lastFrame.m_next - 1; --it)94 for (HandleSlot it = blocks[i] + m_blockStack.blockLength - 1; it != lastFrame.m_next - 1; --it) 95 95 *it = JSValue(); 96 96 … … 98 98 } 99 99 100 for ( JSValue*it = m_frame.m_next - 1; it != lastFrame.m_next - 1; --it)100 for (HandleSlot it = m_frame.m_next - 1; it != lastFrame.m_next - 1; --it) 101 101 *it = JSValue(); 102 102 #endif … … 122 122 if (m_frame.m_next == m_frame.m_end) 123 123 grow(); 124 return reinterpret_cast<HandleSlot>(m_frame.m_next++);124 return m_frame.m_next++; 125 125 } 126 126 -
trunk/Source/JavaScriptCore/heap/Heap.cpp
r84650 r84660 364 364 Node* end = m_strongList.end(); 365 365 for (Node* node = m_strongList.begin(); node != end; node = node->next()) { 366 JSValue value = node->slot()->toJSValue();366 JSValue value = *node->slot(); 367 367 if (value && value.isCell()) 368 368 typeCounter(value.asCell()); -
trunk/Source/JavaScriptCore/heap/Local.h
r84650 r84660 96 96 ASSERT(slot()); 97 97 ASSERT(!HandleTypes<T>::toJSValue(externalType) || !HandleTypes<T>::toJSValue(externalType).isCell() || Heap::isMarked(HandleTypes<T>::toJSValue(externalType).asCell())); 98 slot()->fromJSValue(externalType);98 *slot() = externalType; 99 99 } 100 100 -
trunk/Source/JavaScriptCore/heap/Strong.h
r84650 r84660 141 141 JSValue value = HandleTypes<T>::toJSValue(externalType); 142 142 HandleHeap::heapFor(slot())->writeBarrier(slot(), value); 143 slot()->fromJSValue(value);143 *slot() = value; 144 144 } 145 145 }; -
trunk/Source/JavaScriptCore/heap/Weak.h
r84650 r84660 132 132 ASSERT(!value || !value.isCell() || Heap::isMarked(value.asCell())); 133 133 HandleHeap::heapFor(slot())->writeBarrier(slot(), value); 134 slot()->fromJSValue(value);134 *slot() = value; 135 135 } 136 136 }; -
trunk/Source/JavaScriptCore/runtime/StructureTransitionTable.h
r84650 r84660 140 140 ASSERT(isUsingSingleSlot()); 141 141 if (HandleSlot slot = this->slot()) { 142 if ( slot->toJSValue())143 return reinterpret_cast<Structure*>(slot-> toJSValue().asCell());142 if (*slot) 143 return reinterpret_cast<Structure*>(slot->asCell()); 144 144 } 145 145 return 0; … … 163 163 } 164 164 HandleHeap::heapFor(slot)->writeBarrier(slot, reinterpret_cast<JSCell*>(structure)); 165 slot->fromJSValue(reinterpret_cast<JSCell*>(structure));165 *slot = reinterpret_cast<JSCell*>(structure); 166 166 } 167 167 -
trunk/Source/JavaScriptCore/runtime/WeakGCMap.h
r84650 r84660 130 130 HandleHeap::heapFor(slot)->makeWeak(slot, this, FinalizerCallback::finalizerContextFor(key)); 131 131 HandleHeap::heapFor(slot)->writeBarrier(slot, value); 132 slot->fromJSValue(value);132 *slot = value; 133 133 } 134 134 return iter; … … 140 140 ASSERT(slot); 141 141 HandleHeap::heapFor(slot)->writeBarrier(slot, value); 142 slot->fromJSValue(value);142 *slot = value; 143 143 } 144 144 … … 153 153 } 154 154 HandleHeap::heapFor(slot)->writeBarrier(slot, value); 155 slot->fromJSValue(value);155 *slot = value; 156 156 } 157 157 -
trunk/Source/JavaScriptCore/runtime/WriteBarrier.h
r84650 r84660 42 42 43 43 typedef enum { } Unknown; 44 class OpaqueJSValue : private JSValue { 45 public: 46 JSValue& toJSValue() { return *this; } 47 JSValue* toJSValueRef() { return this; } 48 void fromJSValue(const JSValue& value) { *this = static_cast<const OpaqueJSValue&>(value); } 49 }; 50 typedef OpaqueJSValue* HandleSlot; 44 typedef JSValue* HandleSlot; 51 45 52 46 template <typename T> struct JSValueChecker {
Note: See TracChangeset
for help on using the changeset viewer.