Lines Matching refs:jit
33 #if ENABLE(JIT)
37 static void stringCharLoad(SpecializedThunkJIT& jit)
40 jit.loadJSStringArgument(SpecializedThunkJIT::ThisArgument, SpecializedThunkJIT::regT0);
44 jit.load32(MacroAssembler::Address(SpecializedThunkJIT::regT0, ThunkHelpers::jsStringLengthOffset()), SpecializedThunkJIT::regT2);
45 jit.loadPtr(MacroAssembler::Address(SpecializedThunkJIT::regT0, ThunkHelpers::jsStringValueOffset()), SpecializedThunkJIT::regT0);
46 jit.loadPtr(MacroAssembler::Address(SpecializedThunkJIT::regT0, ThunkHelpers::stringImplDataOffset()), SpecializedThunkJIT::regT0);
49 jit.loadInt32Argument(0, SpecializedThunkJIT::regT1); // regT1 contains the index
52 jit.appendFailure(jit.branch32(MacroAssembler::AboveOrEqual, SpecializedThunkJIT::regT1, SpecializedThunkJIT::regT2));
55 jit.load16(MacroAssembler::BaseIndex(SpecializedThunkJIT::regT0, SpecializedThunkJIT::regT1, MacroAssembler::TimesTwo, 0), SpecializedThunkJIT::regT0);
58 static void charToString(SpecializedThunkJIT& jit, JSGlobalData* globalData, MacroAssembler::RegisterID src, MacroAssembler::RegisterID dst, MacroAssembler::RegisterID scratch)
60 jit.appendFailure(jit.branch32(MacroAssembler::AboveOrEqual, src, MacroAssembler::TrustedImm32(0x100)));
61 jit.move(MacroAssembler::TrustedImmPtr(globalData->smallStrings.singleCharacterStrings()), scratch);
62 jit.loadPtr(MacroAssembler::BaseIndex(scratch, src, MacroAssembler::ScalePtr, 0), dst);
63 jit.appendFailure(jit.branchTestPtr(MacroAssembler::Zero, dst));
68 SpecializedThunkJIT jit(1, globalData, pool);
69 stringCharLoad(jit);
70 jit.returnInt32(SpecializedThunkJIT::regT0);
71 return jit.finalize(globalData->jitStubs->ctiNativeCall());
76 SpecializedThunkJIT jit(1, globalData, pool);
77 stringCharLoad(jit);
78 charToString(jit, globalData, SpecializedThunkJIT::regT0, SpecializedThunkJIT::regT0, SpecializedThunkJIT::regT1);
79 jit.returnJSCell(SpecializedThunkJIT::regT0);
80 return jit.finalize(globalData->jitStubs->ctiNativeCall());
85 SpecializedThunkJIT jit(1, globalData, pool);
87 jit.loadInt32Argument(0, SpecializedThunkJIT::regT0);
88 charToString(jit, globalData, SpecializedThunkJIT::regT0, SpecializedThunkJIT::regT0, SpecializedThunkJIT::regT1);
89 jit.returnJSCell(SpecializedThunkJIT::regT0);
90 return jit.finalize(globalData->jitStubs->ctiNativeCall());
95 SpecializedThunkJIT jit(1, globalData, pool);
96 if (!jit.supportsFloatingPointSqrt())
99 jit.loadDoubleArgument(0, SpecializedThunkJIT::fpRegT0, SpecializedThunkJIT::regT0);
100 jit.sqrtDouble(SpecializedThunkJIT::fpRegT0, SpecializedThunkJIT::fpRegT0);
101 jit.returnDouble(SpecializedThunkJIT::fpRegT0);
102 return jit.finalize(globalData->jitStubs->ctiNativeCall());
110 SpecializedThunkJIT jit(2, globalData, pool);
111 if (!jit.supportsFloatingPoint())
114 jit.loadDouble(&oneConstant, SpecializedThunkJIT::fpRegT1);
115 jit.loadDoubleArgument(0, SpecializedThunkJIT::fpRegT0, SpecializedThunkJIT::regT0);
117 jit.loadInt32Argument(1, SpecializedThunkJIT::regT0, nonIntExponent);
118 jit.appendFailure(jit.branch32(MacroAssembler::LessThan, SpecializedThunkJIT::regT0, MacroAssembler::TrustedImm32(0)));
120 MacroAssembler::Jump exponentIsZero = jit.branchTest32(MacroAssembler::Zero, SpecializedThunkJIT::regT0);
121 MacroAssembler::Label startLoop(jit.label());
123 MacroAssembler::Jump exponentIsEven = jit.branchTest32(MacroAssembler::Zero, SpecializedThunkJIT::regT0, MacroAssembler::TrustedImm32(1));
124 jit.mulDouble(SpecializedThunkJIT::fpRegT0, SpecializedThunkJIT::fpRegT1);
125 exponentIsEven.link(&jit);
126 jit.mulDouble(SpecializedThunkJIT::fpRegT0, SpecializedThunkJIT::fpRegT0);
127 jit.rshift32(MacroAssembler::TrustedImm32(1), SpecializedThunkJIT::regT0);
128 jit.branchTest32(MacroAssembler::NonZero, SpecializedThunkJIT::regT0).linkTo(startLoop, &jit);
130 exponentIsZero.link(&jit);
134 jit.branchConvertDoubleToInt32(SpecializedThunkJIT::fpRegT1, SpecializedThunkJIT::regT0, doubleResult, SpecializedThunkJIT::fpRegT0);
135 jit.returnInt32(SpecializedThunkJIT::regT0);
136 doubleResult.link(&jit);
137 jit.returnDouble(SpecializedThunkJIT::fpRegT1);
140 if (jit.supportsFloatingPointSqrt()) {
141 nonIntExponent.link(&jit);
142 jit.loadDouble(&negativeHalfConstant, SpecializedThunkJIT::fpRegT3);
143 jit.loadDoubleArgument(1, SpecializedThunkJIT::fpRegT2, SpecializedThunkJIT::regT0);
144 jit.appendFailure(jit.branchDouble(MacroAssembler::DoubleLessThanOrEqual, SpecializedThunkJIT::fpRegT0, SpecializedThunkJIT::fpRegT1));
145 jit.appendFailure(jit.branchDouble(MacroAssembler::DoubleNotEqualOrUnordered, SpecializedThunkJIT::fpRegT2, SpecializedThunkJIT::fpRegT3));
146 jit.sqrtDouble(SpecializedThunkJIT::fpRegT0, SpecializedThunkJIT::fpRegT0);
147 jit.divDouble(SpecializedThunkJIT::fpRegT0, SpecializedThunkJIT::fpRegT1);
150 jit.branchConvertDoubleToInt32(SpecializedThunkJIT::fpRegT1, SpecializedThunkJIT::regT0, doubleResult, SpecializedThunkJIT::fpRegT0);
151 jit.returnInt32(SpecializedThunkJIT::regT0);
152 doubleResult.link(&jit);
153 jit.returnDouble(SpecializedThunkJIT::fpRegT1);
155 jit.appendFailure(nonIntExponent);
157 return jit.finalize(globalData->jitStubs->ctiNativeCall());
162 #endif // ENABLE(JIT)