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

Unified Diff: src/debug/debug.cc

Issue 2547483002: Store SharedFunctionInfos of a Script in a FixedArray indexed by their ID (Closed)
Patch Set: updates 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
Index: src/debug/debug.cc
diff --git a/src/debug/debug.cc b/src/debug/debug.cc
index de9c44079519143b595054d83721e2c61ffb63b3..a75ece1bf312ddc292a7cd66b267542a3116b0be 100644
--- a/src/debug/debug.cc
+++ b/src/debug/debug.cc
@@ -1244,7 +1244,7 @@ bool Debug::PrepareFunctionForBreakPoints(Handle<SharedFunctionInfo> shared) {
// cover this, because the given function might have been inlined into code
// for which no JSFunction exists.
{
- SharedFunctionInfo::Iterator iterator(isolate_);
+ SharedFunctionInfo::GlobalIterator iterator(isolate_);
while (SharedFunctionInfo* shared = iterator.Next()) {
shared->ClearCodeFromOptimizedCodeMap();
}
@@ -1335,24 +1335,18 @@ void FindBreakablePositions(Handle<DebugInfo> debug_info, int start_position,
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;
- {
- 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));
+ 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;
}
+ if (!info->IsSubjectToDebugging()) continue;
+ if (!info->HasDebugCode() && !info->allows_lazy_compilation()) continue;
+ candidates.Add(i::handle(info));
}
bool was_compiled = false;
@@ -1462,15 +1456,14 @@ Handle<Object> Debug::FindSharedFunctionInfoInScript(Handle<Script> script,
// 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);
- WeakFixedArray::Iterator iterator(script->shared_function_infos());
- SharedFunctionInfo* candidate;
- while ((candidate = iterator.Next<SharedFunctionInfo>())) {
- finder.NewCandidate(candidate);
+ SharedFunctionInfo::ScriptIterator iterator(script);
+ for (SharedFunctionInfo* info = iterator.Next(); info != nullptr;
+ info = iterator.Next()) {
+ finder.NewCandidate(info);
}
shared = finder.Result();
if (shared == NULL) break;
« no previous file with comments | « src/crankshaft/hydrogen.cc ('k') | src/debug/liveedit.h » ('j') | src/debug/liveedit.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698