OLD | NEW |
---|---|
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 1233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1244 JSFunction* constructor = JSFunction::cast(map()->constructor()); | 1244 JSFunction* constructor = JSFunction::cast(map()->constructor()); |
1245 return String::cast(constructor->shared()->instance_class_name()); | 1245 return String::cast(constructor->shared()->instance_class_name()); |
1246 } | 1246 } |
1247 // If the constructor is not present, return "Object". | 1247 // If the constructor is not present, return "Object". |
1248 return Heap::Object_symbol(); | 1248 return Heap::Object_symbol(); |
1249 } | 1249 } |
1250 | 1250 |
1251 | 1251 |
1252 String* JSObject::constructor_name() { | 1252 String* JSObject::constructor_name() { |
1253 if (IsJSFunction()) { | 1253 if (IsJSFunction()) { |
1254 return Heap::function_class_symbol(); | 1254 return JSFunction::cast(this)->IsBoilerplate() ? |
1255 Heap::function_class_symbol() : Heap::closure_symbol(); | |
Søren Thygesen Gjesse
2009/10/26 08:13:09
Where will this show up? All actual JsvaScript fun
mnaganov (inactive)
2009/10/26 09:54:14
'constructor_name' is only used in heap profiler.
| |
1255 } | 1256 } |
1256 if (map()->constructor()->IsJSFunction()) { | 1257 if (map()->constructor()->IsJSFunction()) { |
1257 JSFunction* constructor = JSFunction::cast(map()->constructor()); | 1258 JSFunction* constructor = JSFunction::cast(map()->constructor()); |
1258 String* name = String::cast(constructor->shared()->name()); | 1259 String* name = String::cast(constructor->shared()->name()); |
1259 return name->length() > 0 ? name : constructor->shared()->inferred_name(); | 1260 return name->length() > 0 ? name : constructor->shared()->inferred_name(); |
1260 } | 1261 } |
1261 // If the constructor is not present, return "Object". | 1262 // If the constructor is not present, return "Object". |
1262 return Heap::Object_symbol(); | 1263 return Heap::Object_symbol(); |
1263 } | 1264 } |
1264 | 1265 |
(...skipping 7041 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
8306 if (break_point_objects()->IsUndefined()) return 0; | 8307 if (break_point_objects()->IsUndefined()) return 0; |
8307 // Single beak point. | 8308 // Single beak point. |
8308 if (!break_point_objects()->IsFixedArray()) return 1; | 8309 if (!break_point_objects()->IsFixedArray()) return 1; |
8309 // Multiple break points. | 8310 // Multiple break points. |
8310 return FixedArray::cast(break_point_objects())->length(); | 8311 return FixedArray::cast(break_point_objects())->length(); |
8311 } | 8312 } |
8312 #endif | 8313 #endif |
8313 | 8314 |
8314 | 8315 |
8315 } } // namespace v8::internal | 8316 } } // namespace v8::internal |
OLD | NEW |