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

Side by Side Diff: src/ia32/lithium-codegen-ia32.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 | « src/hydrogen-instructions.cc ('k') | src/mips/lithium-codegen-mips.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 5569 matching lines...) Expand 10 before | Expand all | Expand 10 after
5580 __ movzx_b(temp, FieldOperand(temp, Map::kInstanceTypeOffset)); 5580 __ movzx_b(temp, FieldOperand(temp, Map::kInstanceTypeOffset));
5581 __ and_(temp, mask); 5581 __ and_(temp, mask);
5582 __ cmp(temp, tag); 5582 __ cmp(temp, tag);
5583 DeoptimizeIf(not_equal, instr->environment()); 5583 DeoptimizeIf(not_equal, instr->environment());
5584 } 5584 }
5585 } 5585 }
5586 } 5586 }
5587 5587
5588 5588
5589 void LCodeGen::DoCheckValue(LCheckValue* instr) { 5589 void LCodeGen::DoCheckValue(LCheckValue* instr) {
5590 Handle<HeapObject> object = instr->hydrogen()->object(); 5590 Handle<HeapObject> object = instr->hydrogen()->object().handle();
5591 if (instr->hydrogen()->object_in_new_space()) { 5591 if (instr->hydrogen()->object_in_new_space()) {
5592 Register reg = ToRegister(instr->value()); 5592 Register reg = ToRegister(instr->value());
5593 Handle<Cell> cell = isolate()->factory()->NewCell(object); 5593 Handle<Cell> cell = isolate()->factory()->NewCell(object);
5594 __ cmp(reg, Operand::ForCell(cell)); 5594 __ cmp(reg, Operand::ForCell(cell));
5595 } else { 5595 } else {
5596 Operand operand = ToOperand(instr->value()); 5596 Operand operand = ToOperand(instr->value());
5597 __ cmp(operand, object); 5597 __ cmp(operand, object);
5598 } 5598 }
5599 DeoptimizeIf(not_equal, instr->environment()); 5599 DeoptimizeIf(not_equal, instr->environment());
5600 } 5600 }
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
5635 Label check_maps_; 5635 Label check_maps_;
5636 Register object_; 5636 Register object_;
5637 }; 5637 };
5638 5638
5639 if (instr->hydrogen()->CanOmitMapChecks()) return; 5639 if (instr->hydrogen()->CanOmitMapChecks()) return;
5640 5640
5641 LOperand* input = instr->value(); 5641 LOperand* input = instr->value();
5642 ASSERT(input->IsRegister()); 5642 ASSERT(input->IsRegister());
5643 Register reg = ToRegister(input); 5643 Register reg = ToRegister(input);
5644 5644
5645 SmallMapList* map_set = instr->hydrogen()->map_set();
5646
5647 DeferredCheckMaps* deferred = NULL; 5645 DeferredCheckMaps* deferred = NULL;
5648 if (instr->hydrogen()->has_migration_target()) { 5646 if (instr->hydrogen()->has_migration_target()) {
5649 deferred = new(zone()) DeferredCheckMaps(this, instr, reg, x87_stack_); 5647 deferred = new(zone()) DeferredCheckMaps(this, instr, reg, x87_stack_);
5650 __ bind(deferred->check_maps()); 5648 __ bind(deferred->check_maps());
5651 } 5649 }
5652 5650
5651 UniqueSet<Map> map_set = instr->hydrogen()->map_set();
5653 Label success; 5652 Label success;
5654 for (int i = 0; i < map_set->length() - 1; i++) { 5653 for (int i = 0; i < map_set.size() - 1; i++) {
5655 Handle<Map> map = map_set->at(i); 5654 Handle<Map> map = map_set.at(i).handle();
5656 __ CompareMap(reg, map, &success); 5655 __ CompareMap(reg, map, &success);
5657 __ j(equal, &success); 5656 __ j(equal, &success);
5658 } 5657 }
5659 5658
5660 Handle<Map> map = map_set->last(); 5659 Handle<Map> map = map_set.at(map_set.size() - 1).handle();
5661 __ CompareMap(reg, map, &success); 5660 __ CompareMap(reg, map, &success);
5662 if (instr->hydrogen()->has_migration_target()) { 5661 if (instr->hydrogen()->has_migration_target()) {
5663 __ j(not_equal, deferred->entry()); 5662 __ j(not_equal, deferred->entry());
5664 } else { 5663 } else {
5665 DeoptimizeIf(not_equal, instr->environment()); 5664 DeoptimizeIf(not_equal, instr->environment());
5666 } 5665 }
5667 5666
5668 __ bind(&success); 5667 __ bind(&success);
5669 } 5668 }
5670 5669
(...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after
6350 FixedArray::kHeaderSize - kPointerSize)); 6349 FixedArray::kHeaderSize - kPointerSize));
6351 __ bind(&done); 6350 __ bind(&done);
6352 } 6351 }
6353 6352
6354 6353
6355 #undef __ 6354 #undef __
6356 6355
6357 } } // namespace v8::internal 6356 } } // namespace v8::internal
6358 6357
6359 #endif // V8_TARGET_ARCH_IA32 6358 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/hydrogen-instructions.cc ('k') | src/mips/lithium-codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698