OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/compiler/code-generator.h" | 5 #include "src/compiler/code-generator.h" |
6 | 6 |
7 #include "src/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
8 #include "src/compiler/code-generator-impl.h" | 8 #include "src/compiler/code-generator-impl.h" |
9 #include "src/compiler/gap-resolver.h" | 9 #include "src/compiler/gap-resolver.h" |
10 #include "src/compiler/node-matchers.h" | 10 #include "src/compiler/node-matchers.h" |
(...skipping 1191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1202 case kX87Float32ToInt32: { | 1202 case kX87Float32ToInt32: { |
1203 if (!instr->InputAt(0)->IsDoubleRegister()) { | 1203 if (!instr->InputAt(0)->IsDoubleRegister()) { |
1204 __ fld_s(i.InputOperand(0)); | 1204 __ fld_s(i.InputOperand(0)); |
1205 } | 1205 } |
1206 __ TruncateX87TOSToI(i.OutputRegister(0)); | 1206 __ TruncateX87TOSToI(i.OutputRegister(0)); |
1207 if (!instr->InputAt(0)->IsDoubleRegister()) { | 1207 if (!instr->InputAt(0)->IsDoubleRegister()) { |
1208 __ fstp(0); | 1208 __ fstp(0); |
1209 } | 1209 } |
1210 break; | 1210 break; |
1211 } | 1211 } |
| 1212 case kX87Float32ToUint32: { |
| 1213 if (!instr->InputAt(0)->IsDoubleRegister()) { |
| 1214 __ fld_s(i.InputOperand(0)); |
| 1215 } |
| 1216 Label success; |
| 1217 __ TruncateX87TOSToI(i.OutputRegister(0)); |
| 1218 __ test(i.OutputRegister(0), i.OutputRegister(0)); |
| 1219 __ j(positive, &success); |
| 1220 __ push(Immediate(INT32_MIN)); |
| 1221 __ fild_s(Operand(esp, 0)); |
| 1222 __ lea(esp, Operand(esp, kPointerSize)); |
| 1223 __ faddp(); |
| 1224 __ TruncateX87TOSToI(i.OutputRegister(0)); |
| 1225 __ or_(i.OutputRegister(0), Immediate(0x80000000)); |
| 1226 __ bind(&success); |
| 1227 if (!instr->InputAt(0)->IsDoubleRegister()) { |
| 1228 __ fstp(0); |
| 1229 } |
| 1230 break; |
| 1231 } |
1212 case kX87Float64ToInt32: { | 1232 case kX87Float64ToInt32: { |
1213 if (!instr->InputAt(0)->IsDoubleRegister()) { | 1233 if (!instr->InputAt(0)->IsDoubleRegister()) { |
1214 __ fld_d(i.InputOperand(0)); | 1234 __ fld_d(i.InputOperand(0)); |
1215 } | 1235 } |
1216 __ TruncateX87TOSToI(i.OutputRegister(0)); | 1236 __ TruncateX87TOSToI(i.OutputRegister(0)); |
1217 if (!instr->InputAt(0)->IsDoubleRegister()) { | 1237 if (!instr->InputAt(0)->IsDoubleRegister()) { |
1218 __ fstp(0); | 1238 __ fstp(0); |
1219 } | 1239 } |
1220 break; | 1240 break; |
1221 } | 1241 } |
(...skipping 1002 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2224 void CodeGenerator::EnsureSpaceForLazyDeopt() { | 2244 void CodeGenerator::EnsureSpaceForLazyDeopt() { |
2225 is_handler_entry_point = true; | 2245 is_handler_entry_point = true; |
2226 DoEnsureSpaceForLazyDeopt(info(), masm(), last_lazy_deopt_pc_); | 2246 DoEnsureSpaceForLazyDeopt(info(), masm(), last_lazy_deopt_pc_); |
2227 } | 2247 } |
2228 | 2248 |
2229 #undef __ | 2249 #undef __ |
2230 | 2250 |
2231 } // namespace compiler | 2251 } // namespace compiler |
2232 } // namespace internal | 2252 } // namespace internal |
2233 } // namespace v8 | 2253 } // namespace v8 |
OLD | NEW |