| OLD | NEW |
| 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 4658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4669 // Return the names of the local named properties. | 4669 // Return the names of the local named properties. |
| 4670 // args[0]: object | 4670 // args[0]: object |
| 4671 static Object* Runtime_DebugLocalPropertyNames(Arguments args) { | 4671 static Object* Runtime_DebugLocalPropertyNames(Arguments args) { |
| 4672 HandleScope scope; | 4672 HandleScope scope; |
| 4673 ASSERT(args.length() == 1); | 4673 ASSERT(args.length() == 1); |
| 4674 if (!args[0]->IsJSObject()) { | 4674 if (!args[0]->IsJSObject()) { |
| 4675 return Heap::undefined_value(); | 4675 return Heap::undefined_value(); |
| 4676 } | 4676 } |
| 4677 CONVERT_ARG_CHECKED(JSObject, obj, 0); | 4677 CONVERT_ARG_CHECKED(JSObject, obj, 0); |
| 4678 | 4678 |
| 4679 if (obj->IsJSGlobalProxy()) { |
| 4680 obj = Handle<JSObject>(JSObject::cast(obj->GetPrototype())); |
| 4681 } |
| 4679 int n = obj->NumberOfLocalProperties(static_cast<PropertyAttributes>(NONE)); | 4682 int n = obj->NumberOfLocalProperties(static_cast<PropertyAttributes>(NONE)); |
| 4680 Handle<FixedArray> names = Factory::NewFixedArray(n); | 4683 Handle<FixedArray> names = Factory::NewFixedArray(n); |
| 4681 obj->GetLocalPropertyNames(*names); | 4684 obj->GetLocalPropertyNames(*names); |
| 4682 return *Factory::NewJSArrayWithElements(names); | 4685 return *Factory::NewJSArrayWithElements(names); |
| 4683 } | 4686 } |
| 4684 | 4687 |
| 4685 | 4688 |
| 4686 // Return the names of the local indexed properties. | 4689 // Return the names of the local indexed properties. |
| 4687 // args[0]: object | 4690 // args[0]: object |
| 4688 static Object* Runtime_DebugLocalElementNames(Arguments args) { | 4691 static Object* Runtime_DebugLocalElementNames(Arguments args) { |
| (...skipping 1289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5978 } else { | 5981 } else { |
| 5979 // Handle last resort GC and make sure to allow future allocations | 5982 // Handle last resort GC and make sure to allow future allocations |
| 5980 // to grow the heap without causing GCs (if possible). | 5983 // to grow the heap without causing GCs (if possible). |
| 5981 Counters::gc_last_resort_from_js.Increment(); | 5984 Counters::gc_last_resort_from_js.Increment(); |
| 5982 Heap::CollectAllGarbage(); | 5985 Heap::CollectAllGarbage(); |
| 5983 } | 5986 } |
| 5984 } | 5987 } |
| 5985 | 5988 |
| 5986 | 5989 |
| 5987 } } // namespace v8::internal | 5990 } } // namespace v8::internal |
| OLD | NEW |