| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved.7 | 1 // Copyright 2012 the V8 project authors. All rights reserved.7 |
| 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 5146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5157 codegen()->DoDeferredInstanceMigration(instr_, object_); | 5157 codegen()->DoDeferredInstanceMigration(instr_, object_); |
| 5158 } | 5158 } |
| 5159 Label* check_maps() { return &check_maps_; } | 5159 Label* check_maps() { return &check_maps_; } |
| 5160 virtual LInstruction* instr() V8_OVERRIDE { return instr_; } | 5160 virtual LInstruction* instr() V8_OVERRIDE { return instr_; } |
| 5161 private: | 5161 private: |
| 5162 LCheckMaps* instr_; | 5162 LCheckMaps* instr_; |
| 5163 Label check_maps_; | 5163 Label check_maps_; |
| 5164 Register object_; | 5164 Register object_; |
| 5165 }; | 5165 }; |
| 5166 | 5166 |
| 5167 if (instr->hydrogen()->CanOmitMapChecks()) return; | 5167 if (instr->hydrogen()->IsStabilityCheck()) { |
| 5168 const UniqueSet<Map>* maps = instr->hydrogen()->maps(); |
| 5169 for (int i = 0; i < maps->size(); ++i) { |
| 5170 AddStabilityDependency(maps->at(i).handle()); |
| 5171 } |
| 5172 return; |
| 5173 } |
| 5174 |
| 5168 Register map_reg = scratch0(); | 5175 Register map_reg = scratch0(); |
| 5169 LOperand* input = instr->value(); | 5176 LOperand* input = instr->value(); |
| 5170 ASSERT(input->IsRegister()); | 5177 ASSERT(input->IsRegister()); |
| 5171 Register reg = ToRegister(input); | 5178 Register reg = ToRegister(input); |
| 5172 __ lw(map_reg, FieldMemOperand(reg, HeapObject::kMapOffset)); | 5179 __ lw(map_reg, FieldMemOperand(reg, HeapObject::kMapOffset)); |
| 5173 | 5180 |
| 5174 DeferredCheckMaps* deferred = NULL; | 5181 DeferredCheckMaps* deferred = NULL; |
| 5175 if (instr->hydrogen()->has_migration_target()) { | 5182 if (instr->hydrogen()->HasMigrationTarget()) { |
| 5176 deferred = new(zone()) DeferredCheckMaps(this, instr, reg); | 5183 deferred = new(zone()) DeferredCheckMaps(this, instr, reg); |
| 5177 __ bind(deferred->check_maps()); | 5184 __ bind(deferred->check_maps()); |
| 5178 } | 5185 } |
| 5179 | 5186 |
| 5180 const UniqueSet<Map>* maps = instr->hydrogen()->maps(); | 5187 const UniqueSet<Map>* maps = instr->hydrogen()->maps(); |
| 5181 Label success; | 5188 Label success; |
| 5182 for (int i = 0; i < maps->size() - 1; i++) { | 5189 for (int i = 0; i < maps->size() - 1; i++) { |
| 5183 Handle<Map> map = maps->at(i).handle(); | 5190 Handle<Map> map = maps->at(i).handle(); |
| 5184 __ CompareMapAndBranch(map_reg, map, &success, eq, &success); | 5191 __ CompareMapAndBranch(map_reg, map, &success, eq, &success); |
| 5185 } | 5192 } |
| 5186 Handle<Map> map = maps->at(maps->size() - 1).handle(); | 5193 Handle<Map> map = maps->at(maps->size() - 1).handle(); |
| 5187 // Do the CompareMap() directly within the Branch() and DeoptimizeIf(). | 5194 // Do the CompareMap() directly within the Branch() and DeoptimizeIf(). |
| 5188 if (instr->hydrogen()->has_migration_target()) { | 5195 if (instr->hydrogen()->HasMigrationTarget()) { |
| 5189 __ Branch(deferred->entry(), ne, map_reg, Operand(map)); | 5196 __ Branch(deferred->entry(), ne, map_reg, Operand(map)); |
| 5190 } else { | 5197 } else { |
| 5191 DeoptimizeIf(ne, instr->environment(), map_reg, Operand(map)); | 5198 DeoptimizeIf(ne, instr->environment(), map_reg, Operand(map)); |
| 5192 } | 5199 } |
| 5193 | 5200 |
| 5194 __ bind(&success); | 5201 __ bind(&success); |
| 5195 } | 5202 } |
| 5196 | 5203 |
| 5197 | 5204 |
| 5198 void LCodeGen::DoClampDToUint8(LClampDToUint8* instr) { | 5205 void LCodeGen::DoClampDToUint8(LClampDToUint8* instr) { |
| (...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5891 __ lw(result, FieldMemOperand(scratch, | 5898 __ lw(result, FieldMemOperand(scratch, |
| 5892 FixedArray::kHeaderSize - kPointerSize)); | 5899 FixedArray::kHeaderSize - kPointerSize)); |
| 5893 __ bind(deferred->exit()); | 5900 __ bind(deferred->exit()); |
| 5894 __ bind(&done); | 5901 __ bind(&done); |
| 5895 } | 5902 } |
| 5896 | 5903 |
| 5897 | 5904 |
| 5898 #undef __ | 5905 #undef __ |
| 5899 | 5906 |
| 5900 } } // namespace v8::internal | 5907 } } // namespace v8::internal |
| OLD | NEW |