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

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

Issue 171513003: Don't forget to subtract materialization instructions when computing the offset of the frame pointe… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: add accessor Created 6 years, 10 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/object.h ('k') | runtime/vm/stack_frame.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/cpu.h" 10 #include "vm/cpu.h"
(...skipping 9793 matching lines...) Expand 10 before | Expand all | Expand 10 after
9804 return *(EntryAddr(index, kFromIndex)); 9804 return *(EntryAddr(index, kFromIndex));
9805 } 9805 }
9806 9806
9807 9807
9808 intptr_t DeoptInfo::Instruction(intptr_t index) const { 9808 intptr_t DeoptInfo::Instruction(intptr_t index) const {
9809 return *(EntryAddr(index, kInstruction)); 9809 return *(EntryAddr(index, kInstruction));
9810 } 9810 }
9811 9811
9812 9812
9813 intptr_t DeoptInfo::FrameSize() const { 9813 intptr_t DeoptInfo::FrameSize() const {
9814 intptr_t pos = 0; 9814 return TranslationLength() - NumMaterializations();
9815 while (Instruction(pos) == DeoptInstr::kMaterializeObject) {
9816 pos++;
9817 }
9818 return TranslationLength() - pos;
9819 } 9815 }
9820 9816
9821 9817
9822 intptr_t DeoptInfo::TranslationLength() const { 9818 intptr_t DeoptInfo::TranslationLength() const {
9823 intptr_t length = Length(); 9819 intptr_t length = Length();
9824 if (Instruction(length - 1) != DeoptInstr::kSuffix) return length; 9820 if (Instruction(length - 1) != DeoptInstr::kSuffix) return length;
9825 9821
9826 // If the last command is a suffix, add in the length of the suffix and 9822 // If the last command is a suffix, add in the length of the suffix and
9827 // do not count the suffix command as a translation command. 9823 // do not count the suffix command as a translation command.
9828 intptr_t ignored = 0; 9824 intptr_t ignored = 0;
9829 intptr_t suffix_length = 9825 intptr_t suffix_length =
9830 DeoptInstr::DecodeSuffix(FromIndex(length - 1), &ignored); 9826 DeoptInstr::DecodeSuffix(FromIndex(length - 1), &ignored);
9831 return length + suffix_length - 1; 9827 return length + suffix_length - 1;
9832 } 9828 }
9833 9829
9834 9830
9831 intptr_t DeoptInfo::NumMaterializations() const {
9832 intptr_t pos = 0;
9833 while (Instruction(pos) == DeoptInstr::kMaterializeObject) {
9834 pos++;
9835 }
9836 return pos;
9837 }
9838
9839
9835 void DeoptInfo::ToInstructions(const Array& table, 9840 void DeoptInfo::ToInstructions(const Array& table,
9836 GrowableArray<DeoptInstr*>* instructions) const { 9841 GrowableArray<DeoptInstr*>* instructions) const {
9837 ASSERT(instructions->is_empty()); 9842 ASSERT(instructions->is_empty());
9838 Smi& offset = Smi::Handle(); 9843 Smi& offset = Smi::Handle();
9839 DeoptInfo& info = DeoptInfo::Handle(raw()); 9844 DeoptInfo& info = DeoptInfo::Handle(raw());
9840 Smi& reason = Smi::Handle(); 9845 Smi& reason = Smi::Handle();
9841 intptr_t index = 0; 9846 intptr_t index = 0;
9842 intptr_t length = TranslationLength(); 9847 intptr_t length = TranslationLength();
9843 while (index < length) { 9848 while (index < length) {
9844 intptr_t instruction = info.Instruction(index); 9849 intptr_t instruction = info.Instruction(index);
(...skipping 7590 matching lines...) Expand 10 before | Expand all | Expand 10 after
17435 return "_MirrorReference"; 17440 return "_MirrorReference";
17436 } 17441 }
17437 17442
17438 17443
17439 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const { 17444 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const {
17440 Instance::PrintToJSONStream(stream, ref); 17445 Instance::PrintToJSONStream(stream, ref);
17441 } 17446 }
17442 17447
17443 17448
17444 } // namespace dart 17449 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/stack_frame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698