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

Unified Diff: src/debug/debug.cc

Issue 2578433002: Revert of Store SharedFunctionInfos of a Script in a FixedArray indexed by their ID (Closed)
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/crankshaft/hydrogen.cc ('k') | src/debug/liveedit.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug/debug.cc
diff --git a/src/debug/debug.cc b/src/debug/debug.cc
index a75ece1bf312ddc292a7cd66b267542a3116b0be..de9c44079519143b595054d83721e2c61ffb63b3 100644
--- a/src/debug/debug.cc
+++ b/src/debug/debug.cc
@@ -1244,7 +1244,7 @@
// cover this, because the given function might have been inlined into code
// for which no JSFunction exists.
{
- SharedFunctionInfo::GlobalIterator iterator(isolate_);
+ SharedFunctionInfo::Iterator iterator(isolate_);
while (SharedFunctionInfo* shared = iterator.Next()) {
shared->ClearCodeFromOptimizedCodeMap();
}
@@ -1335,18 +1335,24 @@
bool Debug::GetPossibleBreakpoints(Handle<Script> script, int start_position,
int end_position, std::set<int>* positions) {
while (true) {
+ if (!script->shared_function_infos()->IsWeakFixedArray()) return false;
+
+ WeakFixedArray* infos =
+ WeakFixedArray::cast(script->shared_function_infos());
HandleScope scope(isolate_);
List<Handle<SharedFunctionInfo>> candidates;
- SharedFunctionInfo::ScriptIterator iterator(script);
- for (SharedFunctionInfo* info = iterator.Next(); info != nullptr;
- info = iterator.Next()) {
- if (info->end_position() < start_position ||
- info->start_position() >= end_position) {
- continue;
+ {
+ WeakFixedArray::Iterator iterator(infos);
+ SharedFunctionInfo* info;
+ while ((info = iterator.Next<SharedFunctionInfo>())) {
+ if (info->end_position() < start_position ||
+ info->start_position() >= end_position) {
+ continue;
+ }
+ if (!info->IsSubjectToDebugging()) continue;
+ if (!info->HasDebugCode() && !info->allows_lazy_compilation()) continue;
+ candidates.Add(i::handle(info));
}
- if (!info->IsSubjectToDebugging()) continue;
- if (!info->HasDebugCode() && !info->allows_lazy_compilation()) continue;
- candidates.Add(i::handle(info));
}
bool was_compiled = false;
@@ -1456,14 +1462,15 @@
// find the inner most function containing this position.
// If there is no shared function info for this script at all, there is
// no point in looking for it by walking the heap.
+ if (!script->shared_function_infos()->IsWeakFixedArray()) break;
SharedFunctionInfo* shared;
{
SharedFunctionInfoFinder finder(position);
- SharedFunctionInfo::ScriptIterator iterator(script);
- for (SharedFunctionInfo* info = iterator.Next(); info != nullptr;
- info = iterator.Next()) {
- finder.NewCandidate(info);
+ WeakFixedArray::Iterator iterator(script->shared_function_infos());
+ SharedFunctionInfo* candidate;
+ while ((candidate = iterator.Next<SharedFunctionInfo>())) {
+ finder.NewCandidate(candidate);
}
shared = finder.Result();
if (shared == NULL) break;
« no previous file with comments | « src/crankshaft/hydrogen.cc ('k') | src/debug/liveedit.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698