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

Side by Side Diff: runtime/vm/compiler.cc

Issue 1814243002: Add Thread TaskKind (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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 | « no previous file | runtime/vm/gc_marker.cc » ('j') | runtime/vm/thread.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/compiler.h" 5 #include "vm/compiler.h"
6 6
7 #include "vm/assembler.h" 7 #include "vm/assembler.h"
8 8
9 #include "vm/ast_printer.h" 9 #include "vm/ast_printer.h"
10 #include "vm/block_scheduler.h" 10 #include "vm/block_scheduler.h"
(...skipping 1630 matching lines...) Expand 10 before | Expand all | Expand 10 after
1641 queue_monitor_(new Monitor()), done_monitor_(new Monitor()), 1641 queue_monitor_(new Monitor()), done_monitor_(new Monitor()),
1642 function_queue_(new BackgroundCompilationQueue()) { 1642 function_queue_(new BackgroundCompilationQueue()) {
1643 *done_ = false; 1643 *done_ = false;
1644 } 1644 }
1645 1645
1646 1646
1647 void BackgroundCompiler::Run() { 1647 void BackgroundCompiler::Run() {
1648 while (running_) { 1648 while (running_) {
1649 // Maybe something is already in the queue, check first before waiting 1649 // Maybe something is already in the queue, check first before waiting
1650 // to be notified. 1650 // to be notified.
1651 bool result = Thread::EnterIsolateAsHelper(isolate_); 1651 bool result = Thread::EnterIsolateAsHelper(isolate_, Thread::kCompilerTask);
1652 ASSERT(result); 1652 ASSERT(result);
1653 { 1653 {
1654 Thread* thread = Thread::Current(); 1654 Thread* thread = Thread::Current();
1655 StackZone stack_zone(thread); 1655 StackZone stack_zone(thread);
1656 Zone* zone = stack_zone.GetZone(); 1656 Zone* zone = stack_zone.GetZone();
1657 HANDLESCOPE(thread); 1657 HANDLESCOPE(thread);
1658 Function& function = Function::Handle(zone); 1658 Function& function = Function::Handle(zone);
1659 function = function_queue()->PeekFunction(); 1659 function = function_queue()->PeekFunction();
1660 while (running_ && !function.IsNull()) { 1660 while (running_ && !function.IsNull()) {
1661 const Error& error = Error::Handle(zone, 1661 const Error& error = Error::Handle(zone,
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
1879 } 1879 }
1880 1880
1881 1881
1882 void BackgroundCompiler::EnsureInit(Thread* thread) { 1882 void BackgroundCompiler::EnsureInit(Thread* thread) {
1883 UNREACHABLE(); 1883 UNREACHABLE();
1884 } 1884 }
1885 1885
1886 #endif // DART_PRECOMPILED_RUNTIME 1886 #endif // DART_PRECOMPILED_RUNTIME
1887 1887
1888 } // namespace dart 1888 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/gc_marker.cc » ('j') | runtime/vm/thread.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698