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

Side by Side Diff: src/hydrogen-instructions.cc

Issue 21536003: Migrate instance of deprecated maps in HCheckMaps. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 4 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
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 608 matching lines...) Expand 10 before | Expand all | Expand 10 after
619 return current; 619 return current;
620 } 620 }
621 621
622 622
623 bool HValue::Equals(HValue* other) { 623 bool HValue::Equals(HValue* other) {
624 if (other->opcode() != opcode()) return false; 624 if (other->opcode() != opcode()) return false;
625 if (!other->representation().Equals(representation())) return false; 625 if (!other->representation().Equals(representation())) return false;
626 if (!other->type_.Equals(type_)) return false; 626 if (!other->type_.Equals(type_)) return false;
627 if (other->flags() != flags()) return false; 627 if (other->flags() != flags()) return false;
628 if (OperandCount() != other->OperandCount()) return false; 628 if (OperandCount() != other->OperandCount()) return false;
629 for (int i = 0; i < OperandCount(); ++i) { 629 for (int i = 0; i < CompareOperandCount(); ++i) {
630 if (OperandAt(i)->id() != other->OperandAt(i)->id()) return false; 630 if (OperandAt(i)->id() != other->OperandAt(i)->id()) return false;
631 } 631 }
632 bool result = DataEquals(other); 632 bool result = DataEquals(other);
633 ASSERT(!result || Hashcode() == other->Hashcode()); 633 ASSERT(!result || Hashcode() == other->Hashcode());
634 return result; 634 return result;
635 } 635 }
636 636
637 637
638 intptr_t HValue::Hashcode() { 638 intptr_t HValue::Hashcode() {
639 intptr_t result = opcode(); 639 intptr_t result = opcode();
640 int count = OperandCount(); 640 int count = CompareOperandCount();
641 for (int i = 0; i < count; ++i) { 641 for (int i = 0; i < count; ++i) {
642 result = result * 19 + OperandAt(i)->id() + (result >> 7); 642 result = result * 19 + OperandAt(i)->id() + (result >> 7);
643 } 643 }
644 return result; 644 return result;
645 } 645 }
646 646
647 647
648 const char* HValue::Mnemonic() const { 648 const char* HValue::Mnemonic() const {
649 switch (opcode()) { 649 switch (opcode()) {
650 #define MAKE_CASE(type) case k##type: return #type; 650 #define MAKE_CASE(type) case k##type: return #type;
(...skipping 2631 matching lines...) Expand 10 before | Expand all | Expand 10 after
3282 } 3282 }
3283 } 3283 }
3284 3284
3285 3285
3286 HCheckMaps* HCheckMaps::New(Zone* zone, 3286 HCheckMaps* HCheckMaps::New(Zone* zone,
3287 HValue* context, 3287 HValue* context,
3288 HValue* value, 3288 HValue* value,
3289 Handle<Map> map, 3289 Handle<Map> map,
3290 CompilationInfo* info, 3290 CompilationInfo* info,
3291 HValue* typecheck) { 3291 HValue* typecheck) {
3292 HCheckMaps* check_map = new(zone) HCheckMaps(value, zone, typecheck); 3292 HCheckMaps* check_map = new(zone) HCheckMaps(context, value, zone, typecheck);
3293 check_map->map_set_.Add(map, zone); 3293 check_map->map_set_.Add(map, zone);
3294 check_map->has_migration_target_ = map->is_migration_target();
3294 if (map->CanOmitMapChecks() && 3295 if (map->CanOmitMapChecks() &&
3295 value->IsConstant() && 3296 value->IsConstant() &&
3296 HConstant::cast(value)->InstanceOf(map)) { 3297 HConstant::cast(value)->InstanceOf(map)) {
3297 check_map->omit(info); 3298 check_map->omit(info);
3298 } 3299 }
3299 return check_map; 3300 return check_map;
3300 } 3301 }
3301 3302
3302 3303
3303 void HCheckMaps::FinalizeUniqueValueId() { 3304 void HCheckMaps::FinalizeUniqueValueId() {
(...skipping 1168 matching lines...) Expand 10 before | Expand all | Expand 10 after
4472 break; 4473 break;
4473 case kExternalMemory: 4474 case kExternalMemory:
4474 stream->Add("[external-memory]"); 4475 stream->Add("[external-memory]");
4475 break; 4476 break;
4476 } 4477 }
4477 4478
4478 stream->Add("@%d", offset()); 4479 stream->Add("@%d", offset());
4479 } 4480 }
4480 4481
4481 } } // namespace v8::internal 4482 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698