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

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

Issue 151019: Changed the global object representation (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 break; 145 break;
146 case CODE_TYPE: 146 case CODE_TYPE:
147 Code::cast(this)->CodePrint(); 147 Code::cast(this)->CodePrint();
148 break; 148 break;
149 case PROXY_TYPE: 149 case PROXY_TYPE:
150 Proxy::cast(this)->ProxyPrint(); 150 Proxy::cast(this)->ProxyPrint();
151 break; 151 break;
152 case SHARED_FUNCTION_INFO_TYPE: 152 case SHARED_FUNCTION_INFO_TYPE:
153 SharedFunctionInfo::cast(this)->SharedFunctionInfoPrint(); 153 SharedFunctionInfo::cast(this)->SharedFunctionInfoPrint();
154 break; 154 break;
155 155 case JS_GLOBAL_PROPERTY_CELL_TYPE:
156 JSGlobalPropertyCell::cast(this)->JSGlobalPropertyCellPrint();
157 break;
156 #define MAKE_STRUCT_CASE(NAME, Name, name) \ 158 #define MAKE_STRUCT_CASE(NAME, Name, name) \
157 case NAME##_TYPE: \ 159 case NAME##_TYPE: \
158 Name::cast(this)->Name##Print(); \ 160 Name::cast(this)->Name##Print(); \
159 break; 161 break;
160 STRUCT_LIST(MAKE_STRUCT_CASE) 162 STRUCT_LIST(MAKE_STRUCT_CASE)
161 #undef MAKE_STRUCT_CASE 163 #undef MAKE_STRUCT_CASE
162 164
163 default: 165 default:
164 PrintF("UNKNOWN TYPE %d", map()->instance_type()); 166 PrintF("UNKNOWN TYPE %d", map()->instance_type());
165 UNREACHABLE(); 167 UNREACHABLE();
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 break; 209 break;
208 case JS_GLOBAL_PROXY_TYPE: 210 case JS_GLOBAL_PROXY_TYPE:
209 JSGlobalProxy::cast(this)->JSGlobalProxyVerify(); 211 JSGlobalProxy::cast(this)->JSGlobalProxyVerify();
210 break; 212 break;
211 case JS_GLOBAL_OBJECT_TYPE: 213 case JS_GLOBAL_OBJECT_TYPE:
212 JSGlobalObject::cast(this)->JSGlobalObjectVerify(); 214 JSGlobalObject::cast(this)->JSGlobalObjectVerify();
213 break; 215 break;
214 case JS_BUILTINS_OBJECT_TYPE: 216 case JS_BUILTINS_OBJECT_TYPE:
215 JSBuiltinsObject::cast(this)->JSBuiltinsObjectVerify(); 217 JSBuiltinsObject::cast(this)->JSBuiltinsObjectVerify();
216 break; 218 break;
219 case JS_GLOBAL_PROPERTY_CELL_TYPE:
220 JSGlobalPropertyCell::cast(this)->JSGlobalPropertyCellVerify();
221 break;
217 case JS_ARRAY_TYPE: 222 case JS_ARRAY_TYPE:
218 JSArray::cast(this)->JSArrayVerify(); 223 JSArray::cast(this)->JSArrayVerify();
219 break; 224 break;
220 case JS_REGEXP_TYPE: 225 case JS_REGEXP_TYPE:
221 JSRegExp::cast(this)->JSRegExpVerify(); 226 JSRegExp::cast(this)->JSRegExpVerify();
222 break; 227 break;
223 case FILLER_TYPE: 228 case FILLER_TYPE:
224 break; 229 break;
225 case PROXY_TYPE: 230 case PROXY_TYPE:
226 Proxy::cast(this)->ProxyVerify(); 231 Proxy::cast(this)->ProxyVerify();
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 case LONG_EXTERNAL_ASCII_STRING_TYPE: 390 case LONG_EXTERNAL_ASCII_STRING_TYPE:
386 case SHORT_EXTERNAL_STRING_TYPE: 391 case SHORT_EXTERNAL_STRING_TYPE:
387 case MEDIUM_EXTERNAL_STRING_TYPE: 392 case MEDIUM_EXTERNAL_STRING_TYPE:
388 case LONG_EXTERNAL_STRING_TYPE: return "EXTERNAL_STRING"; 393 case LONG_EXTERNAL_STRING_TYPE: return "EXTERNAL_STRING";
389 case FIXED_ARRAY_TYPE: return "FIXED_ARRAY"; 394 case FIXED_ARRAY_TYPE: return "FIXED_ARRAY";
390 case BYTE_ARRAY_TYPE: return "BYTE_ARRAY"; 395 case BYTE_ARRAY_TYPE: return "BYTE_ARRAY";
391 case FILLER_TYPE: return "FILLER"; 396 case FILLER_TYPE: return "FILLER";
392 case JS_OBJECT_TYPE: return "JS_OBJECT"; 397 case JS_OBJECT_TYPE: return "JS_OBJECT";
393 case JS_CONTEXT_EXTENSION_OBJECT_TYPE: return "JS_CONTEXT_EXTENSION_OBJECT"; 398 case JS_CONTEXT_EXTENSION_OBJECT_TYPE: return "JS_CONTEXT_EXTENSION_OBJECT";
394 case ODDBALL_TYPE: return "ODDBALL"; 399 case ODDBALL_TYPE: return "ODDBALL";
400 case JS_GLOBAL_PROPERTY_CELL_TYPE: return "JS_GLOBAL_PROPERTY_CELL";
395 case SHARED_FUNCTION_INFO_TYPE: return "SHARED_FUNCTION_INFO"; 401 case SHARED_FUNCTION_INFO_TYPE: return "SHARED_FUNCTION_INFO";
396 case JS_FUNCTION_TYPE: return "JS_FUNCTION"; 402 case JS_FUNCTION_TYPE: return "JS_FUNCTION";
397 case CODE_TYPE: return "CODE"; 403 case CODE_TYPE: return "CODE";
398 case JS_ARRAY_TYPE: return "JS_ARRAY"; 404 case JS_ARRAY_TYPE: return "JS_ARRAY";
399 case JS_REGEXP_TYPE: return "JS_REGEXP"; 405 case JS_REGEXP_TYPE: return "JS_REGEXP";
400 case JS_VALUE_TYPE: return "JS_VALUE"; 406 case JS_VALUE_TYPE: return "JS_VALUE";
401 case JS_GLOBAL_OBJECT_TYPE: return "JS_GLOBAL_OBJECT"; 407 case JS_GLOBAL_OBJECT_TYPE: return "JS_GLOBAL_OBJECT";
402 case JS_BUILTINS_OBJECT_TYPE: return "JS_BUILTINS_OBJECT"; 408 case JS_BUILTINS_OBJECT_TYPE: return "JS_BUILTINS_OBJECT";
403 case JS_GLOBAL_PROXY_TYPE: return "JS_GLOBAL_PROXY"; 409 case JS_GLOBAL_PROXY_TYPE: return "JS_GLOBAL_PROXY";
404 case PROXY_TYPE: return "PROXY"; 410 case PROXY_TYPE: return "PROXY";
(...skipping 16 matching lines...) Expand all
421 } 427 }
422 if (has_named_interceptor()) { 428 if (has_named_interceptor()) {
423 PrintF(" - named_interceptor\n"); 429 PrintF(" - named_interceptor\n");
424 } 430 }
425 if (has_indexed_interceptor()) { 431 if (has_indexed_interceptor()) {
426 PrintF(" - indexed_interceptor\n"); 432 PrintF(" - indexed_interceptor\n");
427 } 433 }
428 if (is_undetectable()) { 434 if (is_undetectable()) {
429 PrintF(" - undetectable\n"); 435 PrintF(" - undetectable\n");
430 } 436 }
437 if (needs_loading()) {
438 PrintF(" - needs_loading\n");
439 }
431 if (has_instance_call_handler()) { 440 if (has_instance_call_handler()) {
432 PrintF(" - instance_call_handler\n"); 441 PrintF(" - instance_call_handler\n");
433 } 442 }
434 if (is_access_check_needed()) { 443 if (is_access_check_needed()) {
435 PrintF(" - access_check_needed\n"); 444 PrintF(" - access_check_needed\n");
436 } 445 }
437 PrintF(" - instance descriptors: "); 446 PrintF(" - instance descriptors: ");
438 instance_descriptors()->ShortPrint(); 447 instance_descriptors()->ShortPrint();
439 PrintF("\n - prototype: "); 448 PrintF("\n - prototype: ");
440 prototype()->ShortPrint(); 449 prototype()->ShortPrint();
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
646 if (number->IsHeapObject()) { 655 if (number->IsHeapObject()) {
647 ASSERT(number == Heap::nan_value()); 656 ASSERT(number == Heap::nan_value());
648 } else { 657 } else {
649 ASSERT(number->IsSmi()); 658 ASSERT(number->IsSmi());
650 int value = Smi::cast(number)->value(); 659 int value = Smi::cast(number)->value();
651 ASSERT(value == 0 || value == 1 || value == -1); 660 ASSERT(value == 0 || value == 1 || value == -1);
652 } 661 }
653 } 662 }
654 663
655 664
665 void JSGlobalPropertyCell::JSGlobalPropertyCellVerify() {
666 CHECK(IsJSGlobalPropertyCell());
667 VerifyObjectField(kValueOffset);
668 }
669
670
671 void JSGlobalPropertyCell::JSGlobalPropertyCellPrint() {
672 HeapObject::PrintHeader("JSGlobalPropertyCell");
673 }
674
675
656 void Code::CodePrint() { 676 void Code::CodePrint() {
657 HeapObject::PrintHeader("Code"); 677 HeapObject::PrintHeader("Code");
658 #ifdef ENABLE_DISASSEMBLER 678 #ifdef ENABLE_DISASSEMBLER
659 Disassemble(NULL); 679 Disassemble(NULL);
660 #endif 680 #endif
661 } 681 }
662 682
663 683
664 void Code::CodeVerify() { 684 void Code::CodeVerify() {
665 CHECK(ic_flag() == IC_TARGET_IS_ADDRESS); 685 CHECK(ic_flag() == IC_TARGET_IS_ADDRESS);
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
1089 } 1109 }
1090 current = hash; 1110 current = hash;
1091 } 1111 }
1092 return true; 1112 return true;
1093 } 1113 }
1094 1114
1095 1115
1096 #endif // DEBUG 1116 #endif // DEBUG
1097 1117
1098 } } // namespace v8::internal 1118 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | src/objects-inl.h » ('j') | test/cctest/test-api.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698