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 5087 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5098 } else { | 5098 } else { |
5099 __ And(scratch, scratch, Operand(mask)); | 5099 __ And(scratch, scratch, Operand(mask)); |
5100 DeoptimizeIf(ne, instr->environment(), scratch, Operand(tag)); | 5100 DeoptimizeIf(ne, instr->environment(), scratch, Operand(tag)); |
5101 } | 5101 } |
5102 } | 5102 } |
5103 } | 5103 } |
5104 | 5104 |
5105 | 5105 |
5106 void LCodeGen::DoCheckValue(LCheckValue* instr) { | 5106 void LCodeGen::DoCheckValue(LCheckValue* instr) { |
5107 Register reg = ToRegister(instr->value()); | 5107 Register reg = ToRegister(instr->value()); |
5108 Handle<HeapObject> object = instr->hydrogen()->object(); | 5108 Handle<HeapObject> object = instr->hydrogen()->object().handle(); |
5109 AllowDeferredHandleDereference smi_check; | 5109 AllowDeferredHandleDereference smi_check; |
5110 if (isolate()->heap()->InNewSpace(*object)) { | 5110 if (isolate()->heap()->InNewSpace(*object)) { |
5111 Register reg = ToRegister(instr->value()); | 5111 Register reg = ToRegister(instr->value()); |
5112 Handle<Cell> cell = isolate()->factory()->NewCell(object); | 5112 Handle<Cell> cell = isolate()->factory()->NewCell(object); |
5113 __ li(at, Operand(Handle<Object>(cell))); | 5113 __ li(at, Operand(Handle<Object>(cell))); |
5114 __ lw(at, FieldMemOperand(at, Cell::kValueOffset)); | 5114 __ lw(at, FieldMemOperand(at, Cell::kValueOffset)); |
5115 DeoptimizeIf(ne, instr->environment(), reg, | 5115 DeoptimizeIf(ne, instr->environment(), reg, |
5116 Operand(at)); | 5116 Operand(at)); |
5117 } else { | 5117 } else { |
5118 DeoptimizeIf(ne, instr->environment(), reg, | 5118 DeoptimizeIf(ne, instr->environment(), reg, |
(...skipping 30 matching lines...) Expand all Loading... |
5149 LCheckMaps* instr_; | 5149 LCheckMaps* instr_; |
5150 Label check_maps_; | 5150 Label check_maps_; |
5151 Register object_; | 5151 Register object_; |
5152 }; | 5152 }; |
5153 | 5153 |
5154 if (instr->hydrogen()->CanOmitMapChecks()) return; | 5154 if (instr->hydrogen()->CanOmitMapChecks()) return; |
5155 Register map_reg = scratch0(); | 5155 Register map_reg = scratch0(); |
5156 LOperand* input = instr->value(); | 5156 LOperand* input = instr->value(); |
5157 ASSERT(input->IsRegister()); | 5157 ASSERT(input->IsRegister()); |
5158 Register reg = ToRegister(input); | 5158 Register reg = ToRegister(input); |
5159 SmallMapList* map_set = instr->hydrogen()->map_set(); | |
5160 __ lw(map_reg, FieldMemOperand(reg, HeapObject::kMapOffset)); | 5159 __ lw(map_reg, FieldMemOperand(reg, HeapObject::kMapOffset)); |
5161 | 5160 |
5162 DeferredCheckMaps* deferred = NULL; | 5161 DeferredCheckMaps* deferred = NULL; |
5163 if (instr->hydrogen()->has_migration_target()) { | 5162 if (instr->hydrogen()->has_migration_target()) { |
5164 deferred = new(zone()) DeferredCheckMaps(this, instr, reg); | 5163 deferred = new(zone()) DeferredCheckMaps(this, instr, reg); |
5165 __ bind(deferred->check_maps()); | 5164 __ bind(deferred->check_maps()); |
5166 } | 5165 } |
5167 | 5166 |
| 5167 UniqueSet<Map> map_set = instr->hydrogen()->map_set(); |
5168 Label success; | 5168 Label success; |
5169 for (int i = 0; i < map_set->length() - 1; i++) { | 5169 for (int i = 0; i < map_set.size() - 1; i++) { |
5170 Handle<Map> map = map_set->at(i); | 5170 Handle<Map> map = map_set.at(i).handle(); |
5171 __ CompareMapAndBranch(map_reg, map, &success, eq, &success); | 5171 __ CompareMapAndBranch(map_reg, map, &success, eq, &success); |
5172 } | 5172 } |
5173 Handle<Map> map = map_set->last(); | 5173 Handle<Map> map = map_set.at(map_set.size() - 1).handle(); |
5174 // Do the CompareMap() directly within the Branch() and DeoptimizeIf(). | 5174 // Do the CompareMap() directly within the Branch() and DeoptimizeIf(). |
5175 if (instr->hydrogen()->has_migration_target()) { | 5175 if (instr->hydrogen()->has_migration_target()) { |
5176 __ Branch(deferred->entry(), ne, map_reg, Operand(map)); | 5176 __ Branch(deferred->entry(), ne, map_reg, Operand(map)); |
5177 } else { | 5177 } else { |
5178 DeoptimizeIf(ne, instr->environment(), map_reg, Operand(map)); | 5178 DeoptimizeIf(ne, instr->environment(), map_reg, Operand(map)); |
5179 } | 5179 } |
5180 | 5180 |
5181 __ bind(&success); | 5181 __ bind(&success); |
5182 } | 5182 } |
5183 | 5183 |
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5787 __ Subu(scratch, result, scratch); | 5787 __ Subu(scratch, result, scratch); |
5788 __ lw(result, FieldMemOperand(scratch, | 5788 __ lw(result, FieldMemOperand(scratch, |
5789 FixedArray::kHeaderSize - kPointerSize)); | 5789 FixedArray::kHeaderSize - kPointerSize)); |
5790 __ bind(&done); | 5790 __ bind(&done); |
5791 } | 5791 } |
5792 | 5792 |
5793 | 5793 |
5794 #undef __ | 5794 #undef __ |
5795 | 5795 |
5796 } } // namespace v8::internal | 5796 } } // namespace v8::internal |
OLD | NEW |