| 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 1171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1182 JSFunction* constructor = JSFunction::cast(map()->constructor()); | 1182 JSFunction* constructor = JSFunction::cast(map()->constructor()); |
| 1183 return String::cast(constructor->shared()->instance_class_name()); | 1183 return String::cast(constructor->shared()->instance_class_name()); |
| 1184 } | 1184 } |
| 1185 // If the constructor is not present, return "Object". | 1185 // If the constructor is not present, return "Object". |
| 1186 return Heap::Object_symbol(); | 1186 return Heap::Object_symbol(); |
| 1187 } | 1187 } |
| 1188 | 1188 |
| 1189 | 1189 |
| 1190 String* JSObject::constructor_name() { | 1190 String* JSObject::constructor_name() { |
| 1191 if (IsJSFunction()) { | 1191 if (IsJSFunction()) { |
| 1192 return JSFunction::cast(this)->IsBoilerplate() ? | 1192 return Heap::closure_symbol(); |
| 1193 Heap::function_class_symbol() : Heap::closure_symbol(); | |
| 1194 } | 1193 } |
| 1195 if (map()->constructor()->IsJSFunction()) { | 1194 if (map()->constructor()->IsJSFunction()) { |
| 1196 JSFunction* constructor = JSFunction::cast(map()->constructor()); | 1195 JSFunction* constructor = JSFunction::cast(map()->constructor()); |
| 1197 String* name = String::cast(constructor->shared()->name()); | 1196 String* name = String::cast(constructor->shared()->name()); |
| 1198 return name->length() > 0 ? name : constructor->shared()->inferred_name(); | 1197 return name->length() > 0 ? name : constructor->shared()->inferred_name(); |
| 1199 } | 1198 } |
| 1200 // If the constructor is not present, return "Object". | 1199 // If the constructor is not present, return "Object". |
| 1201 return Heap::Object_symbol(); | 1200 return Heap::Object_symbol(); |
| 1202 } | 1201 } |
| 1203 | 1202 |
| (...skipping 1308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2512 if (key != Heap::undefined_value()) { | 2511 if (key != Heap::undefined_value()) { |
| 2513 return true; | 2512 return true; |
| 2514 } | 2513 } |
| 2515 break; | 2514 break; |
| 2516 } | 2515 } |
| 2517 default: | 2516 default: |
| 2518 UNREACHABLE(); | 2517 UNREACHABLE(); |
| 2519 break; | 2518 break; |
| 2520 } | 2519 } |
| 2521 | 2520 |
| 2522 // For functions check the context. Boilerplate functions do | 2521 // For functions check the context. |
| 2523 // not have to be traversed since they have no real context. | 2522 if (IsJSFunction()) { |
| 2524 if (IsJSFunction() && !JSFunction::cast(this)->IsBoilerplate()) { | |
| 2525 // Get the constructor function for arguments array. | 2523 // Get the constructor function for arguments array. |
| 2526 JSObject* arguments_boilerplate = | 2524 JSObject* arguments_boilerplate = |
| 2527 Top::context()->global_context()->arguments_boilerplate(); | 2525 Top::context()->global_context()->arguments_boilerplate(); |
| 2528 JSFunction* arguments_function = | 2526 JSFunction* arguments_function = |
| 2529 JSFunction::cast(arguments_boilerplate->map()->constructor()); | 2527 JSFunction::cast(arguments_boilerplate->map()->constructor()); |
| 2530 | 2528 |
| 2531 // Get the context and don't check if it is the global context. | 2529 // Get the context and don't check if it is the global context. |
| 2532 JSFunction* f = JSFunction::cast(this); | 2530 JSFunction* f = JSFunction::cast(this); |
| 2533 Context* context = f->context(); | 2531 Context* context = f->context(); |
| 2534 if (context->IsGlobalContext()) { | 2532 if (context->IsGlobalContext()) { |
| (...skipping 6003 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8538 if (break_point_objects()->IsUndefined()) return 0; | 8536 if (break_point_objects()->IsUndefined()) return 0; |
| 8539 // Single beak point. | 8537 // Single beak point. |
| 8540 if (!break_point_objects()->IsFixedArray()) return 1; | 8538 if (!break_point_objects()->IsFixedArray()) return 1; |
| 8541 // Multiple break points. | 8539 // Multiple break points. |
| 8542 return FixedArray::cast(break_point_objects())->length(); | 8540 return FixedArray::cast(break_point_objects())->length(); |
| 8543 } | 8541 } |
| 8544 #endif | 8542 #endif |
| 8545 | 8543 |
| 8546 | 8544 |
| 8547 } } // namespace v8::internal | 8545 } } // namespace v8::internal |
| OLD | NEW |