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

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

Issue 208533004: When deoptimizing use the code stored in the deopt information instead of current unoptimized code … (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 9 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
« no previous file with comments | « runtime/vm/deopt_instructions.h ('k') | runtime/vm/stack_frame.cc » ('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) 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/deopt_instructions.h" 5 #include "vm/deopt_instructions.h"
6 6
7 #include "vm/assembler.h" 7 #include "vm/assembler.h"
8 #include "vm/code_patcher.h" 8 #include "vm/code_patcher.h"
9 #include "vm/intermediate_language.h" 9 #include "vm/intermediate_language.h"
10 #include "vm/locations.h" 10 #include "vm/locations.h"
(...skipping 1086 matching lines...) Expand 10 before | Expand all | Expand 10 after
1097 1097
1098 intptr_t DeoptInstr::DecodeSuffix(intptr_t source_index, 1098 intptr_t DeoptInstr::DecodeSuffix(intptr_t source_index,
1099 intptr_t* info_number) { 1099 intptr_t* info_number) {
1100 *info_number = DeoptSuffixInstr::InfoNumber::decode(source_index); 1100 *info_number = DeoptSuffixInstr::InfoNumber::decode(source_index);
1101 return DeoptSuffixInstr::SuffixLength::decode(source_index); 1101 return DeoptSuffixInstr::SuffixLength::decode(source_index);
1102 } 1102 }
1103 1103
1104 1104
1105 uword DeoptInstr::GetRetAddress(DeoptInstr* instr, 1105 uword DeoptInstr::GetRetAddress(DeoptInstr* instr,
1106 const Array& object_table, 1106 const Array& object_table,
1107 Function* func) { 1107 Code* code) {
1108 ASSERT(instr->kind() == kRetAddress); 1108 ASSERT(instr->kind() == kRetAddress);
1109 DeoptRetAddressInstr* ret_address_instr = 1109 DeoptRetAddressInstr* ret_address_instr =
1110 static_cast<DeoptRetAddressInstr*>(instr); 1110 static_cast<DeoptRetAddressInstr*>(instr);
1111 // The following assert may trigger when displaying a backtrace 1111 // The following assert may trigger when displaying a backtrace
1112 // from the simulator. 1112 // from the simulator.
1113 ASSERT(Isolate::IsDeoptAfter(ret_address_instr->deopt_id())); 1113 ASSERT(Isolate::IsDeoptAfter(ret_address_instr->deopt_id()));
1114 ASSERT(!object_table.IsNull()); 1114 ASSERT(!object_table.IsNull());
1115 ASSERT(func != NULL); 1115 ASSERT(code != NULL);
1116 Code& code = Code::Handle(); 1116 *code ^= object_table.At(ret_address_instr->object_table_index());
1117 code ^= object_table.At(ret_address_instr->object_table_index()); 1117 ASSERT(!code->IsNull());
1118 ASSERT(!code.IsNull()); 1118 uword res = code->GetPcForDeoptId(ret_address_instr->deopt_id(),
1119 *func ^= code.function(); 1119 PcDescriptors::kDeopt);
1120 uword res = code.GetPcForDeoptId(ret_address_instr->deopt_id(),
1121 PcDescriptors::kDeopt);
1122 ASSERT(res != 0); 1120 ASSERT(res != 0);
1123 return res; 1121 return res;
1124 } 1122 }
1125 1123
1126 1124
1127 DeoptInstr* DeoptInstr::Create(intptr_t kind_as_int, intptr_t source_index) { 1125 DeoptInstr* DeoptInstr::Create(intptr_t kind_as_int, intptr_t source_index) {
1128 Kind kind = static_cast<Kind>(kind_as_int); 1126 Kind kind = static_cast<Kind>(kind_as_int);
1129 switch (kind) { 1127 switch (kind) {
1130 case kStackSlot: return new DeoptStackSlotInstr(source_index); 1128 case kStackSlot: return new DeoptStackSlotInstr(source_index);
1131 case kDoubleStackSlot: return new DeoptDoubleStackSlotInstr(source_index); 1129 case kDoubleStackSlot: return new DeoptDoubleStackSlotInstr(source_index);
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
1479 Smi* offset, 1477 Smi* offset,
1480 DeoptInfo* info, 1478 DeoptInfo* info,
1481 Smi* reason) { 1479 Smi* reason) {
1482 intptr_t i = index * kEntrySize; 1480 intptr_t i = index * kEntrySize;
1483 *offset ^= table.At(i); 1481 *offset ^= table.At(i);
1484 *info ^= table.At(i + 1); 1482 *info ^= table.At(i + 1);
1485 *reason ^= table.At(i + 2); 1483 *reason ^= table.At(i + 2);
1486 } 1484 }
1487 1485
1488 } // namespace dart 1486 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/deopt_instructions.h ('k') | runtime/vm/stack_frame.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698