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

Unified Diff: src/objects-inl.h

Issue 1435313002: Refactor dependent code. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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-debug.cc ('k') | test/cctest/test-heap.cc » ('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 052fc5147288277ce83293579553ac02d784aac8..cd3e6a1e32b8cb5691276ad435974a09549738a8 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -4927,14 +4927,38 @@ bool Map::CanOmitMapChecks() {
}
-int DependentCode::number_of_entries(DependencyGroup group) {
- if (length() == 0) return 0;
- return Smi::cast(get(group))->value();
+DependentCode* DependentCode::next_link() {
+ return DependentCode::cast(get(kNextLinkIndex));
}
-void DependentCode::set_number_of_entries(DependencyGroup group, int value) {
- set(group, Smi::FromInt(value));
+void DependentCode::set_next_link(DependentCode* next) {
+ set(kNextLinkIndex, next);
+}
+
+
+int DependentCode::flags() { return Smi::cast(get(kFlagsIndex))->value(); }
+
+
+void DependentCode::set_flags(int flags) {
+ set(kFlagsIndex, Smi::FromInt(flags));
+}
+
+
+int DependentCode::count() { return CountField::decode(flags()); }
+
+void DependentCode::set_count(int value) {
+ set_flags(CountField::update(flags(), value));
+}
+
+
+DependentCode::DependencyGroup DependentCode::group() {
+ return static_cast<DependencyGroup>(GroupField::decode(flags()));
+}
+
+
+void DependentCode::set_group(DependentCode::DependencyGroup group) {
+ set_flags(GroupField::update(flags(), static_cast<int>(group)));
}
@@ -4958,16 +4982,6 @@ void DependentCode::copy(int from, int to) {
}
-void DependentCode::ExtendGroup(DependencyGroup group) {
- GroupStartIndexes starts(this);
- for (int g = kGroupCount - 1; g > group; g--) {
- if (starts.at(g) < starts.at(g + 1)) {
- copy(starts.at(g), starts.at(g + 1));
- }
- }
-}
-
-
void Code::set_flags(Code::Flags flags) {
STATIC_ASSERT(Code::NUMBER_OF_KINDS <= KindField::kMax + 1);
WRITE_INT_FIELD(this, kFlagsOffset, flags);
« no previous file with comments | « src/objects-debug.cc ('k') | test/cctest/test-heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698