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/code_generator.cc

Issue 2125053002: Fix crash with OSR after isolate reload. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: move check to right place 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 1323 matching lines...) Expand 10 before | Expand all | Expand 10 after
1334 UNREACHABLE(); 1334 UNREACHABLE();
1335 } 1335 }
1336 1336
1337 if ((stack_overflow_flags & Thread::kOsrRequest) != 0) { 1337 if ((stack_overflow_flags & Thread::kOsrRequest) != 0) {
1338 ASSERT(FLAG_use_osr); 1338 ASSERT(FLAG_use_osr);
1339 DartFrameIterator iterator; 1339 DartFrameIterator iterator;
1340 StackFrame* frame = iterator.NextFrame(); 1340 StackFrame* frame = iterator.NextFrame();
1341 ASSERT(frame != NULL); 1341 ASSERT(frame != NULL);
1342 const Code& code = Code::ZoneHandle(frame->LookupDartCode()); 1342 const Code& code = Code::ZoneHandle(frame->LookupDartCode());
1343 ASSERT(!code.IsNull()); 1343 ASSERT(!code.IsNull());
1344 ASSERT(!code.is_optimized());
1344 const Function& function = Function::Handle(code.function()); 1345 const Function& function = Function::Handle(code.function());
1345 ASSERT(!function.IsNull()); 1346 ASSERT(!function.IsNull());
1347
1348 // If the code of the frame does not match the function's unoptimized code,
1349 // we bail out since the code was reset by an isolate reload.
1350 if (code.raw() != function.unoptimized_code()) {
1351 return;
1352 }
1353
1346 // Since the code is referenced from the frame and the ZoneHandle, 1354 // Since the code is referenced from the frame and the ZoneHandle,
1347 // it cannot have been removed from the function. 1355 // it cannot have been removed from the function.
1348 ASSERT(function.HasCode()); 1356 ASSERT(function.HasCode());
1349 // Don't do OSR on intrinsified functions: The intrinsic code expects to be 1357 // Don't do OSR on intrinsified functions: The intrinsic code expects to be
1350 // called like a regular function and can't be entered via OSR. 1358 // called like a regular function and can't be entered via OSR.
1351 if (!Compiler::CanOptimizeFunction(thread, function) || 1359 if (!Compiler::CanOptimizeFunction(thread, function) ||
1352 function.is_intrinsic()) { 1360 function.is_intrinsic()) {
1353 return; 1361 return;
1354 } 1362 }
1355 1363
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after
1882 const intptr_t elm_size = old_data.ElementSizeInBytes(); 1890 const intptr_t elm_size = old_data.ElementSizeInBytes();
1883 const TypedData& new_data = 1891 const TypedData& new_data =
1884 TypedData::Handle(TypedData::New(cid, new_size, Heap::kOld)); 1892 TypedData::Handle(TypedData::New(cid, new_size, Heap::kOld));
1885 TypedData::Copy(new_data, 0, old_data, 0, old_size * elm_size); 1893 TypedData::Copy(new_data, 0, old_data, 0, old_size * elm_size);
1886 typed_data_cell.SetAt(0, new_data); 1894 typed_data_cell.SetAt(0, new_data);
1887 arguments.SetReturn(new_data); 1895 arguments.SetReturn(new_data);
1888 } 1896 }
1889 1897
1890 1898
1891 } // namespace dart 1899 } // 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