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

Unified Diff: src/objects-inl.h

Issue 12225099: Remove prototype checks for leaf maps in optimized code. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address comments. Created 7 years, 10 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
« src/objects.h ('K') | « src/objects.cc ('k') | no next file » | 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 209c2ade04a077b1b340251f295bbfcbdd061e12..d6391c6cf36d8295a72df22c3294267ea17f320e 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -3424,6 +3424,13 @@ bool Map::is_observed() {
return IsObserved::decode(bit_field3());
}
+void Map::NotifyObjectLayoutChange() {
+ DeoptimizeDependentCodes(DependentCodes::kPrototypeCheckGroup);
+}
+
+bool Map::CanOmitPrototypeChecks() {
+ return !HasTransitionArray() && !is_dictionary_map();
+}
void Map::AddDependentCode(DependentCodes::DependencyGroup group,
Handle<Code> code) {
@@ -3468,20 +3475,12 @@ void DependentCodes::clear_code_at(int i) {
}
-void DependentCodes::ComputeGroupStartIndexes(GroupStartIndexes starts) {
- starts[0] = 0;
- for (int g = 1; g <= kGroupCount; g++) {
- int count = number_of_codes(static_cast<DependencyGroup>(g - 1));
- starts[g] = starts[g - 1] + count;
- }
-}
-
-
void DependentCodes::ExtendGroup(DependencyGroup group) {
- GroupStartIndexes starts;
- ComputeGroupStartIndexes(starts);
- for (int g = kGroupCount - 2; g > group; g--) {
- set_code_at(starts[g + 1], code_at(starts[g]));
+ GroupStartIndexes starts(this);
+ for (int g = kGroupCount - 1; g > group; g--) {
+ if (starts.at(g) < starts.at(g + 1)) {
+ set_code_at(starts.at(g + 1), code_at(starts.at(g)));
+ }
}
}
« src/objects.h ('K') | « src/objects.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698