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

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

Issue 2374273002: Fix a throw returning to a frame marked for lazy deopt that captures the stacktrace. (Closed)
Patch Set: . Created 4 years, 2 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 | « runtime/vm/object.h ('k') | runtime/vm/raw_object.h » ('j') | 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) 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/object.h" 5 #include "vm/object.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/assembler.h" 9 #include "vm/assembler.h"
10 #include "vm/become.h" 10 #include "vm/become.h"
(...skipping 14211 matching lines...) Expand 10 before | Expand all | Expand 10 after
14222 { 14222 {
14223 uword size = Code::InstanceSize(pointer_offsets_length); 14223 uword size = Code::InstanceSize(pointer_offsets_length);
14224 RawObject* raw = Object::Allocate(Code::kClassId, size, Heap::kOld); 14224 RawObject* raw = Object::Allocate(Code::kClassId, size, Heap::kOld);
14225 NoSafepointScope no_safepoint; 14225 NoSafepointScope no_safepoint;
14226 result ^= raw; 14226 result ^= raw;
14227 result.set_pointer_offsets_length(pointer_offsets_length); 14227 result.set_pointer_offsets_length(pointer_offsets_length);
14228 result.set_is_optimized(false); 14228 result.set_is_optimized(false);
14229 result.set_is_alive(false); 14229 result.set_is_alive(false);
14230 result.set_comments(Comments::New(0)); 14230 result.set_comments(Comments::New(0));
14231 result.set_compile_timestamp(0); 14231 result.set_compile_timestamp(0);
14232 result.set_lazy_deopt_pc_offset(kInvalidPc); 14232 result.set_lazy_deopt_return_pc_offset(kInvalidPc);
14233 result.set_lazy_deopt_throw_pc_offset(kInvalidPc);
14233 result.set_pc_descriptors(Object::empty_descriptors()); 14234 result.set_pc_descriptors(Object::empty_descriptors());
14234 } 14235 }
14235 return result.raw(); 14236 return result.raw();
14236 } 14237 }
14237 14238
14238 14239
14239 RawCode* Code::FinalizeCode(const char* name, 14240 RawCode* Code::FinalizeCode(const char* name,
14240 Assembler* assembler, 14241 Assembler* assembler,
14241 bool optimized) { 14242 bool optimized) {
14242 Isolate* isolate = Isolate::Current(); 14243 Isolate* isolate = Isolate::Current();
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
14536 // store buffer update is not needed here. 14537 // store buffer update is not needed here.
14537 StorePointer(&raw_ptr()->active_instructions_, instructions); 14538 StorePointer(&raw_ptr()->active_instructions_, instructions);
14538 StoreNonPointer(&raw_ptr()->entry_point_, 14539 StoreNonPointer(&raw_ptr()->entry_point_,
14539 Instructions::UncheckedEntryPoint(instructions)); 14540 Instructions::UncheckedEntryPoint(instructions));
14540 StoreNonPointer(&raw_ptr()->checked_entry_point_, 14541 StoreNonPointer(&raw_ptr()->checked_entry_point_,
14541 Instructions::CheckedEntryPoint(instructions)); 14542 Instructions::CheckedEntryPoint(instructions));
14542 #endif 14543 #endif
14543 } 14544 }
14544 14545
14545 14546
14546 uword Code::GetLazyDeoptPc() const { 14547 uword Code::GetLazyDeoptReturnPc() const {
14547 return (lazy_deopt_pc_offset() != kInvalidPc) 14548 return (lazy_deopt_return_pc_offset() != kInvalidPc)
14548 ? PayloadStart() + lazy_deopt_pc_offset() : 0; 14549 ? PayloadStart() + lazy_deopt_return_pc_offset() : 0;
14549 } 14550 }
14550 14551
14551 14552
14553 uword Code::GetLazyDeoptThrowPc() const {
14554 return (lazy_deopt_throw_pc_offset() != kInvalidPc)
14555 ? PayloadStart() + lazy_deopt_throw_pc_offset() : 0;
14556 }
14557
14558
14552 RawStackmap* Code::GetStackmap( 14559 RawStackmap* Code::GetStackmap(
14553 uint32_t pc_offset, Array* maps, Stackmap* map) const { 14560 uint32_t pc_offset, Array* maps, Stackmap* map) const {
14554 // This code is used during iterating frames during a GC and hence it 14561 // This code is used during iterating frames during a GC and hence it
14555 // should not in turn start a GC. 14562 // should not in turn start a GC.
14556 NoSafepointScope no_safepoint; 14563 NoSafepointScope no_safepoint;
14557 if (stackmaps() == Array::null()) { 14564 if (stackmaps() == Array::null()) {
14558 // No stack maps are present in the code object which means this 14565 // No stack maps are present in the code object which means this
14559 // frame relies on tagged pointers. 14566 // frame relies on tagged pointers.
14560 return Stackmap::null(); 14567 return Stackmap::null();
14561 } 14568 }
(...skipping 8448 matching lines...) Expand 10 before | Expand all | Expand 10 after
23010 return UserTag::null(); 23017 return UserTag::null();
23011 } 23018 }
23012 23019
23013 23020
23014 const char* UserTag::ToCString() const { 23021 const char* UserTag::ToCString() const {
23015 const String& tag_label = String::Handle(label()); 23022 const String& tag_label = String::Handle(label());
23016 return tag_label.ToCString(); 23023 return tag_label.ToCString();
23017 } 23024 }
23018 23025
23019 } // namespace dart 23026 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/raw_object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698