Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(673)

Side by Side Diff: src/arm/lithium-codegen-arm.cc

Issue 23604062: Use UniqueSet<T> and Unique<T> in HCheckMaps and HCheckValue. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/hydrogen-escape-analysis.cc » ('j') | src/hydrogen-instructions.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 5139 matching lines...) Expand 10 before | Expand all | Expand 10 after
5150 __ and_(scratch, scratch, Operand(mask)); 5150 __ and_(scratch, scratch, Operand(mask));
5151 __ cmp(scratch, Operand(tag)); 5151 __ cmp(scratch, Operand(tag));
5152 DeoptimizeIf(ne, instr->environment()); 5152 DeoptimizeIf(ne, instr->environment());
5153 } 5153 }
5154 } 5154 }
5155 } 5155 }
5156 5156
5157 5157
5158 void LCodeGen::DoCheckValue(LCheckValue* instr) { 5158 void LCodeGen::DoCheckValue(LCheckValue* instr) {
5159 Register reg = ToRegister(instr->value()); 5159 Register reg = ToRegister(instr->value());
5160 Handle<HeapObject> object = instr->hydrogen()->object(); 5160 Handle<HeapObject> object = instr->hydrogen()->object().handle();
5161 AllowDeferredHandleDereference smi_check; 5161 AllowDeferredHandleDereference smi_check;
5162 if (isolate()->heap()->InNewSpace(*object)) { 5162 if (isolate()->heap()->InNewSpace(*object)) {
5163 Register reg = ToRegister(instr->value()); 5163 Register reg = ToRegister(instr->value());
5164 Handle<Cell> cell = isolate()->factory()->NewCell(object); 5164 Handle<Cell> cell = isolate()->factory()->NewCell(object);
5165 __ mov(ip, Operand(Handle<Object>(cell))); 5165 __ mov(ip, Operand(Handle<Object>(cell)));
5166 __ ldr(ip, FieldMemOperand(ip, Cell::kValueOffset)); 5166 __ ldr(ip, FieldMemOperand(ip, Cell::kValueOffset));
5167 __ cmp(reg, ip); 5167 __ cmp(reg, ip);
5168 } else { 5168 } else {
5169 __ cmp(reg, Operand(object)); 5169 __ cmp(reg, Operand(object));
5170 } 5170 }
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
5202 Register object_; 5202 Register object_;
5203 }; 5203 };
5204 5204
5205 if (instr->hydrogen()->CanOmitMapChecks()) return; 5205 if (instr->hydrogen()->CanOmitMapChecks()) return;
5206 Register map_reg = scratch0(); 5206 Register map_reg = scratch0();
5207 5207
5208 LOperand* input = instr->value(); 5208 LOperand* input = instr->value();
5209 ASSERT(input->IsRegister()); 5209 ASSERT(input->IsRegister());
5210 Register reg = ToRegister(input); 5210 Register reg = ToRegister(input);
5211 5211
5212 SmallMapList* map_set = instr->hydrogen()->map_set();
5213 __ ldr(map_reg, FieldMemOperand(reg, HeapObject::kMapOffset)); 5212 __ ldr(map_reg, FieldMemOperand(reg, HeapObject::kMapOffset));
5214 5213
5215 DeferredCheckMaps* deferred = NULL; 5214 DeferredCheckMaps* deferred = NULL;
5216 if (instr->hydrogen()->has_migration_target()) { 5215 if (instr->hydrogen()->has_migration_target()) {
5217 deferred = new(zone()) DeferredCheckMaps(this, instr, reg); 5216 deferred = new(zone()) DeferredCheckMaps(this, instr, reg);
5218 __ bind(deferred->check_maps()); 5217 __ bind(deferred->check_maps());
5219 } 5218 }
5220 5219
5220 UniqueSet<Map> map_set = instr->hydrogen()->map_set();
5221 Label success; 5221 Label success;
5222 for (int i = 0; i < map_set->length() - 1; i++) { 5222 for (int i = 0; i < map_set.size() - 1; i++) {
5223 Handle<Map> map = map_set->at(i); 5223 Handle<Map> map = map_set.at(i).handle();
5224 __ CompareMap(map_reg, map, &success); 5224 __ CompareMap(map_reg, map, &success);
5225 __ b(eq, &success); 5225 __ b(eq, &success);
5226 } 5226 }
5227 5227
5228 Handle<Map> map = map_set->last(); 5228 Handle<Map> map = map_set.at(map_set.size() - 1).handle();
5229 __ CompareMap(map_reg, map, &success); 5229 __ CompareMap(map_reg, map, &success);
5230 if (instr->hydrogen()->has_migration_target()) { 5230 if (instr->hydrogen()->has_migration_target()) {
5231 __ b(ne, deferred->entry()); 5231 __ b(ne, deferred->entry());
5232 } else { 5232 } else {
5233 DeoptimizeIf(ne, instr->environment()); 5233 DeoptimizeIf(ne, instr->environment());
5234 } 5234 }
5235 5235
5236 __ bind(&success); 5236 __ bind(&success);
5237 } 5237 }
5238 5238
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after
5801 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); 5801 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index));
5802 __ ldr(result, FieldMemOperand(scratch, 5802 __ ldr(result, FieldMemOperand(scratch,
5803 FixedArray::kHeaderSize - kPointerSize)); 5803 FixedArray::kHeaderSize - kPointerSize));
5804 __ bind(&done); 5804 __ bind(&done);
5805 } 5805 }
5806 5806
5807 5807
5808 #undef __ 5808 #undef __
5809 5809
5810 } } // namespace v8::internal 5810 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/hydrogen-escape-analysis.cc » ('j') | src/hydrogen-instructions.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698