OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 5725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5736 JSObject::cast(proto)->map()->is_hidden_prototype()) { | 5736 JSObject::cast(proto)->map()->is_hidden_prototype()) { |
5737 count++; | 5737 count++; |
5738 proto = JSObject::cast(proto)->GetPrototype(); | 5738 proto = JSObject::cast(proto)->GetPrototype(); |
5739 } | 5739 } |
5740 return count; | 5740 return count; |
5741 } | 5741 } |
5742 | 5742 |
5743 | 5743 |
5744 // Return the names of the local named properties. | 5744 // Return the names of the local named properties. |
5745 // args[0]: object | 5745 // args[0]: object |
| 5746 // args[1]: int |
5746 RUNTIME_FUNCTION(MaybeObject*, Runtime_GetLocalPropertyNames) { | 5747 RUNTIME_FUNCTION(MaybeObject*, Runtime_GetLocalPropertyNames) { |
5747 HandleScope scope(isolate); | 5748 HandleScope scope(isolate); |
5748 ASSERT(args.length() == 2); | 5749 ASSERT(args.length() == 2); |
5749 if (!args[0]->IsJSObject()) { | 5750 if (!args[0]->IsJSObject()) { |
5750 return isolate->heap()->undefined_value(); | 5751 return isolate->heap()->undefined_value(); |
5751 } | 5752 } |
5752 CONVERT_ARG_HANDLE_CHECKED(JSObject, obj, 0); | 5753 CONVERT_ARG_HANDLE_CHECKED(JSObject, obj, 0); |
5753 CONVERT_BOOLEAN_ARG_CHECKED(include_symbols, 1); | 5754 CONVERT_SMI_ARG_CHECKED(filter_value, 1); |
5754 PropertyAttributes filter = include_symbols ? NONE : SYMBOLIC; | 5755 ASSERT(filter_value >= NONE && filter_value < ABSENT); |
| 5756 PropertyAttributes filter = static_cast<PropertyAttributes>(filter_value); |
5755 | 5757 |
5756 // Skip the global proxy as it has no properties and always delegates to the | 5758 // Skip the global proxy as it has no properties and always delegates to the |
5757 // real global object. | 5759 // real global object. |
5758 if (obj->IsJSGlobalProxy()) { | 5760 if (obj->IsJSGlobalProxy()) { |
5759 // Only collect names if access is permitted. | 5761 // Only collect names if access is permitted. |
5760 if (obj->IsAccessCheckNeeded() && | 5762 if (obj->IsAccessCheckNeeded() && |
5761 !isolate->MayNamedAccess(*obj, | 5763 !isolate->MayNamedAccess(*obj, |
5762 isolate->heap()->undefined_value(), | 5764 isolate->heap()->undefined_value(), |
5763 v8::ACCESS_KEYS)) { | 5765 v8::ACCESS_KEYS)) { |
5764 isolate->ReportFailedAccessCheck(*obj, v8::ACCESS_KEYS); | 5766 isolate->ReportFailedAccessCheck(*obj, v8::ACCESS_KEYS); |
(...skipping 9128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
14893 // Handle last resort GC and make sure to allow future allocations | 14895 // Handle last resort GC and make sure to allow future allocations |
14894 // to grow the heap without causing GCs (if possible). | 14896 // to grow the heap without causing GCs (if possible). |
14895 isolate->counters()->gc_last_resort_from_js()->Increment(); | 14897 isolate->counters()->gc_last_resort_from_js()->Increment(); |
14896 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 14898 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
14897 "Runtime::PerformGC"); | 14899 "Runtime::PerformGC"); |
14898 } | 14900 } |
14899 } | 14901 } |
14900 | 14902 |
14901 | 14903 |
14902 } } // namespace v8::internal | 14904 } } // namespace v8::internal |
OLD | NEW |