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

Side by Side Diff: src/objects-printer.cc

Issue 1230753004: [Interpreter] Add BytecodeArray class and add to SharedFunctionInfo. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix pedantic build (take2). Created 5 years, 5 months 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-inl.h ('k') | src/types.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 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/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/disasm.h" 7 #include "src/disasm.h"
8 #include "src/disassembler.h" 8 #include "src/disassembler.h"
9 #include "src/heap/objects-visiting.h" 9 #include "src/heap/objects-visiting.h"
10 #include "src/interpreter/bytecodes.h"
10 #include "src/jsregexp.h" 11 #include "src/jsregexp.h"
11 #include "src/ostreams.h" 12 #include "src/ostreams.h"
12 13
13 namespace v8 { 14 namespace v8 {
14 namespace internal { 15 namespace internal {
15 16
16 #ifdef OBJECT_PRINT 17 #ifdef OBJECT_PRINT
17 18
18 void Object::Print() { 19 void Object::Print() {
19 OFStream os(stdout); 20 OFStream os(stdout);
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 break; 66 break;
66 case FIXED_DOUBLE_ARRAY_TYPE: 67 case FIXED_DOUBLE_ARRAY_TYPE:
67 FixedDoubleArray::cast(this)->FixedDoubleArrayPrint(os); 68 FixedDoubleArray::cast(this)->FixedDoubleArrayPrint(os);
68 break; 69 break;
69 case FIXED_ARRAY_TYPE: 70 case FIXED_ARRAY_TYPE:
70 FixedArray::cast(this)->FixedArrayPrint(os); 71 FixedArray::cast(this)->FixedArrayPrint(os);
71 break; 72 break;
72 case BYTE_ARRAY_TYPE: 73 case BYTE_ARRAY_TYPE:
73 ByteArray::cast(this)->ByteArrayPrint(os); 74 ByteArray::cast(this)->ByteArrayPrint(os);
74 break; 75 break;
76 case BYTECODE_ARRAY_TYPE:
77 BytecodeArray::cast(this)->BytecodeArrayPrint(os);
78 break;
75 case FREE_SPACE_TYPE: 79 case FREE_SPACE_TYPE:
76 FreeSpace::cast(this)->FreeSpacePrint(os); 80 FreeSpace::cast(this)->FreeSpacePrint(os);
77 break; 81 break;
78 82
79 #define PRINT_EXTERNAL_ARRAY(Type, type, TYPE, ctype, size) \ 83 #define PRINT_EXTERNAL_ARRAY(Type, type, TYPE, ctype, size) \
80 case EXTERNAL_##TYPE##_ARRAY_TYPE: \ 84 case EXTERNAL_##TYPE##_ARRAY_TYPE: \
81 External##Type##Array::cast(this)->External##Type##ArrayPrint(os); \ 85 External##Type##Array::cast(this)->External##Type##ArrayPrint(os); \
82 break; 86 break;
83 87
84 TYPED_ARRAYS(PRINT_EXTERNAL_ARRAY) 88 TYPED_ARRAYS(PRINT_EXTERNAL_ARRAY)
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 break; 198 break;
195 } 199 }
196 } 200 }
197 201
198 202
199 void ByteArray::ByteArrayPrint(std::ostream& os) { // NOLINT 203 void ByteArray::ByteArrayPrint(std::ostream& os) { // NOLINT
200 os << "byte array, data starts at " << GetDataStartAddress(); 204 os << "byte array, data starts at " << GetDataStartAddress();
201 } 205 }
202 206
203 207
208 void BytecodeArray::BytecodeArrayPrint(std::ostream& os) { // NOLINT
209 Disassemble(os);
210 }
211
212
204 void FreeSpace::FreeSpacePrint(std::ostream& os) { // NOLINT 213 void FreeSpace::FreeSpacePrint(std::ostream& os) { // NOLINT
205 os << "free space, size " << Size(); 214 os << "free space, size " << Size();
206 } 215 }
207 216
208 217
209 #define EXTERNAL_ARRAY_PRINTER(Type, type, TYPE, ctype, size) \ 218 #define EXTERNAL_ARRAY_PRINTER(Type, type, TYPE, ctype, size) \
210 void External##Type##Array::External##Type##ArrayPrint(std::ostream& os) { \ 219 void External##Type##Array::External##Type##ArrayPrint(std::ostream& os) { \
211 os << "external " #type " array"; \ 220 os << "external " #type " array"; \
212 } 221 }
213 222
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after
810 // script()->Print(os); 819 // script()->Print(os);
811 os << "\n - function token position = " << function_token_position(); 820 os << "\n - function token position = " << function_token_position();
812 os << "\n - start position = " << start_position(); 821 os << "\n - start position = " << start_position();
813 os << "\n - end position = " << end_position(); 822 os << "\n - end position = " << end_position();
814 os << "\n - is expression = " << is_expression(); 823 os << "\n - is expression = " << is_expression();
815 os << "\n - debug info = " << Brief(debug_info()); 824 os << "\n - debug info = " << Brief(debug_info());
816 os << "\n - length = " << length(); 825 os << "\n - length = " << length();
817 os << "\n - optimized_code_map = " << Brief(optimized_code_map()); 826 os << "\n - optimized_code_map = " << Brief(optimized_code_map());
818 os << "\n - feedback_vector = "; 827 os << "\n - feedback_vector = ";
819 feedback_vector()->TypeFeedbackVectorPrint(os); 828 feedback_vector()->TypeFeedbackVectorPrint(os);
829 if (HasBytecodeArray()) {
830 os << "\n - bytecode_array = " << bytecode_array();
831 }
820 os << "\n"; 832 os << "\n";
821 } 833 }
822 834
823 835
824 void JSGlobalProxy::JSGlobalProxyPrint(std::ostream& os) { // NOLINT 836 void JSGlobalProxy::JSGlobalProxyPrint(std::ostream& os) { // NOLINT
825 os << "global_proxy "; 837 os << "global_proxy ";
826 JSObjectPrint(os); 838 JSObjectPrint(os);
827 os << "native context : " << Brief(native_context()); 839 os << "native context : " << Brief(native_context());
828 os << "\n"; 840 os << "\n";
829 } 841 }
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
1223 } 1235 }
1224 } 1236 }
1225 1237
1226 1238
1227 void JSObject::PrintTransitions(std::ostream& os) { // NOLINT 1239 void JSObject::PrintTransitions(std::ostream& os) { // NOLINT
1228 TransitionArray::PrintTransitions(os, map()->raw_transitions()); 1240 TransitionArray::PrintTransitions(os, map()->raw_transitions());
1229 } 1241 }
1230 #endif // defined(DEBUG) || defined(OBJECT_PRINT) 1242 #endif // defined(DEBUG) || defined(OBJECT_PRINT)
1231 } // namespace internal 1243 } // namespace internal
1232 } // namespace v8 1244 } // namespace v8
OLDNEW
« no previous file with comments | « src/objects-inl.h ('k') | src/types.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698