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 5588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5599 __ movzx_b(temp, FieldOperand(temp, Map::kInstanceTypeOffset)); | 5599 __ movzx_b(temp, FieldOperand(temp, Map::kInstanceTypeOffset)); |
5600 __ and_(temp, mask); | 5600 __ and_(temp, mask); |
5601 __ cmp(temp, tag); | 5601 __ cmp(temp, tag); |
5602 DeoptimizeIf(not_equal, instr->environment()); | 5602 DeoptimizeIf(not_equal, instr->environment()); |
5603 } | 5603 } |
5604 } | 5604 } |
5605 } | 5605 } |
5606 | 5606 |
5607 | 5607 |
5608 void LCodeGen::DoCheckValue(LCheckValue* instr) { | 5608 void LCodeGen::DoCheckValue(LCheckValue* instr) { |
5609 Handle<HeapObject> object = instr->hydrogen()->object(); | 5609 Handle<HeapObject> object = instr->hydrogen()->object().handle(); |
5610 if (instr->hydrogen()->object_in_new_space()) { | 5610 if (instr->hydrogen()->object_in_new_space()) { |
5611 Register reg = ToRegister(instr->value()); | 5611 Register reg = ToRegister(instr->value()); |
5612 Handle<Cell> cell = isolate()->factory()->NewCell(object); | 5612 Handle<Cell> cell = isolate()->factory()->NewCell(object); |
5613 __ cmp(reg, Operand::ForCell(cell)); | 5613 __ cmp(reg, Operand::ForCell(cell)); |
5614 } else { | 5614 } else { |
5615 Operand operand = ToOperand(instr->value()); | 5615 Operand operand = ToOperand(instr->value()); |
5616 __ cmp(operand, object); | 5616 __ cmp(operand, object); |
5617 } | 5617 } |
5618 DeoptimizeIf(not_equal, instr->environment()); | 5618 DeoptimizeIf(not_equal, instr->environment()); |
5619 } | 5619 } |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5654 Label check_maps_; | 5654 Label check_maps_; |
5655 Register object_; | 5655 Register object_; |
5656 }; | 5656 }; |
5657 | 5657 |
5658 if (instr->hydrogen()->CanOmitMapChecks()) return; | 5658 if (instr->hydrogen()->CanOmitMapChecks()) return; |
5659 | 5659 |
5660 LOperand* input = instr->value(); | 5660 LOperand* input = instr->value(); |
5661 ASSERT(input->IsRegister()); | 5661 ASSERT(input->IsRegister()); |
5662 Register reg = ToRegister(input); | 5662 Register reg = ToRegister(input); |
5663 | 5663 |
5664 SmallMapList* map_set = instr->hydrogen()->map_set(); | |
5665 | |
5666 DeferredCheckMaps* deferred = NULL; | 5664 DeferredCheckMaps* deferred = NULL; |
5667 if (instr->hydrogen()->has_migration_target()) { | 5665 if (instr->hydrogen()->has_migration_target()) { |
5668 deferred = new(zone()) DeferredCheckMaps(this, instr, reg, x87_stack_); | 5666 deferred = new(zone()) DeferredCheckMaps(this, instr, reg, x87_stack_); |
5669 __ bind(deferred->check_maps()); | 5667 __ bind(deferred->check_maps()); |
5670 } | 5668 } |
5671 | 5669 |
| 5670 UniqueSet<Map> map_set = instr->hydrogen()->map_set(); |
5672 Label success; | 5671 Label success; |
5673 for (int i = 0; i < map_set->length() - 1; i++) { | 5672 for (int i = 0; i < map_set.size() - 1; i++) { |
5674 Handle<Map> map = map_set->at(i); | 5673 Handle<Map> map = map_set.at(i).handle(); |
5675 __ CompareMap(reg, map, &success); | 5674 __ CompareMap(reg, map, &success); |
5676 __ j(equal, &success); | 5675 __ j(equal, &success); |
5677 } | 5676 } |
5678 | 5677 |
5679 Handle<Map> map = map_set->last(); | 5678 Handle<Map> map = map_set.at(map_set.size() - 1).handle(); |
5680 __ CompareMap(reg, map, &success); | 5679 __ CompareMap(reg, map, &success); |
5681 if (instr->hydrogen()->has_migration_target()) { | 5680 if (instr->hydrogen()->has_migration_target()) { |
5682 __ j(not_equal, deferred->entry()); | 5681 __ j(not_equal, deferred->entry()); |
5683 } else { | 5682 } else { |
5684 DeoptimizeIf(not_equal, instr->environment()); | 5683 DeoptimizeIf(not_equal, instr->environment()); |
5685 } | 5684 } |
5686 | 5685 |
5687 __ bind(&success); | 5686 __ bind(&success); |
5688 } | 5687 } |
5689 | 5688 |
(...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6369 FixedArray::kHeaderSize - kPointerSize)); | 6368 FixedArray::kHeaderSize - kPointerSize)); |
6370 __ bind(&done); | 6369 __ bind(&done); |
6371 } | 6370 } |
6372 | 6371 |
6373 | 6372 |
6374 #undef __ | 6373 #undef __ |
6375 | 6374 |
6376 } } // namespace v8::internal | 6375 } } // namespace v8::internal |
6377 | 6376 |
6378 #endif // V8_TARGET_ARCH_IA32 | 6377 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |