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

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

Issue 10885039: Deoptimization can occur at Dart calls (includes native calls to C) but not at runtime calls. This … (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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 | Annotate | Revision Log
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/code_descriptors.h" 5 #include "vm/code_descriptors.h"
6 6
7 #include "vm/code_generator.h"
8
7 namespace dart { 9 namespace dart {
8 10
9 void DescriptorList::AddDescriptor(PcDescriptors::Kind kind, 11 void DescriptorList::AddDescriptor(PcDescriptors::Kind kind,
10 intptr_t pc_offset, 12 intptr_t pc_offset,
11 intptr_t deopt_id, 13 intptr_t deopt_id,
12 intptr_t token_index, 14 intptr_t token_index,
13 intptr_t try_index) { 15 intptr_t try_index) {
14 struct PcDesc data; 16 struct PcDesc data;
15 data.pc_offset = pc_offset; 17 data.pc_offset = pc_offset;
16 data.kind = kind; 18 data.kind = kind;
17 data.deopt_id = deopt_id; 19 data.deopt_id = deopt_id;
18 data.token_index = token_index; 20 data.token_index = token_index;
19 data.try_index = try_index; 21 data.try_index = try_index;
20 list_.Add(data); 22 list_.Add(data);
21 } 23 }
22 24
23 25
24 void DescriptorList::AddDeoptInfo(intptr_t pc_offset, 26 void DescriptorList::AddDeoptIndex(intptr_t pc_offset,
25 intptr_t deopt_id, 27 intptr_t deopt_id,
26 intptr_t token_index, 28 intptr_t deopt_reason,
27 intptr_t deopt_array_index) { 29 intptr_t deopt_array_index) {
28 struct PcDesc data; 30 struct PcDesc data;
29 data.pc_offset = pc_offset; 31 data.pc_offset = pc_offset;
30 data.kind = PcDescriptors::kDeoptIndex; 32 data.kind = PcDescriptors::kDeoptIndex;
31 data.deopt_id = deopt_id; 33 data.deopt_id = deopt_id;
32 data.token_index = token_index; 34 // Token index is used for deopt reason.
35 ASSERT((kDeoptUnknown <= deopt_reason) && (deopt_reason < kDeoptNumReasons));
36 data.token_index = deopt_reason;
siva 2012/08/30 01:37:30 overloading token_index field as deopt_reason can
srdjan 2012/08/30 17:16:16 Done.
33 // Try_index is reused for deopt_array_index. 37 // Try_index is reused for deopt_array_index.
34 data.try_index = deopt_array_index; 38 data.try_index = deopt_array_index;
35 list_.Add(data); 39 list_.Add(data);
36 } 40 }
37 41
38 42
39 RawPcDescriptors* DescriptorList::FinalizePcDescriptors(uword entry_point) { 43 RawPcDescriptors* DescriptorList::FinalizePcDescriptors(uword entry_point) {
40 intptr_t num_descriptors = Length(); 44 intptr_t num_descriptors = Length();
41 const PcDescriptors& descriptors = 45 const PcDescriptors& descriptors =
42 PcDescriptors::Handle(PcDescriptors::New(num_descriptors)); 46 PcDescriptors::Handle(PcDescriptors::New(num_descriptors));
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 } 95 }
92 96
93 97
94 RawStackmap* StackmapTableBuilder::MapAt(int index) const { 98 RawStackmap* StackmapTableBuilder::MapAt(int index) const {
95 Stackmap& map = Stackmap::Handle(); 99 Stackmap& map = Stackmap::Handle();
96 map ^= list_.At(index); 100 map ^= list_.At(index);
97 return map.raw(); 101 return map.raw();
98 } 102 }
99 103
100 } // namespace dart 104 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698