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

Side by Side Diff: src/debug/debug.cc

Issue 2400973002: [compiler] Allow debug compilation for top-level eval. (Closed)
Patch Set: Created 4 years, 2 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 unified diff | Download patch
« no previous file with comments | « src/compiler.cc ('k') | src/objects.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/debug/debug.h" 5 #include "src/debug/debug.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "src/api.h" 9 #include "src/api.h"
10 #include "src/arguments.h" 10 #include "src/arguments.h"
(...skipping 1433 matching lines...) Expand 10 before | Expand all | Expand 10 after
1444 // be no JSFunction referencing it. We can anticipate creating a debug 1444 // be no JSFunction referencing it. We can anticipate creating a debug
1445 // info while bypassing PrepareFunctionForBreakpoints. 1445 // info while bypassing PrepareFunctionForBreakpoints.
1446 if (iteration > 1) { 1446 if (iteration > 1) {
1447 AllowHeapAllocation allow_before_return; 1447 AllowHeapAllocation allow_before_return;
1448 CreateDebugInfo(shared_handle); 1448 CreateDebugInfo(shared_handle);
1449 } 1449 }
1450 return shared_handle; 1450 return shared_handle;
1451 } 1451 }
1452 } 1452 }
1453 // If not, compile to reveal inner functions, if possible. 1453 // If not, compile to reveal inner functions, if possible.
1454 if (shared->allows_lazy_compilation_without_context()) { 1454 if (shared->allows_lazy_compilation()) {
1455 HandleScope scope(isolate_); 1455 HandleScope scope(isolate_);
1456 if (!Compiler::CompileDebugCode(handle(shared))) break; 1456 if (!Compiler::CompileDebugCode(handle(shared))) break;
1457 continue; 1457 continue;
1458 } 1458 }
1459 1459
1460 // If not possible, comb the heap for the best suitable compile target. 1460 // If not possible, comb the heap for the best suitable compile target.
Yang 2016/10/07 11:06:41 I think that we don't need this anymore. The whole
Michael Starzinger 2016/10/07 13:38:42 Acknowledged. Yeah, I was also wondering about fur
1461 JSFunction* closure; 1461 JSFunction* closure;
1462 { 1462 {
1463 HeapIterator it(isolate_->heap()); 1463 HeapIterator it(isolate_->heap());
1464 SharedFunctionInfoFinder finder(position); 1464 SharedFunctionInfoFinder finder(position);
1465 while (HeapObject* object = it.next()) { 1465 while (HeapObject* object = it.next()) {
1466 JSFunction* candidate_closure = NULL; 1466 JSFunction* candidate_closure = NULL;
1467 SharedFunctionInfo* candidate = NULL; 1467 SharedFunctionInfo* candidate = NULL;
1468 if (object->IsJSFunction()) { 1468 if (object->IsJSFunction()) {
1469 candidate_closure = JSFunction::cast(object); 1469 candidate_closure = JSFunction::cast(object);
1470 candidate = candidate_closure->shared(); 1470 candidate = candidate_closure->shared();
1471 } else if (object->IsSharedFunctionInfo()) { 1471 } else if (object->IsSharedFunctionInfo()) {
1472 candidate = SharedFunctionInfo::cast(object); 1472 candidate = SharedFunctionInfo::cast(object);
1473 if (!candidate->allows_lazy_compilation_without_context()) continue; 1473 if (!candidate->allows_lazy_compilation()) continue;
1474 } else { 1474 } else {
1475 continue; 1475 continue;
1476 } 1476 }
1477 if (candidate->script() == *script) { 1477 if (candidate->script() == *script) {
1478 finder.NewCandidate(candidate, candidate_closure); 1478 finder.NewCandidate(candidate, candidate_closure);
1479 } 1479 }
1480 } 1480 }
1481 closure = finder.ResultClosure(); 1481 closure = finder.ResultClosure();
1482 shared = finder.Result(); 1482 shared = finder.Result();
1483 } 1483 }
(...skipping 1074 matching lines...) Expand 10 before | Expand all | Expand 10 after
2558 } 2558 }
2559 2559
2560 2560
2561 void LockingCommandMessageQueue::Clear() { 2561 void LockingCommandMessageQueue::Clear() {
2562 base::LockGuard<base::Mutex> lock_guard(&mutex_); 2562 base::LockGuard<base::Mutex> lock_guard(&mutex_);
2563 queue_.Clear(); 2563 queue_.Clear();
2564 } 2564 }
2565 2565
2566 } // namespace internal 2566 } // namespace internal
2567 } // namespace v8 2567 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698