| 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 8523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8534 for (intptr_t i = 0; i < Length(); i++) { | 8534 for (intptr_t i = 0; i < Length(); i++) { |
| 8535 index += OS::SNPrint((buffer + index), | 8535 index += OS::SNPrint((buffer + index), |
| 8536 (len - index), | 8536 (len - index), |
| 8537 "[%s]", | 8537 "[%s]", |
| 8538 deopt_instrs[i]->ToCString()); | 8538 deopt_instrs[i]->ToCString()); |
| 8539 } | 8539 } |
| 8540 return buffer; | 8540 return buffer; |
| 8541 } | 8541 } |
| 8542 | 8542 |
| 8543 | 8543 |
| 8544 // Returns a bool so it can be asserted. |
| 8545 bool DeoptInfo::VerifyDecompression(const GrowableArray<DeoptInstr*>& original, |
| 8546 const Array& deopt_table) const { |
| 8547 intptr_t length = TranslationLength(); |
| 8548 GrowableArray<DeoptInstr*> unpacked(length); |
| 8549 ToInstructions(deopt_table, &unpacked); |
| 8550 ASSERT(unpacked.length() == original.length()); |
| 8551 for (intptr_t i = 0; i < unpacked.length(); ++i) { |
| 8552 ASSERT(unpacked[i]->Equals(*original[i])); |
| 8553 } |
| 8554 return true; |
| 8555 } |
| 8556 |
| 8557 |
| 8544 void DeoptInfo::PrintToJSONStream(JSONStream* stream, bool ref) const { | 8558 void DeoptInfo::PrintToJSONStream(JSONStream* stream, bool ref) const { |
| 8545 JSONObject jsobj(stream); | 8559 JSONObject jsobj(stream); |
| 8546 } | 8560 } |
| 8547 | 8561 |
| 8548 | 8562 |
| 8549 RawDeoptInfo* DeoptInfo::New(intptr_t num_commands) { | 8563 RawDeoptInfo* DeoptInfo::New(intptr_t num_commands) { |
| 8550 ASSERT(Object::deopt_info_class() != Class::null()); | 8564 ASSERT(Object::deopt_info_class() != Class::null()); |
| 8551 if ((num_commands < 0) || (num_commands > kMaxElements)) { | 8565 if ((num_commands < 0) || (num_commands > kMaxElements)) { |
| 8552 FATAL1("Fatal error in DeoptInfo::New(): invalid num_commands %" Pd "\n", | 8566 FATAL1("Fatal error in DeoptInfo::New(): invalid num_commands %" Pd "\n", |
| 8553 num_commands); | 8567 num_commands); |
| (...skipping 6331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14885 return "_MirrorReference"; | 14899 return "_MirrorReference"; |
| 14886 } | 14900 } |
| 14887 | 14901 |
| 14888 | 14902 |
| 14889 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const { | 14903 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const { |
| 14890 JSONObject jsobj(stream); | 14904 JSONObject jsobj(stream); |
| 14891 } | 14905 } |
| 14892 | 14906 |
| 14893 | 14907 |
| 14894 } // namespace dart | 14908 } // namespace dart |
| OLD | NEW |