Changeset 85226 in webkit
- Timestamp:
- Apr 28, 2011 12:29:11 PM (13 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r85224 r85226 1 2011-04-28 Oliver Hunt <oliver@apple.com> 2 3 Reviewed by Gavin Barraclough. 4 5 Only need a single implementation of testPrototype 6 https://bugs.webkit.org/show_bug.cgi?id=59724 7 8 Remove excess copy of identical testPrototype() code 9 10 * jit/JITPropertyAccess.cpp: 11 (JSC::JIT::testPrototype): 12 * jit/JITPropertyAccess32_64.cpp: 13 1 14 2011-04-28 Xan Lopez <xlopez@igalia.com> 2 15 -
trunk/Source/JavaScriptCore/jit/JITPropertyAccess.cpp
r84052 r85226 27 27 28 28 #if ENABLE(JIT) 29 #if USE(JSVALUE64)30 29 #include "JIT.h" 31 30 … … 50 49 51 50 namespace JSC { 51 #if USE(JSVALUE64) 52 52 53 53 JIT::CodePtr JIT::stringGetByValStubGenerator(JSGlobalData* globalData, ExecutablePool* pool) … … 553 553 { 554 554 loadPtr(static_cast<void*>(&base->m_propertyStorage[cachedOffset]), result); 555 }556 557 void JIT::testPrototype(JSValue prototype, JumpList& failureCases)558 {559 if (prototype.isNull())560 return;561 562 // We have a special case for X86_64 here because X86 instructions that take immediate values563 // only take 32 bit immediate values, wheras the pointer constants we are using here are 64 bit564 // values. In the non X86_64 case, the generated code is slightly more efficient because it uses565 // two less instructions and doesn't require any scratch registers.566 #if CPU(X86_64)567 move(TrustedImmPtr(prototype.asCell()->structure()), regT3);568 failureCases.append(branchPtr(NotEqual, AbsoluteAddress(prototype.asCell()->addressOfStructure()), regT3));569 #else570 failureCases.append(branchPtr(NotEqual, AbsoluteAddress(prototype.asCell()->addressOfStructure()), TrustedImmPtr(prototype.asCell()->structure())));571 #endif572 555 } 573 556 … … 1049 1032 #endif // !ENABLE(JIT_OPTIMIZE_PROPERTY_ACCESS) 1050 1033 1034 #endif // USE(JSVALUE64) 1035 1036 void JIT::testPrototype(JSValue prototype, JumpList& failureCases) 1037 { 1038 if (prototype.isNull()) 1039 return; 1040 1041 // We have a special case for X86_64 here because X86 instructions that take immediate values 1042 // only take 32 bit immediate values, wheras the pointer constants we are using here are 64 bit 1043 // values. In the non X86_64 case, the generated code is slightly more efficient because it uses 1044 // two less instructions and doesn't require any scratch registers. 1045 #if CPU(X86_64) 1046 move(TrustedImmPtr(prototype.asCell()->structure()), regT3); 1047 failureCases.append(branchPtr(NotEqual, AbsoluteAddress(prototype.asCell()->addressOfStructure()), regT3)); 1048 #else 1049 failureCases.append(branchPtr(NotEqual, AbsoluteAddress(prototype.asCell()->addressOfStructure()), TrustedImmPtr(prototype.asCell()->structure()))); 1050 #endif 1051 } 1052 1051 1053 } // namespace JSC 1052 1054 1053 #endif // USE(JSVALUE64)1054 1055 #endif // ENABLE(JIT) -
trunk/Source/JavaScriptCore/jit/JITPropertyAccess32_64.cpp
r84052 r85226 568 568 load32(reinterpret_cast<char*>(&base->m_propertyStorage[cachedOffset]) + OBJECT_OFFSETOF(JSValue, u.asBits.payload), resultPayload); 569 569 load32(reinterpret_cast<char*>(&base->m_propertyStorage[cachedOffset]) + OBJECT_OFFSETOF(JSValue, u.asBits.tag), resultTag); 570 }571 572 void JIT::testPrototype(JSValue prototype, JumpList& failureCases)573 {574 if (prototype.isNull())575 return;576 577 // We have a special case for X86_64 here because X86 instructions that take immediate values578 // only take 32 bit immediate values, wheras the pointer constants we are using here are 64 bit579 // values. In the non X86_64 case, the generated code is slightly more efficient because it uses580 // two less instructions and doesn't require any scratch registers.581 #if CPU(X86_64)582 move(TrustedImmPtr(prototype.asCell()->structure()), regT3);583 failureCases.append(branchPtr(NotEqual, AbsoluteAddress(prototype.asCell()->addressOfStructure()), regT3));584 #else585 failureCases.append(branchPtr(NotEqual, AbsoluteAddress(prototype.asCell()->addressOfStructure()), TrustedImmPtr(prototype.asCell()->structure())));586 #endif587 570 } 588 571
Note: See TracChangeset
for help on using the changeset viewer.