OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/objects.h" | 5 #include "src/objects.h" |
6 | 6 |
7 #include <iomanip> | 7 #include <iomanip> |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 } else { | 410 } else { |
411 os << previous_value; | 411 os << previous_value; |
412 } | 412 } |
413 previous_index = i; | 413 previous_index = i; |
414 previous_value = value; | 414 previous_value = value; |
415 } | 415 } |
416 } | 416 } |
417 | 417 |
418 void PrintFixedArrayElements(std::ostream& os, FixedArray* array) { | 418 void PrintFixedArrayElements(std::ostream& os, FixedArray* array) { |
419 // Print in array notation for non-sparse arrays. | 419 // Print in array notation for non-sparse arrays. |
420 Object* previous_value = array->get(0); | 420 Object* previous_value = array->length() > 0 ? array->get(0) : nullptr; |
421 Object* value = nullptr; | 421 Object* value = nullptr; |
422 int previous_index = 0; | 422 int previous_index = 0; |
423 int i; | 423 int i; |
424 for (i = 1; i <= array->length(); i++) { | 424 for (i = 1; i <= array->length(); i++) { |
425 if (i < array->length()) value = array->get(i); | 425 if (i < array->length()) value = array->get(i); |
426 if (previous_value == value && i != array->length()) { | 426 if (previous_value == value && i != array->length()) { |
427 continue; | 427 continue; |
428 } | 428 } |
429 os << "\n"; | 429 os << "\n"; |
430 std::stringstream ss; | 430 std::stringstream ss; |
(...skipping 1293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1724 printf("Not a transition array\n"); | 1724 printf("Not a transition array\n"); |
1725 } else { | 1725 } else { |
1726 reinterpret_cast<i::TransitionArray*>(object)->Print(); | 1726 reinterpret_cast<i::TransitionArray*>(object)->Print(); |
1727 } | 1727 } |
1728 } | 1728 } |
1729 | 1729 |
1730 extern void _v8_internal_Print_StackTrace() { | 1730 extern void _v8_internal_Print_StackTrace() { |
1731 i::Isolate* isolate = i::Isolate::Current(); | 1731 i::Isolate* isolate = i::Isolate::Current(); |
1732 isolate->PrintStack(stdout); | 1732 isolate->PrintStack(stdout); |
1733 } | 1733 } |
OLD | NEW |