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

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: Add space after if 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
« no previous file with comments | « src/objects-debug.cc ('k') | src/objects-visiting-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 28c11a646092590960f091e8e5718ccd2fcf9499..c5c464777236e4f94cc6b20cf9f16481f274dfc3 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -589,7 +589,7 @@ bool Object::IsDeoptimizationOutputData() {
}
-bool Object::IsDependentCodes() {
+bool Object::IsDependentCode() {
if (!IsFixedArray()) return false;
// There's actually no way to see the difference between a fixed array and
// a dependent codes array.
@@ -2397,7 +2397,7 @@ CAST_ACCESSOR(FixedDoubleArray)
CAST_ACCESSOR(DescriptorArray)
CAST_ACCESSOR(DeoptimizationInputData)
CAST_ACCESSOR(DeoptimizationOutputData)
-CAST_ACCESSOR(DependentCodes)
+CAST_ACCESSOR(DependentCode)
CAST_ACCESSOR(TypeFeedbackCells)
CAST_ACCESSOR(SymbolTable)
CAST_ACCESSOR(JSFunctionResultCache)
@@ -3431,44 +3431,68 @@ bool Map::is_observed() {
}
-void Map::AddDependentCode(Handle<Code> code) {
- Handle<DependentCodes> codes =
- DependentCodes::Append(Handle<DependentCodes>(dependent_codes()), code);
- if (*codes != dependent_codes()) {
- set_dependent_codes(*codes);
+void Map::NotifyLeafMapLayoutChange() {
+ dependent_code()->DeoptimizeDependentCodeGroup(
+ DependentCode::kPrototypeCheckGroup);
+}
+
+
+bool Map::CanOmitPrototypeChecks() {
+ return !HasTransitionArray() && !is_dictionary_map() &&
+ FLAG_omit_prototype_checks_for_leaf_maps;
+}
+
+
+void Map::AddDependentCode(DependentCode::DependencyGroup group,
+ Handle<Code> code) {
+ Handle<DependentCode> codes =
+ DependentCode::Insert(Handle<DependentCode>(dependent_code()),
+ group, code);
+ if (*codes != dependent_code()) {
+ set_dependent_code(*codes);
}
}
-int DependentCodes::number_of_codes() {
+int DependentCode::number_of_entries(DependencyGroup group) {
if (length() == 0) return 0;
- return Smi::cast(get(kNumberOfCodesIndex))->value();
+ return Smi::cast(get(group))->value();
}
-void DependentCodes::set_number_of_codes(int value) {
- set(kNumberOfCodesIndex, Smi::FromInt(value));
+void DependentCode::set_number_of_entries(DependencyGroup group, int value) {
+ set(group, Smi::FromInt(value));
}
-Code* DependentCodes::code_at(int i) {
- return Code::cast(get(kCodesIndex + i));
+Code* DependentCode::code_at(int i) {
+ return Code::cast(get(kCodesStartIndex + i));
}
-void DependentCodes::set_code_at(int i, Code* value) {
- set(kCodesIndex + i, value);
+void DependentCode::set_code_at(int i, Code* value) {
+ set(kCodesStartIndex + i, value);
}
-Object** DependentCodes::code_slot_at(int i) {
+Object** DependentCode::code_slot_at(int i) {
return HeapObject::RawField(
- this, FixedArray::OffsetOfElementAt(kCodesIndex + i));
+ this, FixedArray::OffsetOfElementAt(kCodesStartIndex + i));
}
-void DependentCodes::clear_code_at(int i) {
- set_undefined(kCodesIndex + i);
+void DependentCode::clear_code_at(int i) {
+ set_undefined(kCodesStartIndex + i);
+}
+
+
+void DependentCode::ExtendGroup(DependencyGroup group) {
+ 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)));
+ }
+ }
}
@@ -4094,7 +4118,7 @@ HeapObject* Map::UncheckedPrototypeTransitions() {
ACCESSORS(Map, code_cache, Object, kCodeCacheOffset)
-ACCESSORS(Map, dependent_codes, DependentCodes, kDependentCodesOffset)
+ACCESSORS(Map, dependent_code, DependentCode, kDependentCodeOffset)
ACCESSORS(Map, constructor, Object, kConstructorOffset)
ACCESSORS(JSFunction, shared, SharedFunctionInfo, kSharedFunctionInfoOffset)
« no previous file with comments | « src/objects-debug.cc ('k') | src/objects-visiting-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698