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

Unified Diff: src/transitions.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
Index: src/transitions.h
diff --git a/src/transitions.h b/src/transitions.h
index b0aab9502e5d2e08dd810ae16aac23cc5edd7bf5..9e14279757082432569da63df82e7875caa12694 100644
--- a/src/transitions.h
+++ b/src/transitions.h
@@ -71,6 +71,11 @@ class TransitionArray: public FixedArray {
DCHECK(raw_transition->IsWeakCell());
return Map::cast(WeakCell::cast(raw_transition)->value());
}
+ static inline WeakCell* GetSimpleTransitionCell(Object* raw_transition) {
+ DCHECK(IsSimpleTransition(raw_transition));
+ DCHECK(raw_transition->IsWeakCell());
+ return WeakCell::cast(raw_transition);
+ }
static inline bool IsFullTransitionArray(Object* raw_transitions) {
return raw_transitions->IsTransitionArray();
}
@@ -135,6 +140,7 @@ class TransitionArray: public FixedArray {
inline Name* GetKey(int transition_number);
inline void SetKey(int transition_number, Name* value);
inline Object** GetKeySlot(int transition_number);
+ inline Object** GetTargetSlot(int transition_number);
int GetSortedKeyIndex(int transition_number) { return transition_number; }
Name* GetSortedKey(int transition_number) {
@@ -143,7 +149,9 @@ class TransitionArray: public FixedArray {
static inline Map* GetTarget(Object* raw_transitions, int transition_number);
inline Map* GetTarget(int transition_number);
- inline void SetTarget(int transition_number, Map* target);
+
+ inline WeakCell* GetTargetCell(int transition_number);
+ inline void SetTargetCell(int transition_number, WeakCell* target);
static inline PropertyDetails GetTargetDetails(Name* name, Map* target);
@@ -283,14 +291,11 @@ class TransitionArray: public FixedArray {
PropertyKind kind2,
PropertyAttributes attributes2);
- inline void NoIncrementalWriteBarrierSet(int transition_number,
- Name* key,
- Map* target);
+ inline void Set(int transition_number, Name* key, WeakCell* target_cell);
// Copy a single transition from the origin array.
- inline void NoIncrementalWriteBarrierCopyFrom(TransitionArray* origin,
- int origin_transition,
- int target_transition);
+ inline void CopyFrom(TransitionArray* origin, int origin_transition,
+ int target_transition);
#ifdef DEBUG
static void CheckNewTransitionsAreConsistent(Handle<Map> map,

Powered by Google App Engine
This is Rietveld 408576698