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

Unified Diff: src/objects-inl.h

Issue 223193005: Get rid of the TRANSITION PropertyType and consistently use CanHoldValue(). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Use number_ for LastAdded in transition results. Created 6 years, 9 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 | « src/objects.cc ('k') | src/objects-printer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index 41fe7b155136aa3759f679181bcdf982b1ea11ff..43d23545efb1bcd6441a9fd39f1c77047974fce0 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -2629,15 +2629,9 @@ void Map::LookupDescriptor(JSObject* holder,
void Map::LookupTransition(JSObject* holder,
Name* name,
LookupResult* result) {
- if (HasTransitionArray()) {
- TransitionArray* transition_array = transitions();
- int number = transition_array->Search(name);
- if (number != TransitionArray::kNotFound) {
- return result->TransitionResult(
- holder, transition_array->GetTarget(number));
- }
- }
- result->NotFound();
+ int transition_index = this->SearchTransition(name);
+ if (transition_index == TransitionArray::kNotFound) return result->NotFound();
+ result->TransitionResult(holder, this->GetTransition(transition_index));
}
@@ -4904,6 +4898,12 @@ Map* Map::GetTransition(int transition_index) {
}
+int Map::SearchTransition(Name* name) {
+ if (HasTransitionArray()) return transitions()->Search(name);
+ return TransitionArray::kNotFound;
+}
+
+
MaybeObject* Map::set_elements_transition_map(Map* transitioned_map) {
TransitionArray* transitions;
MaybeObject* maybe_transitions = AddTransition(
« no previous file with comments | « src/objects.cc ('k') | src/objects-printer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698