OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 944 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
955 } | 955 } |
956 | 956 |
957 | 957 |
958 void JSObject::JSObjectShortPrint(StringStream* accumulator) { | 958 void JSObject::JSObjectShortPrint(StringStream* accumulator) { |
959 switch (map()->instance_type()) { | 959 switch (map()->instance_type()) { |
960 case JS_ARRAY_TYPE: { | 960 case JS_ARRAY_TYPE: { |
961 double length = JSArray::cast(this)->length()->Number(); | 961 double length = JSArray::cast(this)->length()->Number(); |
962 accumulator->Add("<JS array[%u]>", static_cast<uint32_t>(length)); | 962 accumulator->Add("<JS array[%u]>", static_cast<uint32_t>(length)); |
963 break; | 963 break; |
964 } | 964 } |
| 965 case JS_WEAK_MAP_TYPE: { |
| 966 int elements = JSWeakMap::cast(this)->table()->NumberOfElements(); |
| 967 accumulator->Add("<JS WeakMap[%d]>", elements); |
| 968 break; |
| 969 } |
965 case JS_REGEXP_TYPE: { | 970 case JS_REGEXP_TYPE: { |
966 accumulator->Add("<JS RegExp>"); | 971 accumulator->Add("<JS RegExp>"); |
967 break; | 972 break; |
968 } | 973 } |
969 case JS_FUNCTION_TYPE: { | 974 case JS_FUNCTION_TYPE: { |
970 Object* fun_name = JSFunction::cast(this)->shared()->name(); | 975 Object* fun_name = JSFunction::cast(this)->shared()->name(); |
971 bool printed = false; | 976 bool printed = false; |
972 if (fun_name->IsString()) { | 977 if (fun_name->IsString()) { |
973 String* str = String::cast(fun_name); | 978 String* str = String::cast(fun_name); |
974 if (str->length() > 0) { | 979 if (str->length() > 0) { |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1185 switch (type) { | 1190 switch (type) { |
1186 case FIXED_ARRAY_TYPE: | 1191 case FIXED_ARRAY_TYPE: |
1187 FixedArray::BodyDescriptor::IterateBody(this, object_size, v); | 1192 FixedArray::BodyDescriptor::IterateBody(this, object_size, v); |
1188 break; | 1193 break; |
1189 case FIXED_DOUBLE_ARRAY_TYPE: | 1194 case FIXED_DOUBLE_ARRAY_TYPE: |
1190 break; | 1195 break; |
1191 case JS_OBJECT_TYPE: | 1196 case JS_OBJECT_TYPE: |
1192 case JS_CONTEXT_EXTENSION_OBJECT_TYPE: | 1197 case JS_CONTEXT_EXTENSION_OBJECT_TYPE: |
1193 case JS_VALUE_TYPE: | 1198 case JS_VALUE_TYPE: |
1194 case JS_ARRAY_TYPE: | 1199 case JS_ARRAY_TYPE: |
| 1200 case JS_WEAK_MAP_TYPE: |
1195 case JS_REGEXP_TYPE: | 1201 case JS_REGEXP_TYPE: |
1196 case JS_GLOBAL_PROXY_TYPE: | 1202 case JS_GLOBAL_PROXY_TYPE: |
1197 case JS_GLOBAL_OBJECT_TYPE: | 1203 case JS_GLOBAL_OBJECT_TYPE: |
1198 case JS_BUILTINS_OBJECT_TYPE: | 1204 case JS_BUILTINS_OBJECT_TYPE: |
1199 case JS_MESSAGE_OBJECT_TYPE: | 1205 case JS_MESSAGE_OBJECT_TYPE: |
1200 JSObject::BodyDescriptor::IterateBody(this, object_size, v); | 1206 JSObject::BodyDescriptor::IterateBody(this, object_size, v); |
1201 break; | 1207 break; |
1202 case JS_FUNCTION_TYPE: | 1208 case JS_FUNCTION_TYPE: |
1203 reinterpret_cast<JSFunction*>(this) | 1209 reinterpret_cast<JSFunction*>(this) |
1204 ->JSFunctionIterateBody(object_size, v); | 1210 ->JSFunctionIterateBody(object_size, v); |
(...skipping 10878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12083 if (break_point_objects()->IsUndefined()) return 0; | 12089 if (break_point_objects()->IsUndefined()) return 0; |
12084 // Single beak point. | 12090 // Single beak point. |
12085 if (!break_point_objects()->IsFixedArray()) return 1; | 12091 if (!break_point_objects()->IsFixedArray()) return 1; |
12086 // Multiple break points. | 12092 // Multiple break points. |
12087 return FixedArray::cast(break_point_objects())->length(); | 12093 return FixedArray::cast(break_point_objects())->length(); |
12088 } | 12094 } |
12089 #endif | 12095 #endif |
12090 | 12096 |
12091 | 12097 |
12092 } } // namespace v8::internal | 12098 } } // namespace v8::internal |
OLD | NEW |