Changeset 70749 in webkit
- Timestamp:
- Oct 28, 2010 12:00:37 AM (14 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/API/APICast.h
r55633 r70749 112 112 return 0; 113 113 if (!v.isCell()) 114 return reinterpret_cast<JSValueRef>( asCell(JSC::jsAPIValueWrapper(exec, v)));115 return reinterpret_cast<JSValueRef>( asCell(v));114 return reinterpret_cast<JSValueRef>(JSC::jsAPIValueWrapper(exec, v).asCell()); 115 return reinterpret_cast<JSValueRef>(v.asCell()); 116 116 #else 117 117 UNUSED_PARAM(exec); -
trunk/JavaScriptCore/ChangeLog
r70736 r70749 1 2010-10-28 Xan Lopez <xlopez@igalia.com> 2 3 Reviewed by Oliver Hunt. 4 5 Do not have two different asCell APIs in JSValue 6 https://bugs.webkit.org/show_bug.cgi?id=47979 7 8 Remove JSCell* asCell(JSValue) in favor of only using 9 JSValue::asCell(). 10 11 * API/APICast.h: 12 (toRef): 13 * jit/JITPropertyAccess32_64.cpp: 14 (JSC::JIT::testPrototype): 15 * jit/JITStubs.cpp: 16 (JSC::JITThunks::tryCachePutByID): 17 (JSC::JITThunks::tryCacheGetByID): 18 (JSC::DEFINE_STUB_FUNCTION): 19 * runtime/GetterSetter.h: 20 (JSC::asGetterSetter): 21 * runtime/JSByteArray.h: 22 (JSC::asByteArray): 23 * runtime/JSCell.h: 24 (JSC::JSCell::getCallData): 25 (JSC::JSCell::getConstructData): 26 * runtime/JSString.h: 27 (JSC::RopeBuilder::appendValueInConstructAndIncrementLength): 28 (JSC::asString): 29 * runtime/JSValue.h: 30 * runtime/Operations.cpp: 31 (JSC::jsIsObjectType): 32 * runtime/Operations.h: 33 (JSC::normalizePrototypeChain): 34 * runtime/Protect.h: 35 (JSC::gcProtect): 36 (JSC::gcUnprotect): 37 1 38 2010-10-27 Chao-ying Fu <fu@mips.com> 2 39 -
trunk/JavaScriptCore/interpreter/Interpreter.cpp
r70703 r70749 1206 1206 } 1207 1207 1208 JSCell* baseCell = asCell(baseValue);1208 JSCell* baseCell = baseValue.asCell(); 1209 1209 Structure* structure = baseCell->structure(); 1210 1210 … … 1296 1296 } 1297 1297 1298 Structure* structure = asCell(baseValue)->structure();1298 Structure* structure = baseValue.asCell()->structure(); 1299 1299 1300 1300 if (structure->isUncacheableDictionary()) { … … 1634 1634 } 1635 1635 1636 callFrame->r(dst) = jsBoolean(!src.isCell() || ! asCell(src)->structure()->typeInfo().masqueradesAsUndefined());1636 callFrame->r(dst) = jsBoolean(!src.isCell() || !src.asCell()->structure()->typeInfo().masqueradesAsUndefined()); 1637 1637 vPC += OPCODE_LENGTH(op_neq_null); 1638 1638 NEXT_INSTRUCTION(); … … 2493 2493 2494 2494 if (LIKELY(baseValue.isCell())) { 2495 JSCell* baseCell = asCell(baseValue);2495 JSCell* baseCell = baseValue.asCell(); 2496 2496 Structure* structure = vPC[4].u.structure; 2497 2497 … … 2524 2524 2525 2525 if (LIKELY(baseValue.isCell())) { 2526 JSCell* baseCell = asCell(baseValue);2526 JSCell* baseCell = baseValue.asCell(); 2527 2527 Structure* structure = vPC[4].u.structure; 2528 2528 … … 2563 2563 2564 2564 if (LIKELY(baseValue.isCell())) { 2565 JSCell* baseCell = asCell(baseValue);2565 JSCell* baseCell = baseValue.asCell(); 2566 2566 Structure* structure = vPC[4].u.structure; 2567 2567 … … 2608 2608 2609 2609 if (LIKELY(baseValue.isCell())) { 2610 JSCell* baseCell = asCell(baseValue);2610 JSCell* baseCell = baseValue.asCell(); 2611 2611 Structure* structure = vPC[4].u.structure; 2612 2612 … … 2689 2689 2690 2690 if (LIKELY(baseValue.isCell())) { 2691 JSCell* baseCell = asCell(baseValue);2691 JSCell* baseCell = baseValue.asCell(); 2692 2692 Structure* structure = vPC[4].u.structure; 2693 2693 … … 2738 2738 2739 2739 if (LIKELY(baseValue.isCell())) { 2740 JSCell* baseCell = asCell(baseValue);2740 JSCell* baseCell = baseValue.asCell(); 2741 2741 Structure* structure = vPC[4].u.structure; 2742 2742 … … 2781 2781 2782 2782 if (LIKELY(baseValue.isCell())) { 2783 JSCell* baseCell = asCell(baseValue);2783 JSCell* baseCell = baseValue.asCell(); 2784 2784 Structure* structure = vPC[4].u.structure; 2785 2785 … … 2838 2838 2839 2839 if (LIKELY(baseValue.isCell())) { 2840 JSCell* baseCell = asCell(baseValue);2840 JSCell* baseCell = baseValue.asCell(); 2841 2841 Structure* structure = vPC[4].u.structure; 2842 2842 … … 2893 2893 2894 2894 if (LIKELY(baseValue.isCell())) { 2895 JSCell* baseCell = asCell(baseValue);2895 JSCell* baseCell = baseValue.asCell(); 2896 2896 Structure* structure = vPC[4].u.structure; 2897 2897 … … 3019 3019 3020 3020 if (LIKELY(baseValue.isCell())) { 3021 JSCell* baseCell = asCell(baseValue);3021 JSCell* baseCell = baseValue.asCell(); 3022 3022 Structure* oldStructure = vPC[4].u.structure; 3023 3023 Structure* newStructure = vPC[5].u.structure; … … 3071 3071 3072 3072 if (LIKELY(baseValue.isCell())) { 3073 JSCell* baseCell = asCell(baseValue);3073 JSCell* baseCell = baseValue.asCell(); 3074 3074 Structure* structure = vPC[4].u.structure; 3075 3075 -
trunk/JavaScriptCore/jit/JITPropertyAccess32_64.cpp
r66846 r70749 596 596 // two less instructions and doesn't require any scratch registers. 597 597 #if CPU(X86_64) 598 move(ImmPtr( asCell(prototype)->structure()), regT3);599 failureCases.append(branchPtr(NotEqual, AbsoluteAddress(& asCell(prototype)->m_structure), regT3));598 move(ImmPtr(prototype.asCell()->structure()), regT3); 599 failureCases.append(branchPtr(NotEqual, AbsoluteAddress(&prototype.asCell()->m_structure), regT3)); 600 600 #else 601 failureCases.append(branchPtr(NotEqual, AbsoluteAddress(& asCell(prototype)->m_structure), ImmPtr(asCell(prototype)->structure())));601 failureCases.append(branchPtr(NotEqual, AbsoluteAddress(&prototype.asCell()->m_structure), ImmPtr(prototype.asCell()->structure()))); 602 602 #endif 603 603 } -
trunk/JavaScriptCore/jit/JITStubs.cpp
r70711 r70749 849 849 } 850 850 851 JSCell* baseCell = asCell(baseValue);851 JSCell* baseCell = baseValue.asCell(); 852 852 Structure* structure = baseCell->structure(); 853 853 … … 917 917 } 918 918 919 JSCell* baseCell = asCell(baseValue);919 JSCell* baseCell = baseValue.asCell(); 920 920 Structure* structure = baseCell->structure(); 921 921 … … 1562 1562 if (baseValue.isCell() 1563 1563 && slot.isCacheableValue() 1564 && !(structure = asCell(baseValue)->structure())->isUncacheableDictionary()1564 && !(structure = baseValue.asCell()->structure())->isUncacheableDictionary() 1565 1565 && (slotBaseObject = asObject(slot.slotBase()))->getPropertySpecificValue(callFrame, ident, specific) 1566 1566 && specific … … 1636 1636 if (baseValue.isCell() 1637 1637 && slot.isCacheable() 1638 && ! asCell(baseValue)->structure()->isUncacheableDictionary()1638 && !baseValue.asCell()->structure()->isUncacheableDictionary() 1639 1639 && slot.slotBase() == baseValue) { 1640 1640 … … 1657 1657 if (listIndex < POLYMORPHIC_LIST_CACHE_SIZE) { 1658 1658 stubInfo->u.getByIdSelfList.listSize++; 1659 JIT::compileGetByIdSelfList(callFrame->scopeChain()->globalData, codeBlock, stubInfo, polymorphicStructureList, listIndex, asCell(baseValue)->structure(), ident, slot, slot.cachedOffset());1659 JIT::compileGetByIdSelfList(callFrame->scopeChain()->globalData, codeBlock, stubInfo, polymorphicStructureList, listIndex, baseValue.asCell()->structure(), ident, slot, slot.cachedOffset()); 1660 1660 1661 1661 if (listIndex == (POLYMORPHIC_LIST_CACHE_SIZE - 1)) … … 1741 1741 CHECK_FOR_EXCEPTION(); 1742 1742 1743 if (!baseValue.isCell() || !slot.isCacheable() || asCell(baseValue)->structure()->isDictionary()) {1743 if (!baseValue.isCell() || !slot.isCacheable() || baseValue.asCell()->structure()->isDictionary()) { 1744 1744 ctiPatchCallByReturnAddress(callFrame->codeBlock(), STUB_RETURN_ADDRESS, FunctionPtr(cti_op_get_by_id_proto_fail)); 1745 1745 return JSValue::encode(result); 1746 1746 } 1747 1747 1748 Structure* structure = asCell(baseValue)->structure();1748 Structure* structure = baseValue.asCell()->structure(); 1749 1749 CodeBlock* codeBlock = callFrame->codeBlock(); 1750 1750 StructureStubInfo* stubInfo = &codeBlock->getStubInfo(STUB_RETURN_ADDRESS); … … 1757 1757 if (slot.slotBase() == baseValue) 1758 1758 ctiPatchCallByReturnAddress(codeBlock, STUB_RETURN_ADDRESS, FunctionPtr(cti_op_get_by_id_proto_fail)); 1759 else if (slot.slotBase() == asCell(baseValue)->structure()->prototypeForLookup(callFrame)) {1760 ASSERT(! asCell(baseValue)->structure()->isDictionary());1759 else if (slot.slotBase() == baseValue.asCell()->structure()->prototypeForLookup(callFrame)) { 1760 ASSERT(!baseValue.asCell()->structure()->isDictionary()); 1761 1761 // Since we're accessing a prototype in a loop, it's a good bet that it 1762 1762 // should not be treated as a dictionary. … … 1775 1775 } 1776 1776 } else if (size_t count = normalizePrototypeChain(callFrame, baseValue, slot.slotBase(), propertyName, offset)) { 1777 ASSERT(! asCell(baseValue)->structure()->isDictionary());1777 ASSERT(!baseValue.asCell()->structure()->isDictionary()); 1778 1778 int listIndex; 1779 1779 PolymorphicAccessStructureList* prototypeStructureList = getPolymorphicAccessStructureListSlot(stubInfo, listIndex); … … 2366 2366 if (LIKELY(baseValue.isCell() && subscript.isString())) { 2367 2367 Identifier propertyName(callFrame, asString(subscript)->value(callFrame)); 2368 PropertySlot slot( asCell(baseValue));2368 PropertySlot slot(baseValue.asCell()); 2369 2369 // JSString::value may have thrown, but we shouldn't find a property with a null identifier, 2370 2370 // so we should miss this case and wind up in the CHECK_FOR_EXCEPTION_AT_END, below. 2371 if ( asCell(baseValue)->fastGetOwnPropertySlot(callFrame, propertyName, slot)) {2371 if (baseValue.asCell()->fastGetOwnPropertySlot(callFrame, propertyName, slot)) { 2372 2372 JSValue result = slot.getValue(callFrame, propertyName); 2373 2373 CHECK_FOR_EXCEPTION(); … … 2902 2902 if (src2.isUndefined()) { 2903 2903 return src1.isNull() || 2904 (src1.isCell() && asCell(src1)->structure()->typeInfo().masqueradesAsUndefined()) ||2905 src1.isUndefined();2904 (src1.isCell() && src1.asCell()->structure()->typeInfo().masqueradesAsUndefined()) 2905 || src1.isUndefined(); 2906 2906 } 2907 2907 2908 2908 if (src2.isNull()) { 2909 2909 return src1.isUndefined() || 2910 (src1.isCell() && asCell(src1)->structure()->typeInfo().masqueradesAsUndefined()) ||2911 src1.isNull();2910 (src1.isCell() && src1.asCell()->structure()->typeInfo().masqueradesAsUndefined()) 2911 || src1.isNull(); 2912 2912 } 2913 2913 … … 2945 2945 2946 2946 if (src1.isUndefined()) 2947 return src2.isCell() && asCell(src2)->structure()->typeInfo().masqueradesAsUndefined();2947 return src2.isCell() && src2.asCell()->structure()->typeInfo().masqueradesAsUndefined(); 2948 2948 2949 2949 if (src1.isNull()) 2950 return src2.isCell() && asCell(src2)->structure()->typeInfo().masqueradesAsUndefined();2951 2952 JSCell* cell1 = asCell(src1);2950 return src2.isCell() && src2.asCell()->structure()->typeInfo().masqueradesAsUndefined(); 2951 2952 JSCell* cell1 = src1.asCell(); 2953 2953 2954 2954 if (cell1->isString()) { … … 2965 2965 return jsToNumber(static_cast<JSString*>(cell1)->value(stackFrame.callFrame)) == 0.0; 2966 2966 2967 JSCell* cell2 = asCell(src2);2967 JSCell* cell2 = src2.asCell(); 2968 2968 if (cell2->isString()) 2969 2969 return static_cast<JSString*>(cell1)->value(stackFrame.callFrame) == static_cast<JSString*>(cell2)->value(stackFrame.callFrame); -
trunk/JavaScriptCore/runtime/GetterSetter.h
r55185 r70749 65 65 inline GetterSetter* asGetterSetter(JSValue value) 66 66 { 67 ASSERT( asCell(value)->isGetterSetter());68 return static_cast<GetterSetter*>( asCell(value));67 ASSERT(value.asCell()->isGetterSetter()); 68 return static_cast<GetterSetter*>(value.asCell()); 69 69 } 70 70 -
trunk/JavaScriptCore/runtime/JSByteArray.h
r70496 r70749 107 107 inline JSByteArray* asByteArray(JSValue value) 108 108 { 109 return static_cast<JSByteArray*>( asCell(value));109 return static_cast<JSByteArray*>(value.asCell()); 110 110 } 111 111 -
trunk/JavaScriptCore/runtime/JSCell.h
r70111 r70749 217 217 inline CallType getCallData(JSValue value, CallData& callData) 218 218 { 219 CallType result = value.isCell() ? asCell(value)->getCallData(callData) : CallTypeNone;219 CallType result = value.isCell() ? value.asCell()->getCallData(callData) : CallTypeNone; 220 220 ASSERT(result == CallTypeNone || value.isValidCallee()); 221 221 return result; … … 224 224 inline ConstructType getConstructData(JSValue value, ConstructData& constructData) 225 225 { 226 ConstructType result = value.isCell() ? asCell(value)->getConstructData(constructData) : ConstructTypeNone;226 ConstructType result = value.isCell() ? value.asCell()->getConstructData(constructData) : ConstructTypeNone; 227 227 ASSERT(result == ConstructTypeNone || value.isValidCallee()); 228 228 return result; -
trunk/JavaScriptCore/runtime/JSString.h
r70496 r70749 380 380 { 381 381 if (v.isString()) { 382 ASSERT( asCell(v)->isString());383 JSString* s = static_cast<JSString*>( asCell(v));382 ASSERT(v.asCell()->isString()); 383 JSString* s = static_cast<JSString*>(v.asCell()); 384 384 ASSERT(s->fiberCount() == 1); 385 385 appendStringInConstruct(index, s); … … 452 452 inline JSString* asString(JSValue value) 453 453 { 454 ASSERT( asCell(value)->isString());455 return static_cast<JSString*>( asCell(value));454 ASSERT(value.asCell()->isString()); 455 return static_cast<JSString*>(value.asCell()); 456 456 } 457 457 -
trunk/JavaScriptCore/runtime/JSValue.h
r70699 r70749 358 358 inline bool operator!=(const JSCell* a, const JSValue b) { return JSValue(a) != b; } 359 359 360 // FIXME: We should deprecate this and just use JSValue::asCell() instead.361 JSCell* asCell(JSValue);362 363 inline JSCell* asCell(JSValue value)364 {365 return value.asCell();366 }367 368 360 ALWAYS_INLINE int32_t JSValue::toInt32(ExecState* exec) const 369 361 { -
trunk/JavaScriptCore/runtime/Operations.cpp
r70496 r70749 86 86 return v.isNull(); 87 87 88 JSType type = asCell(v)->structure()->typeInfo().type();88 JSType type = v.asCell()->structure()->typeInfo().type(); 89 89 if (type == NumberType || type == StringType) 90 90 return false; -
trunk/JavaScriptCore/runtime/Operations.h
r70496 r70749 413 413 inline size_t normalizePrototypeChain(CallFrame* callFrame, JSValue base, JSValue slotBase, const Identifier& propertyName, size_t& slotOffset) 414 414 { 415 JSCell* cell = asCell(base);415 JSCell* cell = base.asCell(); 416 416 size_t count = 0; 417 417 … … 425 425 return 0; 426 426 427 cell = asCell(v);427 cell = v.asCell(); 428 428 429 429 // Since we're accessing a prototype in a loop, it's a good bet that it … … 450 450 return count; 451 451 452 base = asCell(v);452 base = v.asCell(); 453 453 454 454 // Since we're accessing a prototype in a loop, it's a good bet that it -
trunk/JavaScriptCore/runtime/Protect.h
r49734 r70749 53 53 { 54 54 if (value && value.isCell()) 55 gcProtect( asCell(value));55 gcProtect(value.asCell()); 56 56 } 57 57 … … 59 59 { 60 60 if (value && value.isCell()) 61 gcUnprotect( asCell(value));61 gcUnprotect(value.asCell()); 62 62 } 63 63
Note: See TracChangeset
for help on using the changeset viewer.