| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 2320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2331 void LCodeGen::EmitFalseBranch(InstrType instr, Condition cc) { | 2331 void LCodeGen::EmitFalseBranch(InstrType instr, Condition cc) { |
| 2332 int false_block = instr->FalseDestination(chunk_); | 2332 int false_block = instr->FalseDestination(chunk_); |
| 2333 if (cc == no_condition) { | 2333 if (cc == no_condition) { |
| 2334 __ jmp(chunk_->GetAssemblyLabel(false_block)); | 2334 __ jmp(chunk_->GetAssemblyLabel(false_block)); |
| 2335 } else { | 2335 } else { |
| 2336 __ j(cc, chunk_->GetAssemblyLabel(false_block)); | 2336 __ j(cc, chunk_->GetAssemblyLabel(false_block)); |
| 2337 } | 2337 } |
| 2338 } | 2338 } |
| 2339 | 2339 |
| 2340 | 2340 |
| 2341 void LCodeGen::DoIsNumberAndBranch(LIsNumberAndBranch* instr) { | |
| 2342 Representation r = instr->hydrogen()->value()->representation(); | |
| 2343 if (r.IsSmiOrInteger32() || r.IsDouble()) { | |
| 2344 EmitBranch(instr, no_condition); | |
| 2345 } else { | |
| 2346 ASSERT(r.IsTagged()); | |
| 2347 Register reg = ToRegister(instr->value()); | |
| 2348 HType type = instr->hydrogen()->value()->type(); | |
| 2349 if (type.IsTaggedNumber()) { | |
| 2350 EmitBranch(instr, no_condition); | |
| 2351 } | |
| 2352 __ JumpIfSmi(reg, instr->TrueLabel(chunk_)); | |
| 2353 __ cmp(FieldOperand(reg, HeapObject::kMapOffset), | |
| 2354 factory()->heap_number_map()); | |
| 2355 EmitBranch(instr, equal); | |
| 2356 } | |
| 2357 } | |
| 2358 | |
| 2359 | |
| 2360 void LCodeGen::DoBranch(LBranch* instr) { | 2341 void LCodeGen::DoBranch(LBranch* instr) { |
| 2361 Representation r = instr->hydrogen()->value()->representation(); | 2342 Representation r = instr->hydrogen()->value()->representation(); |
| 2362 if (r.IsSmiOrInteger32()) { | 2343 if (r.IsSmiOrInteger32()) { |
| 2363 Register reg = ToRegister(instr->value()); | 2344 Register reg = ToRegister(instr->value()); |
| 2364 __ test(reg, Operand(reg)); | 2345 __ test(reg, Operand(reg)); |
| 2365 EmitBranch(instr, not_zero); | 2346 EmitBranch(instr, not_zero); |
| 2366 } else if (r.IsDouble()) { | 2347 } else if (r.IsDouble()) { |
| 2367 ASSERT(!info()->IsStub()); | 2348 ASSERT(!info()->IsStub()); |
| 2368 CpuFeatureScope scope(masm(), SSE2); | 2349 CpuFeatureScope scope(masm(), SSE2); |
| 2369 XMMRegister reg = ToDoubleRegister(instr->value()); | 2350 XMMRegister reg = ToDoubleRegister(instr->value()); |
| (...skipping 3999 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6369 FixedArray::kHeaderSize - kPointerSize)); | 6350 FixedArray::kHeaderSize - kPointerSize)); |
| 6370 __ bind(&done); | 6351 __ bind(&done); |
| 6371 } | 6352 } |
| 6372 | 6353 |
| 6373 | 6354 |
| 6374 #undef __ | 6355 #undef __ |
| 6375 | 6356 |
| 6376 } } // namespace v8::internal | 6357 } } // namespace v8::internal |
| 6377 | 6358 |
| 6378 #endif // V8_TARGET_ARCH_IA32 | 6359 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |