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

Side by Side Diff: src/runtime.cc

Issue 24200005: Hanldify JSObject::PreventExtensions method. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 3 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/objects.cc ('k') | no next file » | 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 1807 matching lines...) Expand 10 before | Expand all | Expand 10 after
1818 RUNTIME_FUNCTION(MaybeObject*, Runtime_GetOwnProperty) { 1818 RUNTIME_FUNCTION(MaybeObject*, Runtime_GetOwnProperty) {
1819 HandleScope scope(isolate); 1819 HandleScope scope(isolate);
1820 ASSERT(args.length() == 2); 1820 ASSERT(args.length() == 2);
1821 CONVERT_ARG_HANDLE_CHECKED(JSObject, obj, 0); 1821 CONVERT_ARG_HANDLE_CHECKED(JSObject, obj, 0);
1822 CONVERT_ARG_HANDLE_CHECKED(Name, name, 1); 1822 CONVERT_ARG_HANDLE_CHECKED(Name, name, 1);
1823 return GetOwnProperty(isolate, obj, name); 1823 return GetOwnProperty(isolate, obj, name);
1824 } 1824 }
1825 1825
1826 1826
1827 RUNTIME_FUNCTION(MaybeObject*, Runtime_PreventExtensions) { 1827 RUNTIME_FUNCTION(MaybeObject*, Runtime_PreventExtensions) {
1828 SealHandleScope shs(isolate); 1828 HandleScope scope(isolate);
1829 ASSERT(args.length() == 1); 1829 ASSERT(args.length() == 1);
1830 CONVERT_ARG_CHECKED(JSObject, obj, 0); 1830 CONVERT_ARG_HANDLE_CHECKED(JSObject, obj, 0);
1831 return obj->PreventExtensions(); 1831 Handle<Object> result = JSObject::PreventExtensions(obj);
1832 RETURN_IF_EMPTY_HANDLE(isolate, result);
1833 return *result;
1832 } 1834 }
1833 1835
1834 1836
1835 RUNTIME_FUNCTION(MaybeObject*, Runtime_IsExtensible) { 1837 RUNTIME_FUNCTION(MaybeObject*, Runtime_IsExtensible) {
1836 SealHandleScope shs(isolate); 1838 SealHandleScope shs(isolate);
1837 ASSERT(args.length() == 1); 1839 ASSERT(args.length() == 1);
1838 CONVERT_ARG_CHECKED(JSObject, obj, 0); 1840 CONVERT_ARG_CHECKED(JSObject, obj, 0);
1839 if (obj->IsJSGlobalProxy()) { 1841 if (obj->IsJSGlobalProxy()) {
1840 Object* proto = obj->GetPrototype(); 1842 Object* proto = obj->GetPrototype();
1841 if (proto->IsNull()) return isolate->heap()->false_value(); 1843 if (proto->IsNull()) return isolate->heap()->false_value();
1842 ASSERT(proto->IsJSGlobalObject()); 1844 ASSERT(proto->IsJSGlobalObject());
1843 obj = JSObject::cast(proto); 1845 obj = JSObject::cast(proto);
1844 } 1846 }
1845 return isolate->heap()->ToBoolean(obj->map()->is_extensible()); 1847 return isolate->heap()->ToBoolean(obj->map()->is_extensible());
1846 } 1848 }
1847 1849
1848 1850
1849 RUNTIME_FUNCTION(MaybeObject*, Runtime_RegExpCompile) { 1851 RUNTIME_FUNCTION(MaybeObject*, Runtime_RegExpCompile) {
1850 HandleScope scope(isolate); 1852 HandleScope scope(isolate);
1851 ASSERT(args.length() == 3); 1853 ASSERT(args.length() == 3);
1852 CONVERT_ARG_HANDLE_CHECKED(JSRegExp, re, 0); 1854 CONVERT_ARG_HANDLE_CHECKED(JSRegExp, re, 0);
1853 CONVERT_ARG_HANDLE_CHECKED(String, pattern, 1); 1855 CONVERT_ARG_HANDLE_CHECKED(String, pattern, 1);
1854 CONVERT_ARG_HANDLE_CHECKED(String, flags, 2); 1856 CONVERT_ARG_HANDLE_CHECKED(String, flags, 2);
1855 Handle<Object> result = 1857 Handle<Object> result = RegExpImpl::Compile(re, pattern, flags);
1856 RegExpImpl::Compile(re, pattern, flags);
1857 RETURN_IF_EMPTY_HANDLE(isolate, result); 1858 RETURN_IF_EMPTY_HANDLE(isolate, result);
1858 return *result; 1859 return *result;
1859 } 1860 }
1860 1861
1861 1862
1862 RUNTIME_FUNCTION(MaybeObject*, Runtime_CreateApiFunction) { 1863 RUNTIME_FUNCTION(MaybeObject*, Runtime_CreateApiFunction) {
1863 HandleScope scope(isolate); 1864 HandleScope scope(isolate);
1864 ASSERT(args.length() == 1); 1865 ASSERT(args.length() == 1);
1865 CONVERT_ARG_HANDLE_CHECKED(FunctionTemplateInfo, data, 0); 1866 CONVERT_ARG_HANDLE_CHECKED(FunctionTemplateInfo, data, 0);
1866 return *isolate->factory()->CreateApiFunction(data); 1867 return *isolate->factory()->CreateApiFunction(data);
(...skipping 12935 matching lines...) Expand 10 before | Expand all | Expand 10 after
14802 // Handle last resort GC and make sure to allow future allocations 14803 // Handle last resort GC and make sure to allow future allocations
14803 // to grow the heap without causing GCs (if possible). 14804 // to grow the heap without causing GCs (if possible).
14804 isolate->counters()->gc_last_resort_from_js()->Increment(); 14805 isolate->counters()->gc_last_resort_from_js()->Increment();
14805 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, 14806 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags,
14806 "Runtime::PerformGC"); 14807 "Runtime::PerformGC");
14807 } 14808 }
14808 } 14809 }
14809 14810
14810 14811
14811 } } // namespace v8::internal 14812 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698