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

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

Issue 2141503005: Fix language/vm/optimized_stacktrace_test reload crash (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 5 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 | no next file » | no next file with comments »
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"
(...skipping 1301 matching lines...) Expand 10 before | Expand all | Expand 10 after
1312 // variable descriptors of functions. Parsing may trigger 1312 // variable descriptors of functions. Parsing may trigger
1313 // code execution, e.g. to compute compile-time constants. Thus, 1313 // code execution, e.g. to compute compile-time constants. Thus,
1314 // disable FLAG_stacktrace_every during trace collection to prevent 1314 // disable FLAG_stacktrace_every during trace collection to prevent
1315 // recursive stack trace collection. 1315 // recursive stack trace collection.
1316 intptr_t saved_stacktrace_every = FLAG_stacktrace_every; 1316 intptr_t saved_stacktrace_every = FLAG_stacktrace_every;
1317 FLAG_stacktrace_every = 0; 1317 FLAG_stacktrace_every = 0;
1318 DebuggerStackTrace* stack = isolate->debugger()->StackTrace(); 1318 DebuggerStackTrace* stack = isolate->debugger()->StackTrace();
1319 intptr_t num_frames = stack->Length(); 1319 intptr_t num_frames = stack->Length();
1320 for (intptr_t i = 0; i < num_frames; i++) { 1320 for (intptr_t i = 0; i < num_frames; i++) {
1321 ActivationFrame* frame = stack->FrameAt(i); 1321 ActivationFrame* frame = stack->FrameAt(i);
1322 // Ensure that we have unoptimized code.
1323 frame->function().EnsureHasCompiledUnoptimizedCode();
1322 // Variable locations and number are unknown when precompiling. 1324 // Variable locations and number are unknown when precompiling.
1323 const int num_vars = 1325 const int num_vars =
1324 FLAG_precompiled_runtime ? 0 : frame->NumLocalVariables(); 1326 FLAG_precompiled_runtime ? 0 : frame->NumLocalVariables();
1325 TokenPosition unused = TokenPosition::kNoSource; 1327 TokenPosition unused = TokenPosition::kNoSource;
1326 for (intptr_t v = 0; v < num_vars; v++) { 1328 for (intptr_t v = 0; v < num_vars; v++) {
1327 frame->VariableAt(v, &var_name, &unused, &unused, &var_value); 1329 frame->VariableAt(v, &var_name, &unused, &unused, &var_value);
1328 } 1330 }
1329 } 1331 }
1330 FLAG_stacktrace_every = saved_stacktrace_every; 1332 FLAG_stacktrace_every = saved_stacktrace_every;
1331 } 1333 }
(...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after
1892 const intptr_t elm_size = old_data.ElementSizeInBytes(); 1894 const intptr_t elm_size = old_data.ElementSizeInBytes();
1893 const TypedData& new_data = 1895 const TypedData& new_data =
1894 TypedData::Handle(TypedData::New(cid, new_size, Heap::kOld)); 1896 TypedData::Handle(TypedData::New(cid, new_size, Heap::kOld));
1895 TypedData::Copy(new_data, 0, old_data, 0, old_size * elm_size); 1897 TypedData::Copy(new_data, 0, old_data, 0, old_size * elm_size);
1896 typed_data_cell.SetAt(0, new_data); 1898 typed_data_cell.SetAt(0, new_data);
1897 arguments.SetReturn(new_data); 1899 arguments.SetReturn(new_data);
1898 } 1900 }
1899 1901
1900 1902
1901 } // namespace dart 1903 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698