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

Side by Side Diff: src/objects.cc

Issue 113199: X64: General fixes - added inline definitions and changed tome places to intptr_t. (Closed)
Patch Set: Created 11 years, 7 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
OLDNEW
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 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 6707 matching lines...) Expand 10 before | Expand all | Expand 10 after
6718 if (map != map_) return false; 6718 if (map != map_) return false;
6719 String* name = String::cast(pair->get(1)); 6719 String* name = String::cast(pair->get(1));
6720 return name->Equals(name_); 6720 return name->Equals(name_);
6721 } 6721 }
6722 6722
6723 typedef uint32_t (*HashFunction)(Object* obj); 6723 typedef uint32_t (*HashFunction)(Object* obj);
6724 6724
6725 virtual HashFunction GetHashFunction() { return MapNameHash; } 6725 virtual HashFunction GetHashFunction() { return MapNameHash; }
6726 6726
6727 static uint32_t MapNameHashHelper(Map* map, String* name) { 6727 static uint32_t MapNameHashHelper(Map* map, String* name) {
6728 return reinterpret_cast<uint32_t>(map) ^ name->Hash(); 6728 uintptr_t addr_hash =
6729 static_cast<uint32_t>(reinterpret_cast<uintptr_t>(map));
Dean McNamee 2009/05/12 08:22:40 comment about truncation?
Lasse Reichstein 2009/05/12 10:32:51 Added
6730 return addr_hash ^ name->Hash();
6729 } 6731 }
6730 6732
6731 static uint32_t MapNameHash(Object* obj) { 6733 static uint32_t MapNameHash(Object* obj) {
6732 FixedArray* pair = FixedArray::cast(obj); 6734 FixedArray* pair = FixedArray::cast(obj);
6733 Map* map = Map::cast(pair->get(0)); 6735 Map* map = Map::cast(pair->get(0));
6734 String* name = String::cast(pair->get(1)); 6736 String* name = String::cast(pair->get(1));
6735 return MapNameHashHelper(map, name); 6737 return MapNameHashHelper(map, name);
6736 } 6738 }
6737 6739
6738 virtual uint32_t Hash() { 6740 virtual uint32_t Hash() {
(...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after
7501 // No break point. 7503 // No break point.
7502 if (break_point_objects()->IsUndefined()) return 0; 7504 if (break_point_objects()->IsUndefined()) return 0;
7503 // Single beak point. 7505 // Single beak point.
7504 if (!break_point_objects()->IsFixedArray()) return 1; 7506 if (!break_point_objects()->IsFixedArray()) return 1;
7505 // Multiple break points. 7507 // Multiple break points.
7506 return FixedArray::cast(break_point_objects())->length(); 7508 return FixedArray::cast(break_point_objects())->length();
7507 } 7509 }
7508 #endif 7510 #endif
7509 7511
7510 } } // namespace v8::internal 7512 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698