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

Unified Diff: src/objects.cc

Issue 7622: - Eliminated superfluous type tests in IsMatch. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 12 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
===================================================================
--- src/objects.cc (revision 522)
+++ src/objects.cc (working copy)
@@ -5344,8 +5344,8 @@
}
private:
- bool IsMatch(Object* other) {
- return number_ == ToUint32(other);
+ bool IsMatch(Object* number) {
+ return number_ == ToUint32(number);
}
// Thomas Wang, Integer Hash Functions.
@@ -5391,9 +5391,8 @@
string_ = string;
}
- bool IsMatch(Object* other) {
- if (!other->IsString()) return false;
- return string_->Equals(String::cast(other));
+ bool IsMatch(Object* string) {
+ return string_->Equals(String::cast(string));
}
uint32_t Hash() { return StringHash(string_); }
@@ -5417,9 +5416,8 @@
explicit Utf8SymbolKey(Vector<const char> string)
: string_(string), length_field_(0) { }
- bool IsMatch(Object* other) {
- if (!other->IsString()) return false;
- return String::cast(other)->IsEqualTo(string_);
+ bool IsMatch(Object* string) {
+ return String::cast(string)->IsEqualTo(string_);
}
HashFunction GetHashFunction() {
@@ -5463,9 +5461,8 @@
return StringHash;
}
- bool IsMatch(Object* other) {
- if (!other->IsString()) return false;
- return String::cast(other)->Equals(string_);
+ bool IsMatch(Object* string) {
+ return String::cast(string)->Equals(string_);
}
uint32_t Hash() { return string_->Hash(); }
@@ -5712,9 +5709,8 @@
symbols_ = symbols;
}
- bool IsMatch(Object* other) {
- if (!other->IsFixedArray()) return false;
- FixedArray* o = FixedArray::cast(other);
+ bool IsMatch(Object* symbols) {
+ FixedArray* o = FixedArray::cast(symbols);
int len = symbols_->length();
if (o->length() != len) return false;
for (int i = 0; i < len; i++) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698