| 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 5074 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5085 } else { | 5085 } else { |
| 5086 __ And(scratch, scratch, Operand(mask)); | 5086 __ And(scratch, scratch, Operand(mask)); |
| 5087 DeoptimizeIf(ne, instr->environment(), scratch, Operand(tag)); | 5087 DeoptimizeIf(ne, instr->environment(), scratch, Operand(tag)); |
| 5088 } | 5088 } |
| 5089 } | 5089 } |
| 5090 } | 5090 } |
| 5091 | 5091 |
| 5092 | 5092 |
| 5093 void LCodeGen::DoCheckValue(LCheckValue* instr) { | 5093 void LCodeGen::DoCheckValue(LCheckValue* instr) { |
| 5094 Register reg = ToRegister(instr->value()); | 5094 Register reg = ToRegister(instr->value()); |
| 5095 Handle<HeapObject> object = instr->hydrogen()->object(); | 5095 Handle<HeapObject> object = instr->hydrogen()->object().handle(); |
| 5096 AllowDeferredHandleDereference smi_check; | 5096 AllowDeferredHandleDereference smi_check; |
| 5097 if (isolate()->heap()->InNewSpace(*object)) { | 5097 if (isolate()->heap()->InNewSpace(*object)) { |
| 5098 Register reg = ToRegister(instr->value()); | 5098 Register reg = ToRegister(instr->value()); |
| 5099 Handle<Cell> cell = isolate()->factory()->NewCell(object); | 5099 Handle<Cell> cell = isolate()->factory()->NewCell(object); |
| 5100 __ li(at, Operand(Handle<Object>(cell))); | 5100 __ li(at, Operand(Handle<Object>(cell))); |
| 5101 __ lw(at, FieldMemOperand(at, Cell::kValueOffset)); | 5101 __ lw(at, FieldMemOperand(at, Cell::kValueOffset)); |
| 5102 DeoptimizeIf(ne, instr->environment(), reg, | 5102 DeoptimizeIf(ne, instr->environment(), reg, |
| 5103 Operand(at)); | 5103 Operand(at)); |
| 5104 } else { | 5104 } else { |
| 5105 DeoptimizeIf(ne, instr->environment(), reg, | 5105 DeoptimizeIf(ne, instr->environment(), reg, |
| (...skipping 30 matching lines...) Expand all Loading... |
| 5136 LCheckMaps* instr_; | 5136 LCheckMaps* instr_; |
| 5137 Label check_maps_; | 5137 Label check_maps_; |
| 5138 Register object_; | 5138 Register object_; |
| 5139 }; | 5139 }; |
| 5140 | 5140 |
| 5141 if (instr->hydrogen()->CanOmitMapChecks()) return; | 5141 if (instr->hydrogen()->CanOmitMapChecks()) return; |
| 5142 Register map_reg = scratch0(); | 5142 Register map_reg = scratch0(); |
| 5143 LOperand* input = instr->value(); | 5143 LOperand* input = instr->value(); |
| 5144 ASSERT(input->IsRegister()); | 5144 ASSERT(input->IsRegister()); |
| 5145 Register reg = ToRegister(input); | 5145 Register reg = ToRegister(input); |
| 5146 SmallMapList* map_set = instr->hydrogen()->map_set(); | |
| 5147 __ lw(map_reg, FieldMemOperand(reg, HeapObject::kMapOffset)); | 5146 __ lw(map_reg, FieldMemOperand(reg, HeapObject::kMapOffset)); |
| 5148 | 5147 |
| 5149 DeferredCheckMaps* deferred = NULL; | 5148 DeferredCheckMaps* deferred = NULL; |
| 5150 if (instr->hydrogen()->has_migration_target()) { | 5149 if (instr->hydrogen()->has_migration_target()) { |
| 5151 deferred = new(zone()) DeferredCheckMaps(this, instr, reg); | 5150 deferred = new(zone()) DeferredCheckMaps(this, instr, reg); |
| 5152 __ bind(deferred->check_maps()); | 5151 __ bind(deferred->check_maps()); |
| 5153 } | 5152 } |
| 5154 | 5153 |
| 5154 UniqueSet<Map> map_set = instr->hydrogen()->map_set(); |
| 5155 Label success; | 5155 Label success; |
| 5156 for (int i = 0; i < map_set->length() - 1; i++) { | 5156 for (int i = 0; i < map_set.size() - 1; i++) { |
| 5157 Handle<Map> map = map_set->at(i); | 5157 Handle<Map> map = map_set.at(i).handle(); |
| 5158 __ CompareMapAndBranch(map_reg, map, &success, eq, &success); | 5158 __ CompareMapAndBranch(map_reg, map, &success, eq, &success); |
| 5159 } | 5159 } |
| 5160 Handle<Map> map = map_set->last(); | 5160 Handle<Map> map = map_set.at(map_set.size() - 1).handle(); |
| 5161 // Do the CompareMap() directly within the Branch() and DeoptimizeIf(). | 5161 // Do the CompareMap() directly within the Branch() and DeoptimizeIf(). |
| 5162 if (instr->hydrogen()->has_migration_target()) { | 5162 if (instr->hydrogen()->has_migration_target()) { |
| 5163 __ Branch(deferred->entry(), ne, map_reg, Operand(map)); | 5163 __ Branch(deferred->entry(), ne, map_reg, Operand(map)); |
| 5164 } else { | 5164 } else { |
| 5165 DeoptimizeIf(ne, instr->environment(), map_reg, Operand(map)); | 5165 DeoptimizeIf(ne, instr->environment(), map_reg, Operand(map)); |
| 5166 } | 5166 } |
| 5167 | 5167 |
| 5168 __ bind(&success); | 5168 __ bind(&success); |
| 5169 } | 5169 } |
| 5170 | 5170 |
| (...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5774 __ Subu(scratch, result, scratch); | 5774 __ Subu(scratch, result, scratch); |
| 5775 __ lw(result, FieldMemOperand(scratch, | 5775 __ lw(result, FieldMemOperand(scratch, |
| 5776 FixedArray::kHeaderSize - kPointerSize)); | 5776 FixedArray::kHeaderSize - kPointerSize)); |
| 5777 __ bind(&done); | 5777 __ bind(&done); |
| 5778 } | 5778 } |
| 5779 | 5779 |
| 5780 | 5780 |
| 5781 #undef __ | 5781 #undef __ |
| 5782 | 5782 |
| 5783 } } // namespace v8::internal | 5783 } } // namespace v8::internal |
| OLD | NEW |