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

Unified Diff: src/transitions.cc

Issue 11035053: Rollback trunk to bleeding_edge revision 12525 (Closed) Base URL: https://v8.googlecode.com/svn/trunk
Patch Set: Created 8 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 | « src/transitions.h ('k') | src/transitions-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/transitions.cc
diff --git a/src/transitions.cc b/src/transitions.cc
index 7233f7346e1a7239b3aee241c9b47d596d34a7a5..199fcc2c9838fb0691bbedd4c00e1dd7bd27bb3e 100644
--- a/src/transitions.cc
+++ b/src/transitions.cc
@@ -35,8 +35,8 @@ namespace v8 {
namespace internal {
-static MaybeObject* AllocateRaw(int length,
- JSGlobalPropertyCell* descriptors_cell) {
+MaybeObject* TransitionArray::Allocate(int number_of_transitions,
+ JSGlobalPropertyCell* descriptors_cell) {
Heap* heap = Isolate::Current()->heap();
if (descriptors_cell == NULL) {
@@ -45,22 +45,13 @@ static MaybeObject* AllocateRaw(int length,
if (!maybe_cell->To(&descriptors_cell)) return maybe_cell;
}
- // Use FixedArray to not use TransitionArray::cast on incomplete object.
- FixedArray* array;
- MaybeObject* maybe_array = heap->AllocateFixedArray(length);
- if (!maybe_array->To(&array)) return maybe_array;
-
- array->set(TransitionArray::kDescriptorsPointerIndex, descriptors_cell);
- return array;
-}
-
-
-MaybeObject* TransitionArray::Allocate(int number_of_transitions,
- JSGlobalPropertyCell* descriptors_cell) {
+ // Use FixedArray to not use DescriptorArray::cast on incomplete object.
FixedArray* array;
MaybeObject* maybe_array =
- AllocateRaw(ToKeyIndex(number_of_transitions), descriptors_cell);
+ heap->AllocateFixedArray(ToKeyIndex(number_of_transitions));
if (!maybe_array->To(&array)) return maybe_array;
+
+ array->set(kDescriptorsPointerIndex, descriptors_cell);
array->set(kElementsTransitionIndex, Smi::FromInt(0));
array->set(kPrototypeTransitionsIndex, Smi::FromInt(0));
return array;
@@ -81,46 +72,18 @@ static bool InsertionPointFound(String* key1, String* key2) {
}
-MaybeObject* TransitionArray::NewWith(SimpleTransitionFlag flag,
- String* key,
- Map* target,
- JSGlobalPropertyCell* descriptors_pointer,
- Object* back_pointer) {
- TransitionArray* result;
- MaybeObject* maybe_result;
-
- if (flag == SIMPLE_TRANSITION) {
- maybe_result = AllocateRaw(kSimpleTransitionSize, descriptors_pointer);
- if (!maybe_result->To(&result)) return maybe_result;
- result->set(kSimpleTransitionTarget, target);
- } else {
- maybe_result = Allocate(1, descriptors_pointer);
- if (!maybe_result->To(&result)) return maybe_result;
- result->NoIncrementalWriteBarrierSet(0, key, target);
- }
- result->set_back_pointer_storage(back_pointer);
- return result;
-}
-
-
-MaybeObject* TransitionArray::AllocateDescriptorsHolder(
- JSGlobalPropertyCell* descriptors_pointer) {
- return AllocateRaw(kDescriptorsHolderSize, descriptors_pointer);
-}
-
-
-MaybeObject* TransitionArray::ExtendToFullTransitionArray() {
- ASSERT(!IsFullTransitionArray());
- int nof = number_of_transitions();
+MaybeObject* TransitionArray::NewWith(
+ String* name,
+ Map* target,
+ JSGlobalPropertyCell* descriptors_pointer,
+ Object* back_pointer) {
TransitionArray* result;
- MaybeObject* maybe_result = Allocate(nof, descriptors_pointer());
- if (!maybe_result->To(&result)) return maybe_result;
- if (nof == 1) {
- result->NoIncrementalWriteBarrierCopyFrom(this, kSimpleTransitionIndex, 0);
- }
+ MaybeObject* maybe_array = TransitionArray::Allocate(1, descriptors_pointer);
+ if (!maybe_array->To(&result)) return maybe_array;
- result->set_back_pointer_storage(back_pointer_storage());
+ result->NoIncrementalWriteBarrierSet(0, name, target);
+ result->set_back_pointer_storage(back_pointer);
return result;
}
« no previous file with comments | « src/transitions.h ('k') | src/transitions-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698