| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 #if V8_TARGET_ARCH_X87 | 5 #if V8_TARGET_ARCH_X87 |
| 6 | 6 |
| 7 #include "src/crankshaft/x87/lithium-codegen-x87.h" | 7 #include "src/crankshaft/x87/lithium-codegen-x87.h" |
| 8 | 8 |
| 9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
| 10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
| (...skipping 2454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2465 Register temp = ToRegister(instr->temp()); | 2465 Register temp = ToRegister(instr->temp()); |
| 2466 | 2466 |
| 2467 if (!instr->hydrogen()->value()->type().IsHeapObject()) { | 2467 if (!instr->hydrogen()->value()->type().IsHeapObject()) { |
| 2468 __ JumpIfSmi(input, instr->FalseLabel(chunk_)); | 2468 __ JumpIfSmi(input, instr->FalseLabel(chunk_)); |
| 2469 } | 2469 } |
| 2470 | 2470 |
| 2471 __ CmpObjectType(input, TestType(instr->hydrogen()), temp); | 2471 __ CmpObjectType(input, TestType(instr->hydrogen()), temp); |
| 2472 EmitBranch(instr, BranchCondition(instr->hydrogen())); | 2472 EmitBranch(instr, BranchCondition(instr->hydrogen())); |
| 2473 } | 2473 } |
| 2474 | 2474 |
| 2475 | |
| 2476 void LCodeGen::DoGetCachedArrayIndex(LGetCachedArrayIndex* instr) { | |
| 2477 Register input = ToRegister(instr->value()); | |
| 2478 Register result = ToRegister(instr->result()); | |
| 2479 | |
| 2480 __ AssertString(input); | |
| 2481 | |
| 2482 __ mov(result, FieldOperand(input, String::kHashFieldOffset)); | |
| 2483 __ IndexFromHash(result, result); | |
| 2484 } | |
| 2485 | |
| 2486 | |
| 2487 void LCodeGen::DoHasCachedArrayIndexAndBranch( | |
| 2488 LHasCachedArrayIndexAndBranch* instr) { | |
| 2489 Register input = ToRegister(instr->value()); | |
| 2490 | |
| 2491 __ test(FieldOperand(input, String::kHashFieldOffset), | |
| 2492 Immediate(String::kContainsCachedArrayIndexMask)); | |
| 2493 EmitBranch(instr, equal); | |
| 2494 } | |
| 2495 | |
| 2496 | |
| 2497 // Branches to a label or falls through with the answer in the z flag. Trashes | 2475 // Branches to a label or falls through with the answer in the z flag. Trashes |
| 2498 // the temp registers, but not the input. | 2476 // the temp registers, but not the input. |
| 2499 void LCodeGen::EmitClassOfTest(Label* is_true, | 2477 void LCodeGen::EmitClassOfTest(Label* is_true, |
| 2500 Label* is_false, | 2478 Label* is_false, |
| 2501 Handle<String>class_name, | 2479 Handle<String>class_name, |
| 2502 Register input, | 2480 Register input, |
| 2503 Register temp, | 2481 Register temp, |
| 2504 Register temp2) { | 2482 Register temp2) { |
| 2505 DCHECK(!input.is(temp)); | 2483 DCHECK(!input.is(temp)); |
| 2506 DCHECK(!input.is(temp2)); | 2484 DCHECK(!input.is(temp2)); |
| (...skipping 3168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5675 __ bind(deferred->exit()); | 5653 __ bind(deferred->exit()); |
| 5676 __ bind(&done); | 5654 __ bind(&done); |
| 5677 } | 5655 } |
| 5678 | 5656 |
| 5679 #undef __ | 5657 #undef __ |
| 5680 | 5658 |
| 5681 } // namespace internal | 5659 } // namespace internal |
| 5682 } // namespace v8 | 5660 } // namespace v8 |
| 5683 | 5661 |
| 5684 #endif // V8_TARGET_ARCH_X87 | 5662 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |