Reviewers: Igor Sheludko,
Message:
ptal
Description:
Partially revert r29468
BUG=chromium:507767
LOG=n
Please review this at https://codereview.chromium.org/1224853003/
Base URL: https://chromium.googlesource.com/v8/v8.git@master
Affected files (+10, -12 lines):
M src/objects.h
M src/objects.cc
M src/objects-inl.h
M src/transitions.cc
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index
0e43e1d3a0fbd434bf311fa3dffc579b3b73a3ee..120ca988431a99dde0471883cd51b172573e77d6
100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -6946,12 +6946,13 @@ void Map::ClearCodeCache(Heap* heap) {
}
-int Map::SlackForArraySize(bool is_prototype_map, int old_size,
- int size_limit) {
+int Map::SlackForArraySize(int old_size, int size_limit) {
const int max_slack = size_limit - old_size;
CHECK_LE(0, max_slack);
- if (old_size < 4) return Min(max_slack, 1);
- if (is_prototype_map) return Min(max_slack, 4);
+ if (old_size < 4) {
+ DCHECK_LE(1, max_slack);
+ return 1;
+ }
return Min(max_slack, old_size / 4);
}
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index
b14281a41bbbe9648a6838a292b811264596392b..37343616041a911de310a9d60532fe2f6b37ceaf
100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -6762,8 +6762,7 @@ Handle<Map> Map::ShareDescriptor(Handle<Map> map,
if (old_size == 0) {
descriptors = DescriptorArray::Allocate(map->GetIsolate(), 0, 1);
} else {
- int slack = SlackForArraySize(map->is_prototype_map(), old_size,
- kMaxNumberOfDescriptors);
+ int slack = SlackForArraySize(old_size, kMaxNumberOfDescriptors);
EnsureDescriptorSlack(map, slack);
descriptors = handle(map->instance_descriptors());
}
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index
dc96725023d6c7f0bf14b0383303d3ef04f2b8ab..12eba2ba25f4468a172436daf03d85ac8a252f10
100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -6027,8 +6027,7 @@ class Map: public HeapObject {
static void AppendCallbackDescriptors(Handle<Map> map,
Handle<Object> descriptors);
- static inline int SlackForArraySize(bool is_prototype_map, int old_size,
- int size_limit);
+ static inline int SlackForArraySize(int old_size, int size_limit);
static void EnsureDescriptorSlack(Handle<Map> map, int slack);
Index: src/transitions.cc
diff --git a/src/transitions.cc b/src/transitions.cc
index
09884d506658408d6f0c7de58fcedd381b7f0502..f00f33146792df503ffe9cd333bb0206e87c97b2
100644
--- a/src/transitions.cc
+++ b/src/transitions.cc
@@ -106,10 +106,9 @@ void TransitionArray::Insert(Handle<Map> map,
Handle<Name> name,
}
// We're gonna need a bigger TransitionArray.
- Handle<TransitionArray> result =
- Allocate(map->GetIsolate(), new_nof,
- Map::SlackForArraySize(false, number_of_transitions,
- kMaxNumberOfTransitions));
+ Handle<TransitionArray> result = Allocate(
+ map->GetIsolate(), new_nof,
+ Map::SlackForArraySize(number_of_transitions,
kMaxNumberOfTransitions));
// The map's transition array may have shrunk during the allocation
above as
// it was weakly traversed, though it is guaranteed not to disappear.
Trim the
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.