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

Side by Side Diff: src/objects-inl.h

Issue 767253002: Refactor Map::ConstructionCount. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix assert Created 6 years 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 unified diff | Download patch
« no previous file with comments | « src/objects.cc ('k') | src/x64/builtins-x64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // Review notes: 5 // Review notes:
6 // 6 //
7 // - The use of macros in these inline functions may seem superfluous 7 // - The use of macros in these inline functions may seem superfluous
8 // but it is absolutely needed to make sure gcc generates optimal 8 // but it is absolutely needed to make sure gcc generates optimal
9 // code. gcc is not happy when attempting to inline too deep. 9 // code. gcc is not happy when attempting to inline too deep.
10 // 10 //
(...skipping 4609 matching lines...) Expand 10 before | Expand all | Expand 10 after
4620 void Map::set_migration_target(bool value) { 4620 void Map::set_migration_target(bool value) {
4621 set_bit_field3(IsMigrationTarget::update(bit_field3(), value)); 4621 set_bit_field3(IsMigrationTarget::update(bit_field3(), value));
4622 } 4622 }
4623 4623
4624 4624
4625 bool Map::is_migration_target() { 4625 bool Map::is_migration_target() {
4626 return IsMigrationTarget::decode(bit_field3()); 4626 return IsMigrationTarget::decode(bit_field3());
4627 } 4627 }
4628 4628
4629 4629
4630 void Map::set_done_inobject_slack_tracking(bool value) { 4630 void Map::set_counter(int value) {
4631 set_bit_field3(DoneInobjectSlackTracking::update(bit_field3(), value)); 4631 set_bit_field3(Counter::update(bit_field3(), value));
4632 } 4632 }
4633 4633
4634 4634
4635 bool Map::done_inobject_slack_tracking() { 4635 int Map::counter() { return Counter::decode(bit_field3()); }
4636 return DoneInobjectSlackTracking::decode(bit_field3());
4637 }
4638
4639
4640 void Map::set_construction_count(int value) {
4641 set_bit_field3(ConstructionCount::update(bit_field3(), value));
4642 }
4643
4644
4645 int Map::construction_count() {
4646 return ConstructionCount::decode(bit_field3());
4647 }
4648 4636
4649 4637
4650 void Map::freeze() { 4638 void Map::freeze() {
4651 set_bit_field3(IsFrozen::update(bit_field3(), true)); 4639 set_bit_field3(IsFrozen::update(bit_field3(), true));
4652 } 4640 }
4653 4641
4654 4642
4655 bool Map::is_frozen() { 4643 bool Map::is_frozen() {
4656 return IsFrozen::decode(bit_field3()); 4644 return IsFrozen::decode(bit_field3());
4657 } 4645 }
(...skipping 1387 matching lines...) Expand 10 before | Expand all | Expand 10 after
6045 6033
6046 6034
6047 bool JSFunction::IsInOptimizationQueue() { 6035 bool JSFunction::IsInOptimizationQueue() {
6048 return code() == GetIsolate()->builtins()->builtin( 6036 return code() == GetIsolate()->builtins()->builtin(
6049 Builtins::kInOptimizationQueue); 6037 Builtins::kInOptimizationQueue);
6050 } 6038 }
6051 6039
6052 6040
6053 bool JSFunction::IsInobjectSlackTrackingInProgress() { 6041 bool JSFunction::IsInobjectSlackTrackingInProgress() {
6054 return has_initial_map() && 6042 return has_initial_map() &&
6055 initial_map()->construction_count() != JSFunction::kNoSlackTracking; 6043 initial_map()->counter() >= Map::kSlackTrackingCounterEnd;
6056 } 6044 }
6057 6045
6058 6046
6059 Code* JSFunction::code() { 6047 Code* JSFunction::code() {
6060 return Code::cast( 6048 return Code::cast(
6061 Code::GetObjectFromEntryAddress(FIELD_ADDR(this, kCodeEntryOffset))); 6049 Code::GetObjectFromEntryAddress(FIELD_ADDR(this, kCodeEntryOffset)));
6062 } 6050 }
6063 6051
6064 6052
6065 void JSFunction::set_code(Code* value) { 6053 void JSFunction::set_code(Code* value) {
(...skipping 1449 matching lines...) Expand 10 before | Expand all | Expand 10 after
7515 #undef READ_SHORT_FIELD 7503 #undef READ_SHORT_FIELD
7516 #undef WRITE_SHORT_FIELD 7504 #undef WRITE_SHORT_FIELD
7517 #undef READ_BYTE_FIELD 7505 #undef READ_BYTE_FIELD
7518 #undef WRITE_BYTE_FIELD 7506 #undef WRITE_BYTE_FIELD
7519 #undef NOBARRIER_READ_BYTE_FIELD 7507 #undef NOBARRIER_READ_BYTE_FIELD
7520 #undef NOBARRIER_WRITE_BYTE_FIELD 7508 #undef NOBARRIER_WRITE_BYTE_FIELD
7521 7509
7522 } } // namespace v8::internal 7510 } } // namespace v8::internal
7523 7511
7524 #endif // V8_OBJECTS_INL_H_ 7512 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | src/x64/builtins-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698