| 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 8549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8560 for (intptr_t i = 0; i < Length(); i++) { | 8560 for (intptr_t i = 0; i < Length(); i++) { |
| 8561 index += OS::SNPrint((buffer + index), | 8561 index += OS::SNPrint((buffer + index), |
| 8562 (len - index), | 8562 (len - index), |
| 8563 "[%s]", | 8563 "[%s]", |
| 8564 deopt_instrs[i]->ToCString()); | 8564 deopt_instrs[i]->ToCString()); |
| 8565 } | 8565 } |
| 8566 return buffer; | 8566 return buffer; |
| 8567 } | 8567 } |
| 8568 | 8568 |
| 8569 | 8569 |
| 8570 // Returns a bool so it can be asserted. |
| 8571 bool DeoptInfo::VerifyDecompression(const GrowableArray<DeoptInstr*>& original, |
| 8572 const Array& deopt_table) const { |
| 8573 intptr_t length = TranslationLength(); |
| 8574 GrowableArray<DeoptInstr*> unpacked(length); |
| 8575 ToInstructions(deopt_table, &unpacked); |
| 8576 ASSERT(unpacked.length() == original.length()); |
| 8577 for (intptr_t i = 0; i < unpacked.length(); ++i) { |
| 8578 ASSERT(unpacked[i]->Equals(*original[i])); |
| 8579 } |
| 8580 return true; |
| 8581 } |
| 8582 |
| 8583 |
| 8570 void DeoptInfo::PrintToJSONStream(JSONStream* stream, bool ref) const { | 8584 void DeoptInfo::PrintToJSONStream(JSONStream* stream, bool ref) const { |
| 8571 JSONObject jsobj(stream); | 8585 JSONObject jsobj(stream); |
| 8572 } | 8586 } |
| 8573 | 8587 |
| 8574 | 8588 |
| 8575 RawDeoptInfo* DeoptInfo::New(intptr_t num_commands) { | 8589 RawDeoptInfo* DeoptInfo::New(intptr_t num_commands) { |
| 8576 ASSERT(Object::deopt_info_class() != Class::null()); | 8590 ASSERT(Object::deopt_info_class() != Class::null()); |
| 8577 if ((num_commands < 0) || (num_commands > kMaxElements)) { | 8591 if ((num_commands < 0) || (num_commands > kMaxElements)) { |
| 8578 FATAL1("Fatal error in DeoptInfo::New(): invalid num_commands %" Pd "\n", | 8592 FATAL1("Fatal error in DeoptInfo::New(): invalid num_commands %" Pd "\n", |
| 8579 num_commands); | 8593 num_commands); |
| (...skipping 6331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14911 return "_MirrorReference"; | 14925 return "_MirrorReference"; |
| 14912 } | 14926 } |
| 14913 | 14927 |
| 14914 | 14928 |
| 14915 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const { | 14929 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const { |
| 14916 JSONObject jsobj(stream); | 14930 JSONObject jsobj(stream); |
| 14917 } | 14931 } |
| 14918 | 14932 |
| 14919 | 14933 |
| 14920 } // namespace dart | 14934 } // namespace dart |
| OLD | NEW |