OLD | NEW |
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 7510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7521 intptr_t DeoptInfo::FromIndex(intptr_t index) const { | 7521 intptr_t DeoptInfo::FromIndex(intptr_t index) const { |
7522 return *(EntryAddr(index, kFromIndex)); | 7522 return *(EntryAddr(index, kFromIndex)); |
7523 } | 7523 } |
7524 | 7524 |
7525 | 7525 |
7526 intptr_t DeoptInfo::Instruction(intptr_t index) const { | 7526 intptr_t DeoptInfo::Instruction(intptr_t index) const { |
7527 return *(EntryAddr(index, kInstruction)); | 7527 return *(EntryAddr(index, kInstruction)); |
7528 } | 7528 } |
7529 | 7529 |
7530 | 7530 |
| 7531 intptr_t DeoptInfo::FrameSize() const { |
| 7532 intptr_t pos = 0; |
| 7533 while (Instruction(pos) == DeoptInstr::kMaterializeObject) { |
| 7534 pos++; |
| 7535 } |
| 7536 return TranslationLength() - pos; |
| 7537 } |
| 7538 |
| 7539 |
7531 intptr_t DeoptInfo::TranslationLength() const { | 7540 intptr_t DeoptInfo::TranslationLength() const { |
7532 intptr_t length = Length(); | 7541 intptr_t length = Length(); |
7533 if (Instruction(length - 1) != DeoptInstr::kSuffix) return length; | 7542 if (Instruction(length - 1) != DeoptInstr::kSuffix) return length; |
7534 | 7543 |
7535 // If the last command is a suffix, add in the length of the suffix and | 7544 // If the last command is a suffix, add in the length of the suffix and |
7536 // do not count the suffix command as a translation command. | 7545 // do not count the suffix command as a translation command. |
7537 intptr_t ignored = 0; | 7546 intptr_t ignored = 0; |
7538 intptr_t suffix_length = | 7547 intptr_t suffix_length = |
7539 DeoptInstr::DecodeSuffix(FromIndex(length - 1), &ignored); | 7548 DeoptInstr::DecodeSuffix(FromIndex(length - 1), &ignored); |
7540 return length + suffix_length - 1; | 7549 return length + suffix_length - 1; |
(...skipping 5684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13225 } | 13234 } |
13226 return result.raw(); | 13235 return result.raw(); |
13227 } | 13236 } |
13228 | 13237 |
13229 | 13238 |
13230 const char* WeakProperty::ToCString() const { | 13239 const char* WeakProperty::ToCString() const { |
13231 return "_WeakProperty"; | 13240 return "_WeakProperty"; |
13232 } | 13241 } |
13233 | 13242 |
13234 } // namespace dart | 13243 } // namespace dart |
OLD | NEW |