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

Unified Diff: src/objects-inl.h

Issue 10802034: Moved lastadded from DescriptorArray to Map. Renamed kLastAdded to kEnumCache. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments. Created 8 years, 5 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/transitions-inl.h » ('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 d4f27dedf7ba1eaeef693abd703e0f6909843724..74b855f8e2c9a37a816b9a5022c5fab529666f79 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -2954,16 +2954,12 @@ bool Map::has_non_instance_prototype() {
void Map::set_function_with_prototype(bool value) {
- if (value) {
- set_bit_field3(bit_field3() | (1 << kFunctionWithPrototype));
- } else {
- set_bit_field3(bit_field3() & ~(1 << kFunctionWithPrototype));
- }
+ set_bit_field3(FunctionWithPrototype::update(bit_field3(), value));
}
bool Map::function_with_prototype() {
- return ((1 << kFunctionWithPrototype) & bit_field3()) != 0;
+ return FunctionWithPrototype::decode(bit_field3());
}
@@ -3008,15 +3004,11 @@ bool Map::attached_to_shared_function_info() {
void Map::set_is_shared(bool value) {
- if (value) {
- set_bit_field3(bit_field3() | (1 << kIsShared));
- } else {
- set_bit_field3(bit_field3() & ~(1 << kIsShared));
- }
+ set_bit_field3(IsShared::update(bit_field3(), value));
}
bool Map::is_shared() {
- return ((1 << kIsShared) & bit_field3()) != 0;
+ return IsShared::decode(bit_field3());
}
@@ -3522,17 +3514,17 @@ void Map::InitializeDescriptors(DescriptorArray* descriptors) {
}
#endif
+ set_instance_descriptors(descriptors);
+
for (int i = 0; i < len; ++i) {
if (descriptors->GetDetails(i).index() == len) {
- descriptors->SetLastAdded(i);
+ SetLastAdded(i);
break;
}
}
ASSERT(len == 0 ||
- len == descriptors->GetDetails(descriptors->LastAdded()).index());
-
- set_instance_descriptors(descriptors);
+ len == descriptors->GetDetails(LastAdded()).index());
}
@@ -3558,9 +3550,9 @@ void Map::ClearDescriptorArray(Heap* heap, WriteBarrierMode mode) {
void Map::AppendDescriptor(Descriptor* desc,
const DescriptorArray::WhitenessWitness& witness) {
DescriptorArray* descriptors = instance_descriptors();
- int set_descriptors = descriptors->NumberOfSetDescriptors();
+ int set_descriptors = NumberOfSetDescriptors();
int new_last_added = descriptors->Append(desc, witness, set_descriptors);
- descriptors->SetLastAdded(new_last_added);
+ SetLastAdded(new_last_added);
}
« no previous file with comments | « src/objects.cc ('k') | src/transitions-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698