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

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: Use an uninitialized Unique<T> in HCheckMaps. 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') | no next file with comments »
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 5126 matching lines...) Expand 10 before | Expand all | Expand 10 after
5137 __ and_(scratch, scratch, Operand(mask)); 5137 __ and_(scratch, scratch, Operand(mask));
5138 __ cmp(scratch, Operand(tag)); 5138 __ cmp(scratch, Operand(tag));
5139 DeoptimizeIf(ne, instr->environment()); 5139 DeoptimizeIf(ne, instr->environment());
5140 } 5140 }
5141 } 5141 }
5142 } 5142 }
5143 5143
5144 5144
5145 void LCodeGen::DoCheckValue(LCheckValue* instr) { 5145 void LCodeGen::DoCheckValue(LCheckValue* instr) {
5146 Register reg = ToRegister(instr->value()); 5146 Register reg = ToRegister(instr->value());
5147 Handle<HeapObject> object = instr->hydrogen()->object(); 5147 Handle<HeapObject> object = instr->hydrogen()->object().handle();
5148 AllowDeferredHandleDereference smi_check; 5148 AllowDeferredHandleDereference smi_check;
5149 if (isolate()->heap()->InNewSpace(*object)) { 5149 if (isolate()->heap()->InNewSpace(*object)) {
5150 Register reg = ToRegister(instr->value()); 5150 Register reg = ToRegister(instr->value());
5151 Handle<Cell> cell = isolate()->factory()->NewCell(object); 5151 Handle<Cell> cell = isolate()->factory()->NewCell(object);
5152 __ mov(ip, Operand(Handle<Object>(cell))); 5152 __ mov(ip, Operand(Handle<Object>(cell)));
5153 __ ldr(ip, FieldMemOperand(ip, Cell::kValueOffset)); 5153 __ ldr(ip, FieldMemOperand(ip, Cell::kValueOffset));
5154 __ cmp(reg, ip); 5154 __ cmp(reg, ip);
5155 } else { 5155 } else {
5156 __ cmp(reg, Operand(object)); 5156 __ cmp(reg, Operand(object));
5157 } 5157 }
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
5189 Register object_; 5189 Register object_;
5190 }; 5190 };
5191 5191
5192 if (instr->hydrogen()->CanOmitMapChecks()) return; 5192 if (instr->hydrogen()->CanOmitMapChecks()) return;
5193 Register map_reg = scratch0(); 5193 Register map_reg = scratch0();
5194 5194
5195 LOperand* input = instr->value(); 5195 LOperand* input = instr->value();
5196 ASSERT(input->IsRegister()); 5196 ASSERT(input->IsRegister());
5197 Register reg = ToRegister(input); 5197 Register reg = ToRegister(input);
5198 5198
5199 SmallMapList* map_set = instr->hydrogen()->map_set();
5200 __ ldr(map_reg, FieldMemOperand(reg, HeapObject::kMapOffset)); 5199 __ ldr(map_reg, FieldMemOperand(reg, HeapObject::kMapOffset));
5201 5200
5202 DeferredCheckMaps* deferred = NULL; 5201 DeferredCheckMaps* deferred = NULL;
5203 if (instr->hydrogen()->has_migration_target()) { 5202 if (instr->hydrogen()->has_migration_target()) {
5204 deferred = new(zone()) DeferredCheckMaps(this, instr, reg); 5203 deferred = new(zone()) DeferredCheckMaps(this, instr, reg);
5205 __ bind(deferred->check_maps()); 5204 __ bind(deferred->check_maps());
5206 } 5205 }
5207 5206
5207 UniqueSet<Map> map_set = instr->hydrogen()->map_set();
5208 Label success; 5208 Label success;
5209 for (int i = 0; i < map_set->length() - 1; i++) { 5209 for (int i = 0; i < map_set.size() - 1; i++) {
5210 Handle<Map> map = map_set->at(i); 5210 Handle<Map> map = map_set.at(i).handle();
5211 __ CompareMap(map_reg, map, &success); 5211 __ CompareMap(map_reg, map, &success);
5212 __ b(eq, &success); 5212 __ b(eq, &success);
5213 } 5213 }
5214 5214
5215 Handle<Map> map = map_set->last(); 5215 Handle<Map> map = map_set.at(map_set.size() - 1).handle();
5216 __ CompareMap(map_reg, map, &success); 5216 __ CompareMap(map_reg, map, &success);
5217 if (instr->hydrogen()->has_migration_target()) { 5217 if (instr->hydrogen()->has_migration_target()) {
5218 __ b(ne, deferred->entry()); 5218 __ b(ne, deferred->entry());
5219 } else { 5219 } else {
5220 DeoptimizeIf(ne, instr->environment()); 5220 DeoptimizeIf(ne, instr->environment());
5221 } 5221 }
5222 5222
5223 __ bind(&success); 5223 __ bind(&success);
5224 } 5224 }
5225 5225
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after
5788 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); 5788 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index));
5789 __ ldr(result, FieldMemOperand(scratch, 5789 __ ldr(result, FieldMemOperand(scratch,
5790 FixedArray::kHeaderSize - kPointerSize)); 5790 FixedArray::kHeaderSize - kPointerSize));
5791 __ bind(&done); 5791 __ bind(&done);
5792 } 5792 }
5793 5793
5794 5794
5795 #undef __ 5795 #undef __
5796 5796
5797 } } // namespace v8::internal 5797 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/hydrogen-escape-analysis.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698