Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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(); |
| 1303 if ((interrupt_bits & Isolate::kSafepointInterrrupt) != 0) { | |
| 1304 isolate->thread_registry()->CheckSafepoint(); | |
|
Ivan Posva
2015/07/31 20:28:09
Regardless of the interrupt reason we should check
koda
2015/07/31 22:40:44
Done by creating single VM interrupt for all these
| |
| 1305 // TODO(koda): Merge safepoint + store buffer into simply "GC interrupt"? | |
| 1306 } | |
| 1302 if ((interrupt_bits & Isolate::kStoreBufferInterrupt) != 0) { | 1307 if ((interrupt_bits & Isolate::kStoreBufferInterrupt) != 0) { |
| 1303 if (FLAG_verbose_gc) { | 1308 if (FLAG_verbose_gc) { |
| 1304 OS::PrintErr("Scavenge scheduled by store buffer overflow.\n"); | 1309 OS::PrintErr("Scavenge scheduled by store buffer overflow.\n"); |
| 1305 } | 1310 } |
| 1306 isolate->heap()->CollectGarbage(Heap::kNew); | 1311 isolate->heap()->CollectGarbage(Heap::kNew); |
| 1307 } | 1312 } |
| 1308 if ((interrupt_bits & Isolate::kMessageInterrupt) != 0) { | 1313 if ((interrupt_bits & Isolate::kMessageInterrupt) != 0) { |
| 1309 bool ok = isolate->message_handler()->HandleOOBMessages(); | 1314 bool ok = isolate->message_handler()->HandleOOBMessages(); |
| 1310 if (!ok) { | 1315 if (!ok) { |
| 1311 // False result from HandleOOBMessages signals that the isolate should | 1316 // False result from HandleOOBMessages signals that the isolate should |
| (...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1790 const intptr_t elm_size = old_data.ElementSizeInBytes(); | 1795 const intptr_t elm_size = old_data.ElementSizeInBytes(); |
| 1791 const TypedData& new_data = | 1796 const TypedData& new_data = |
| 1792 TypedData::Handle(TypedData::New(cid, new_size, Heap::kOld)); | 1797 TypedData::Handle(TypedData::New(cid, new_size, Heap::kOld)); |
| 1793 TypedData::Copy(new_data, 0, old_data, 0, old_size * elm_size); | 1798 TypedData::Copy(new_data, 0, old_data, 0, old_size * elm_size); |
| 1794 typed_data_cell.SetAt(0, new_data); | 1799 typed_data_cell.SetAt(0, new_data); |
| 1795 arguments.SetReturn(new_data); | 1800 arguments.SetReturn(new_data); |
| 1796 } | 1801 } |
| 1797 | 1802 |
| 1798 | 1803 |
| 1799 } // namespace dart | 1804 } // namespace dart |
| OLD | NEW |