OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 2552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2563 Label* fail, | 2563 Label* fail, |
2564 bool is_heap_object) { | 2564 bool is_heap_object) { |
2565 if (!is_heap_object) { | 2565 if (!is_heap_object) { |
2566 JumpIfSmi(obj, fail); | 2566 JumpIfSmi(obj, fail); |
2567 } | 2567 } |
2568 Cmp(FieldOperand(obj, HeapObject::kMapOffset), map); | 2568 Cmp(FieldOperand(obj, HeapObject::kMapOffset), map); |
2569 j(not_equal, fail); | 2569 j(not_equal, fail); |
2570 } | 2570 } |
2571 | 2571 |
2572 | 2572 |
| 2573 void MacroAssembler::DispatchMap(Register obj, |
| 2574 Handle<Map> map, |
| 2575 Handle<Code> success, |
| 2576 bool is_heap_object) { |
| 2577 Label fail; |
| 2578 if (!is_heap_object) { |
| 2579 JumpIfSmi(obj, &fail); |
| 2580 } |
| 2581 Cmp(FieldOperand(obj, HeapObject::kMapOffset), map); |
| 2582 j(equal, success, RelocInfo::CODE_TARGET); |
| 2583 |
| 2584 bind(&fail); |
| 2585 } |
| 2586 |
| 2587 |
2573 void MacroAssembler::AbortIfNotNumber(Register object) { | 2588 void MacroAssembler::AbortIfNotNumber(Register object) { |
2574 Label ok; | 2589 Label ok; |
2575 Condition is_smi = CheckSmi(object); | 2590 Condition is_smi = CheckSmi(object); |
2576 j(is_smi, &ok, Label::kNear); | 2591 j(is_smi, &ok, Label::kNear); |
2577 Cmp(FieldOperand(object, HeapObject::kMapOffset), | 2592 Cmp(FieldOperand(object, HeapObject::kMapOffset), |
2578 isolate()->factory()->heap_number_map()); | 2593 isolate()->factory()->heap_number_map()); |
2579 Assert(equal, "Operand not a number"); | 2594 Assert(equal, "Operand not a number"); |
2580 bind(&ok); | 2595 bind(&ok); |
2581 } | 2596 } |
2582 | 2597 |
(...skipping 1070 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3653 CPU::FlushICache(address_, size_); | 3668 CPU::FlushICache(address_, size_); |
3654 | 3669 |
3655 // Check that the code was patched as expected. | 3670 // Check that the code was patched as expected. |
3656 ASSERT(masm_.pc_ == address_ + size_); | 3671 ASSERT(masm_.pc_ == address_ + size_); |
3657 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); | 3672 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); |
3658 } | 3673 } |
3659 | 3674 |
3660 } } // namespace v8::internal | 3675 } } // namespace v8::internal |
3661 | 3676 |
3662 #endif // V8_TARGET_ARCH_X64 | 3677 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |