| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
| 8 #include "src/allocation-site-scopes.h" | 8 #include "src/allocation-site-scopes.h" |
| 9 #include "src/api.h" | 9 #include "src/api.h" |
| 10 #include "src/arguments.h" | 10 #include "src/arguments.h" |
| (...skipping 11104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11115 | 11115 |
| 11116 #ifdef ENABLE_DISASSEMBLER | 11116 #ifdef ENABLE_DISASSEMBLER |
| 11117 | 11117 |
| 11118 void DeoptimizationInputData::DeoptimizationInputDataPrint( | 11118 void DeoptimizationInputData::DeoptimizationInputDataPrint( |
| 11119 OStream& os) { // NOLINT | 11119 OStream& os) { // NOLINT |
| 11120 disasm::NameConverter converter; | 11120 disasm::NameConverter converter; |
| 11121 int deopt_count = DeoptCount(); | 11121 int deopt_count = DeoptCount(); |
| 11122 os << "Deoptimization Input Data (deopt points = " << deopt_count << ")\n"; | 11122 os << "Deoptimization Input Data (deopt points = " << deopt_count << ")\n"; |
| 11123 if (0 != deopt_count) { | 11123 if (0 != deopt_count) { |
| 11124 os << " index ast id argc pc"; | 11124 os << " index ast id argc pc"; |
| 11125 if (FLAG_print_code_verbose) os << "commands"; | 11125 if (FLAG_print_code_verbose) os << " commands"; |
| 11126 os << "\n"; | 11126 os << "\n"; |
| 11127 } | 11127 } |
| 11128 for (int i = 0; i < deopt_count; i++) { | 11128 for (int i = 0; i < deopt_count; i++) { |
| 11129 // TODO(svenpanne) Add some basic formatting to our streams. | 11129 // TODO(svenpanne) Add some basic formatting to our streams. |
| 11130 Vector<char> buf1 = Vector<char>::New(128); | 11130 Vector<char> buf1 = Vector<char>::New(128); |
| 11131 SNPrintF(buf1, "%6d %6d %6d %6d", i, AstId(i).ToInt(), | 11131 SNPrintF(buf1, "%6d %6d %6d %6d", i, AstId(i).ToInt(), |
| 11132 ArgumentsStackHeight(i)->value(), Pc(i)->value()); | 11132 ArgumentsStackHeight(i)->value(), Pc(i)->value()); |
| 11133 os << buf1.start(); | 11133 os << buf1.start(); |
| 11134 | 11134 |
| 11135 if (!FLAG_print_code_verbose) { | 11135 if (!FLAG_print_code_verbose) { |
| 11136 os << "\n"; | 11136 os << "\n"; |
| 11137 continue; | 11137 continue; |
| 11138 } | 11138 } |
| 11139 // Print details of the frame translation. | 11139 // Print details of the frame translation. |
| 11140 int translation_index = TranslationIndex(i)->value(); | 11140 int translation_index = TranslationIndex(i)->value(); |
| 11141 TranslationIterator iterator(TranslationByteArray(), translation_index); | 11141 TranslationIterator iterator(TranslationByteArray(), translation_index); |
| 11142 Translation::Opcode opcode = | 11142 Translation::Opcode opcode = |
| 11143 static_cast<Translation::Opcode>(iterator.Next()); | 11143 static_cast<Translation::Opcode>(iterator.Next()); |
| 11144 DCHECK(Translation::BEGIN == opcode); | 11144 DCHECK(Translation::BEGIN == opcode); |
| 11145 int frame_count = iterator.Next(); | 11145 int frame_count = iterator.Next(); |
| 11146 int jsframe_count = iterator.Next(); | 11146 int jsframe_count = iterator.Next(); |
| 11147 os << " " << Translation::StringFor(opcode) | 11147 os << " " << Translation::StringFor(opcode) |
| 11148 << " {frame count=" << frame_count | 11148 << " {frame count=" << frame_count |
| 11149 << ", js frame count=" << jsframe_count << "}\n"; | 11149 << ", js frame count=" << jsframe_count << "}\n"; |
| 11150 | 11150 |
| 11151 while (iterator.HasNext() && | 11151 while (iterator.HasNext() && |
| 11152 Translation::BEGIN != | 11152 Translation::BEGIN != |
| 11153 (opcode = static_cast<Translation::Opcode>(iterator.Next()))) { | 11153 (opcode = static_cast<Translation::Opcode>(iterator.Next()))) { |
| 11154 Vector<char> buf2 = Vector<char>::New(128); | 11154 Vector<char> buf2 = Vector<char>::New(128); |
| 11155 SNPrintF(buf2, "%24s %s ", "", Translation::StringFor(opcode)); | 11155 SNPrintF(buf2, "%27s %s ", "", Translation::StringFor(opcode)); |
| 11156 os << buf2.start(); | 11156 os << buf2.start(); |
| 11157 | 11157 |
| 11158 switch (opcode) { | 11158 switch (opcode) { |
| 11159 case Translation::BEGIN: | 11159 case Translation::BEGIN: |
| 11160 UNREACHABLE(); | 11160 UNREACHABLE(); |
| 11161 break; | 11161 break; |
| 11162 | 11162 |
| 11163 case Translation::JS_FRAME: { | 11163 case Translation::JS_FRAME: { |
| 11164 int ast_id = iterator.Next(); | 11164 int ast_id = iterator.Next(); |
| 11165 int function_id = iterator.Next(); | 11165 int function_id = iterator.Next(); |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11271 } | 11271 } |
| 11272 } | 11272 } |
| 11273 os << "\n"; | 11273 os << "\n"; |
| 11274 } | 11274 } |
| 11275 } | 11275 } |
| 11276 | 11276 |
| 11277 int return_address_patch_count = ReturnAddressPatchCount(); | 11277 int return_address_patch_count = ReturnAddressPatchCount(); |
| 11278 if (return_address_patch_count != 0) { | 11278 if (return_address_patch_count != 0) { |
| 11279 os << "Return address patch data (count = " << return_address_patch_count | 11279 os << "Return address patch data (count = " << return_address_patch_count |
| 11280 << ")\n"; | 11280 << ")\n"; |
| 11281 os << "index pc patched_pc\n"; | 11281 os << " index pc patched_pc\n"; |
| 11282 } | 11282 } |
| 11283 for (int i = 0; i < return_address_patch_count; i++) { | 11283 for (int i = 0; i < return_address_patch_count; i++) { |
| 11284 Vector<char> buf = Vector<char>::New(128); | 11284 Vector<char> buf = Vector<char>::New(128); |
| 11285 SNPrintF(buf, "%6d %6d %10d", i, ReturnAddressPc(i)->value(), | 11285 SNPrintF(buf, "%6d %6d %12d\n", i, ReturnAddressPc(i)->value(), |
| 11286 PatchedAddressPc(i)->value()); | 11286 PatchedAddressPc(i)->value()); |
| 11287 os << buf.start(); | 11287 os << buf.start(); |
| 11288 } | 11288 } |
| 11289 } | 11289 } |
| 11290 | 11290 |
| 11291 | 11291 |
| 11292 void DeoptimizationOutputData::DeoptimizationOutputDataPrint( | 11292 void DeoptimizationOutputData::DeoptimizationOutputDataPrint( |
| 11293 OStream& os) { // NOLINT | 11293 OStream& os) { // NOLINT |
| 11294 os << "Deoptimization Output Data (deopt points = " << this->DeoptPoints() | 11294 os << "Deoptimization Output Data (deopt points = " << this->DeoptPoints() |
| 11295 << ")\n"; | 11295 << ")\n"; |
| (...skipping 5594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 16890 #define ERROR_MESSAGES_TEXTS(C, T) T, | 16890 #define ERROR_MESSAGES_TEXTS(C, T) T, |
| 16891 static const char* error_messages_[] = { | 16891 static const char* error_messages_[] = { |
| 16892 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) | 16892 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) |
| 16893 }; | 16893 }; |
| 16894 #undef ERROR_MESSAGES_TEXTS | 16894 #undef ERROR_MESSAGES_TEXTS |
| 16895 return error_messages_[reason]; | 16895 return error_messages_[reason]; |
| 16896 } | 16896 } |
| 16897 | 16897 |
| 16898 | 16898 |
| 16899 } } // namespace v8::internal | 16899 } } // namespace v8::internal |
| OLD | NEW |