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

Unified Diff: src/objects.cc

Issue 236193014: Handlify AddDependentCode(), AddDependentCompilationInfo() and AddDependentIC(). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address nit Created 6 years, 8 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.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 256f5558952cea7b5d3f806e205633681796ca40..396f4707843e3004a76e37dce63fb208a034c5da 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -11689,35 +11689,41 @@ void Map::ZapPrototypeTransitions() {
}
-void Map::AddDependentCompilationInfo(DependentCode::DependencyGroup group,
+// static
+void Map::AddDependentCompilationInfo(Handle<Map> map,
+ DependentCode::DependencyGroup group,
CompilationInfo* info) {
- Handle<DependentCode> dep(dependent_code());
Handle<DependentCode> codes =
- DependentCode::Insert(dep, group, info->object_wrapper());
- if (*codes != dependent_code()) set_dependent_code(*codes);
- info->dependencies(group)->Add(Handle<HeapObject>(this), info->zone());
+ DependentCode::Insert(handle(map->dependent_code(), info->isolate()),
+ group, info->object_wrapper());
+ if (*codes != map->dependent_code()) map->set_dependent_code(*codes);
+ info->dependencies(group)->Add(map, info->zone());
}
-void Map::AddDependentCode(DependentCode::DependencyGroup group,
+// static
+void Map::AddDependentCode(Handle<Map> map,
+ 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);
+ Handle<DependentCode>(map->dependent_code()), group, code);
+ if (*codes != map->dependent_code()) map->set_dependent_code(*codes);
}
-void Map::AddDependentIC(Handle<Code> stub) {
+// static
+void Map::AddDependentIC(Handle<Map> map,
+ Handle<Code> stub) {
ASSERT(stub->next_code_link()->IsUndefined());
- int n = dependent_code()->number_of_entries(DependentCode::kWeakICGroup);
+ int n = map->dependent_code()->number_of_entries(DependentCode::kWeakICGroup);
if (n == 0) {
// Slow path: insert the head of the list with possible heap allocation.
- AddDependentCode(DependentCode::kWeakICGroup, stub);
+ Map::AddDependentCode(map, DependentCode::kWeakICGroup, stub);
} else {
// Fast path: link the stub to the existing head of the list without any
// heap allocation.
ASSERT(n == 1);
- dependent_code()->AddToDependentICList(stub);
+ map->dependent_code()->AddToDependentICList(stub);
}
}
@@ -16604,14 +16610,16 @@ void PropertyCell::SetValueInferType(Handle<PropertyCell> cell,
}
-void PropertyCell::AddDependentCompilationInfo(CompilationInfo* info) {
- Handle<DependentCode> dep(dependent_code());
+// static
+void PropertyCell::AddDependentCompilationInfo(Handle<PropertyCell> cell,
+ CompilationInfo* info) {
Handle<DependentCode> codes =
- DependentCode::Insert(dep, DependentCode::kPropertyCellChangedGroup,
+ DependentCode::Insert(handle(cell->dependent_code(), info->isolate()),
+ DependentCode::kPropertyCellChangedGroup,
info->object_wrapper());
- if (*codes != dependent_code()) set_dependent_code(*codes);
+ if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes);
info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add(
- Handle<HeapObject>(this), info->zone());
+ cell, info->zone());
}
« no previous file with comments | « src/objects.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698