Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(410)

Side by Side Diff: src/runtime.cc

Issue 108083005: ES6: Add Object.getOwnPropertySymbols (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Comment and formatting based on code review Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/property-details.h ('k') | src/symbol.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 5726 matching lines...) Expand 10 before | Expand all | Expand 10 after
5737 JSObject::cast(proto)->map()->is_hidden_prototype()) { 5737 JSObject::cast(proto)->map()->is_hidden_prototype()) {
5738 count++; 5738 count++;
5739 proto = JSObject::cast(proto)->GetPrototype(); 5739 proto = JSObject::cast(proto)->GetPrototype();
5740 } 5740 }
5741 return count; 5741 return count;
5742 } 5742 }
5743 5743
5744 5744
5745 // Return the names of the local named properties. 5745 // Return the names of the local named properties.
5746 // args[0]: object 5746 // args[0]: object
5747 // args[1]: int Will be casted to a PropertyAttributes.
5747 RUNTIME_FUNCTION(MaybeObject*, Runtime_GetLocalPropertyNames) { 5748 RUNTIME_FUNCTION(MaybeObject*, Runtime_GetLocalPropertyNames) {
5748 HandleScope scope(isolate); 5749 HandleScope scope(isolate);
5749 ASSERT(args.length() == 2); 5750 ASSERT(args.length() == 2);
5750 if (!args[0]->IsJSObject()) { 5751 if (!args[0]->IsJSObject()) {
5751 return isolate->heap()->undefined_value(); 5752 return isolate->heap()->undefined_value();
5752 } 5753 }
5753 CONVERT_ARG_HANDLE_CHECKED(JSObject, obj, 0); 5754 CONVERT_ARG_HANDLE_CHECKED(JSObject, obj, 0);
5754 CONVERT_BOOLEAN_ARG_CHECKED(include_symbols, 1); 5755 CONVERT_SMI_ARG_CHECKED(filter_value, 1);
5755 PropertyAttributes filter = include_symbols ? NONE : SYMBOLIC; 5756 PropertyAttributes filter = static_cast<PropertyAttributes>(filter_value);
5756 5757
5757 // 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
5758 // real global object. 5759 // real global object.
5759 if (obj->IsJSGlobalProxy()) { 5760 if (obj->IsJSGlobalProxy()) {
5760 // Only collect names if access is permitted. 5761 // Only collect names if access is permitted.
5761 if (obj->IsAccessCheckNeeded() && 5762 if (obj->IsAccessCheckNeeded() &&
5762 !isolate->MayNamedAccess(*obj, 5763 !isolate->MayNamedAccess(*obj,
5763 isolate->heap()->undefined_value(), 5764 isolate->heap()->undefined_value(),
5764 v8::ACCESS_KEYS)) { 5765 v8::ACCESS_KEYS)) {
5765 isolate->ReportFailedAccessCheck(*obj, v8::ACCESS_KEYS); 5766 isolate->ReportFailedAccessCheck(*obj, v8::ACCESS_KEYS);
(...skipping 9125 matching lines...) Expand 10 before | Expand all | Expand 10 after
14891 // Handle last resort GC and make sure to allow future allocations 14892 // Handle last resort GC and make sure to allow future allocations
14892 // to grow the heap without causing GCs (if possible). 14893 // to grow the heap without causing GCs (if possible).
14893 isolate->counters()->gc_last_resort_from_js()->Increment(); 14894 isolate->counters()->gc_last_resort_from_js()->Increment();
14894 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, 14895 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags,
14895 "Runtime::PerformGC"); 14896 "Runtime::PerformGC");
14896 } 14897 }
14897 } 14898 }
14898 14899
14899 14900
14900 } } // namespace v8::internal 14901 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/property-details.h ('k') | src/symbol.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698