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

Unified Diff: src/transitions-inl.h

Issue 1157943003: Replace ad-hoc weakness in transition array with WeakCell. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Remove redundant dchecks Created 5 years, 6 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
« src/heap/mark-compact.cc ('K') | « 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 f31eff96ba19e6e8e1dca0f1a4b3ee0c7c654a53..870c8e7c0696a58400173c4dd056c34baca2e42e 100644
--- a/src/transitions-inl.h
+++ b/src/transitions-inl.h
@@ -47,6 +47,12 @@ Object** TransitionArray::GetKeySlot(int transition_number) {
}
+Object** TransitionArray::GetTargetSlot(int transition_number) {
+ DCHECK(transition_number < number_of_transitions());
+ return RawFieldOfElementAt(ToTargetIndex(transition_number));
+}
+
+
Name* TransitionArray::GetKey(int transition_number) {
DCHECK(transition_number < number_of_transitions());
return Name::cast(get(ToKeyIndex(transition_number)));
@@ -71,7 +77,8 @@ void TransitionArray::SetKey(int transition_number, Name* key) {
Map* TransitionArray::GetTarget(int transition_number) {
DCHECK(transition_number < number_of_transitions());
- return Map::cast(get(ToTargetIndex(transition_number)));
+ WeakCell* cell = GetTargetCell(transition_number);
+ return Map::cast(cell->value());
}
@@ -86,7 +93,13 @@ Map* TransitionArray::GetTarget(Object* raw_transitions,
}
-void TransitionArray::SetTarget(int transition_number, Map* value) {
+WeakCell* TransitionArray::GetTargetCell(int transition_number) {
+ DCHECK(transition_number < number_of_transitions());
+ return WeakCell::cast(get(ToTargetIndex(transition_number)));
+}
+
+
+void TransitionArray::SetTargetCell(int transition_number, WeakCell* value) {
DCHECK(transition_number < number_of_transitions());
set(ToTargetIndex(transition_number), value);
}
@@ -158,13 +171,9 @@ PropertyDetails TransitionArray::GetTargetDetails(Name* name, Map* target) {
}
-void TransitionArray::NoIncrementalWriteBarrierSet(int transition_number,
- Name* key,
- Map* target) {
- FixedArray::NoIncrementalWriteBarrierSet(
- this, ToKeyIndex(transition_number), key);
- FixedArray::NoIncrementalWriteBarrierSet(
- this, ToTargetIndex(transition_number), target);
+void TransitionArray::Set(int transition_number, Name* key, WeakCell* target) {
+ set(ToKeyIndex(transition_number), key);
+ set(ToTargetIndex(transition_number), target);
}
« src/heap/mark-compact.cc ('K') | « src/transitions.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698