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

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

Issue 1259223005: Safepoint interface and unit tests. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Address comments. Created 5 years, 4 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/isolate.h » ('j') | runtime/vm/isolate.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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/code_generator.h" 5 #include "vm/code_generator.h"
6 6
7 #include "vm/assembler.h" 7 #include "vm/assembler.h"
8 #include "vm/ast.h" 8 #include "vm/ast.h"
9 #include "vm/code_patcher.h" 9 #include "vm/code_patcher.h"
10 #include "vm/compiler.h" 10 #include "vm/compiler.h"
11 #include "vm/dart_api_impl.h" 11 #include "vm/dart_api_impl.h"
12 #include "vm/dart_entry.h" 12 #include "vm/dart_entry.h"
13 #include "vm/debugger.h" 13 #include "vm/debugger.h"
14 #include "vm/deopt_instructions.h" 14 #include "vm/deopt_instructions.h"
15 #include "vm/exceptions.h" 15 #include "vm/exceptions.h"
16 #include "vm/intermediate_language.h" 16 #include "vm/intermediate_language.h"
17 #include "vm/object_store.h" 17 #include "vm/object_store.h"
18 #include "vm/message.h" 18 #include "vm/message.h"
19 #include "vm/message_handler.h" 19 #include "vm/message_handler.h"
20 #include "vm/parser.h" 20 #include "vm/parser.h"
21 #include "vm/report.h" 21 #include "vm/report.h"
22 #include "vm/resolver.h" 22 #include "vm/resolver.h"
23 #include "vm/runtime_entry.h" 23 #include "vm/runtime_entry.h"
24 #include "vm/stack_frame.h" 24 #include "vm/stack_frame.h"
25 #include "vm/symbols.h" 25 #include "vm/symbols.h"
26 #include "vm/thread_registry.h"
26 #include "vm/verifier.h" 27 #include "vm/verifier.h"
27 28
28 namespace dart { 29 namespace dart {
29 30
30 DEFINE_FLAG(bool, deoptimize_alot, false, 31 DEFINE_FLAG(bool, deoptimize_alot, false,
31 "Deoptimizes all live frames when we are about to return to Dart code from" 32 "Deoptimizes all live frames when we are about to return to Dart code from"
32 " native entries."); 33 " native entries.");
33 DEFINE_FLAG(int, max_subtype_cache_entries, 100, 34 DEFINE_FLAG(int, max_subtype_cache_entries, 100,
34 "Maximum number of subtype cache entries (number of checks cached)."); 35 "Maximum number of subtype cache entries (number of checks cached).");
35 DEFINE_FLAG(int, optimization_counter_threshold, 30000, 36 DEFINE_FLAG(int, optimization_counter_threshold, 30000,
(...skipping 1256 matching lines...) Expand 10 before | Expand all | Expand 10 after
1292 const int num_vars = 1293 const int num_vars =
1293 Compiler::always_optimize() ? 0 : frame->NumLocalVariables(); 1294 Compiler::always_optimize() ? 0 : frame->NumLocalVariables();
1294 intptr_t unused; 1295 intptr_t unused;
1295 for (intptr_t v = 0; v < num_vars; v++) { 1296 for (intptr_t v = 0; v < num_vars; v++) {
1296 frame->VariableAt(v, &var_name, &unused, &unused, &var_value); 1297 frame->VariableAt(v, &var_name, &unused, &unused, &var_value);
1297 } 1298 }
1298 } 1299 }
1299 } 1300 }
1300 1301
1301 uword interrupt_bits = isolate->GetAndClearInterrupts(); 1302 uword interrupt_bits = isolate->GetAndClearInterrupts();
1302 if ((interrupt_bits & Isolate::kStoreBufferInterrupt) != 0) { 1303 if ((interrupt_bits & Isolate::kVMInterrupt) != 0) {
1303 if (FLAG_verbose_gc) { 1304 isolate->thread_registry()->CheckSafepoint();
1304 OS::PrintErr("Scavenge scheduled by store buffer overflow.\n"); 1305 if (isolate->store_buffer()->Overflowed()) {
1306 if (FLAG_verbose_gc) {
1307 OS::PrintErr("Scavenge scheduled by store buffer overflow.\n");
1308 }
1309 isolate->heap()->CollectGarbage(Heap::kNew);
1305 } 1310 }
1306 isolate->heap()->CollectGarbage(Heap::kNew);
1307 } 1311 }
1308 if ((interrupt_bits & Isolate::kMessageInterrupt) != 0) { 1312 if ((interrupt_bits & Isolate::kMessageInterrupt) != 0) {
1309 bool ok = isolate->message_handler()->HandleOOBMessages(); 1313 bool ok = isolate->message_handler()->HandleOOBMessages();
1310 if (!ok) { 1314 if (!ok) {
1311 // False result from HandleOOBMessages signals that the isolate should 1315 // False result from HandleOOBMessages signals that the isolate should
1312 // be terminating. 1316 // be terminating.
1313 const String& msg = String::Handle(String::New("isolate terminated")); 1317 const String& msg = String::Handle(String::New("isolate terminated"));
1314 const UnwindError& error = UnwindError::Handle(UnwindError::New(msg)); 1318 const UnwindError& error = UnwindError::Handle(UnwindError::New(msg));
1315 Exceptions::PropagateError(error); 1319 Exceptions::PropagateError(error);
1316 UNREACHABLE(); 1320 UNREACHABLE();
(...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after
1790 const intptr_t elm_size = old_data.ElementSizeInBytes(); 1794 const intptr_t elm_size = old_data.ElementSizeInBytes();
1791 const TypedData& new_data = 1795 const TypedData& new_data =
1792 TypedData::Handle(TypedData::New(cid, new_size, Heap::kOld)); 1796 TypedData::Handle(TypedData::New(cid, new_size, Heap::kOld));
1793 TypedData::Copy(new_data, 0, old_data, 0, old_size * elm_size); 1797 TypedData::Copy(new_data, 0, old_data, 0, old_size * elm_size);
1794 typed_data_cell.SetAt(0, new_data); 1798 typed_data_cell.SetAt(0, new_data);
1795 arguments.SetReturn(new_data); 1799 arguments.SetReturn(new_data);
1796 } 1800 }
1797 1801
1798 1802
1799 } // namespace dart 1803 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/isolate.h » ('j') | runtime/vm/isolate.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698