Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(45)

Side by Side Diff: src/objects.cc

Issue 1410023013: Objects printing improved a bit. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@fix-subclass
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/objects.h ('k') | src/objects-printer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/objects.h" 5 #include "src/objects.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 #include <iomanip> 8 #include <iomanip>
9 #include <sstream> 9 #include <sstream>
10 10
(...skipping 1927 matching lines...) Expand 10 before | Expand all | Expand 10 after
1938 Cell::cast(this)->value()->ShortPrint(&accumulator); 1938 Cell::cast(this)->value()->ShortPrint(&accumulator);
1939 os << accumulator.ToCString().get(); 1939 os << accumulator.ToCString().get();
1940 break; 1940 break;
1941 } 1941 }
1942 case PROPERTY_CELL_TYPE: { 1942 case PROPERTY_CELL_TYPE: {
1943 os << "PropertyCell for "; 1943 os << "PropertyCell for ";
1944 HeapStringAllocator allocator; 1944 HeapStringAllocator allocator;
1945 StringStream accumulator(&allocator); 1945 StringStream accumulator(&allocator);
1946 PropertyCell* cell = PropertyCell::cast(this); 1946 PropertyCell* cell = PropertyCell::cast(this);
1947 cell->value()->ShortPrint(&accumulator); 1947 cell->value()->ShortPrint(&accumulator);
1948 os << accumulator.ToCString().get() << " " << cell->property_details(); 1948 os << accumulator.ToCString().get();
1949 break; 1949 break;
1950 } 1950 }
1951 case WEAK_CELL_TYPE: { 1951 case WEAK_CELL_TYPE: {
1952 os << "WeakCell for "; 1952 os << "WeakCell for ";
1953 HeapStringAllocator allocator; 1953 HeapStringAllocator allocator;
1954 StringStream accumulator(&allocator); 1954 StringStream accumulator(&allocator);
1955 WeakCell::cast(this)->value()->ShortPrint(&accumulator); 1955 WeakCell::cast(this)->value()->ShortPrint(&accumulator);
1956 os << accumulator.ToCString().get(); 1956 os << accumulator.ToCString().get();
1957 break; 1957 break;
1958 } 1958 }
(...skipping 12720 matching lines...) Expand 10 before | Expand all | Expand 10 after
14679 // class. This requires us to have the template functions put 14679 // class. This requires us to have the template functions put
14680 // together, so even though this function belongs in objects-debug.cc, 14680 // together, so even though this function belongs in objects-debug.cc,
14681 // we keep it here instead to satisfy certain compilers. 14681 // we keep it here instead to satisfy certain compilers.
14682 #ifdef OBJECT_PRINT 14682 #ifdef OBJECT_PRINT
14683 template <typename Derived, typename Shape, typename Key> 14683 template <typename Derived, typename Shape, typename Key>
14684 void Dictionary<Derived, Shape, Key>::Print(std::ostream& os) { // NOLINT 14684 void Dictionary<Derived, Shape, Key>::Print(std::ostream& os) { // NOLINT
14685 int capacity = this->Capacity(); 14685 int capacity = this->Capacity();
14686 for (int i = 0; i < capacity; i++) { 14686 for (int i = 0; i < capacity; i++) {
14687 Object* k = this->KeyAt(i); 14687 Object* k = this->KeyAt(i);
14688 if (this->IsKey(k)) { 14688 if (this->IsKey(k)) {
14689 os << " "; 14689 os << "\n ";
14690 if (k->IsString()) { 14690 if (k->IsString()) {
14691 String::cast(k)->StringPrint(os); 14691 String::cast(k)->StringPrint(os);
14692 } else { 14692 } else {
14693 os << Brief(k); 14693 os << Brief(k);
14694 } 14694 }
14695 os << ": " << Brief(this->ValueAt(i)) << " " << this->DetailsAt(i) 14695 os << ": " << Brief(this->ValueAt(i)) << " " << this->DetailsAt(i);
14696 << "\n";
14697 } 14696 }
14698 } 14697 }
14699 } 14698 }
14700 #endif 14699 #endif
14701 14700
14702 14701
14703 template<typename Derived, typename Shape, typename Key> 14702 template<typename Derived, typename Shape, typename Key>
14704 void Dictionary<Derived, Shape, Key>::CopyValuesTo(FixedArray* elements) { 14703 void Dictionary<Derived, Shape, Key>::CopyValuesTo(FixedArray* elements) {
14705 int pos = 0; 14704 int pos = 0;
14706 int capacity = this->Capacity(); 14705 int capacity = this->Capacity();
(...skipping 3305 matching lines...) Expand 10 before | Expand all | Expand 10 after
18012 if (cell->value() != *new_value) { 18011 if (cell->value() != *new_value) {
18013 cell->set_value(*new_value); 18012 cell->set_value(*new_value);
18014 Isolate* isolate = cell->GetIsolate(); 18013 Isolate* isolate = cell->GetIsolate();
18015 cell->dependent_code()->DeoptimizeDependentCodeGroup( 18014 cell->dependent_code()->DeoptimizeDependentCodeGroup(
18016 isolate, DependentCode::kPropertyCellChangedGroup); 18015 isolate, DependentCode::kPropertyCellChangedGroup);
18017 } 18016 }
18018 } 18017 }
18019 18018
18020 } // namespace internal 18019 } // namespace internal
18021 } // namespace v8 18020 } // namespace v8
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/objects-printer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698