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

Unified Diff: src/transitions-inl.h

Issue 698043003: TransitionArray::Search() now returns insertion index if the entry was not found. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 1 month 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 | « src/transitions.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/transitions-inl.h
diff --git a/src/transitions-inl.h b/src/transitions-inl.h
index 6ed86a1407e120b7f5ae279650b01d9c2fd665f5..087755d1bdde10f941d17e23f903a0660f5030b2 100644
--- a/src/transitions-inl.h
+++ b/src/transitions-inl.h
@@ -140,13 +140,16 @@ Object* TransitionArray::GetTargetValue(int transition_number) {
}
-int TransitionArray::Search(Name* name) {
+int TransitionArray::Search(Name* name, int* out_insertion_index) {
if (IsSimpleTransition()) {
Name* key = GetKey(kSimpleTransitionIndex);
if (key->Equals(name)) return kSimpleTransitionIndex;
+ if (out_insertion_index != NULL) {
+ *out_insertion_index = key->Hash() > name->Hash() ? 0 : 1;
+ }
return kNotFound;
}
- return internal::Search<ALL_ENTRIES>(this, name);
+ return internal::Search<ALL_ENTRIES>(this, name, 0, out_insertion_index);
}
« no previous file with comments | « src/transitions.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698