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

Side by Side Diff: src/runtime/runtime-object.cc

Issue 1378343002: Add access check to JSObject::IsExtensible. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 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
« 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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/runtime/runtime-utils.h" 5 #include "src/runtime/runtime-utils.h"
6 6
7 #include "src/arguments.h" 7 #include "src/arguments.h"
8 #include "src/bootstrapper.h" 8 #include "src/bootstrapper.h"
9 #include "src/debug/debug.h" 9 #include "src/debug/debug.h"
10 #include "src/isolate-inl.h" 10 #include "src/isolate-inl.h"
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 DCHECK(args.length() == 1); 303 DCHECK(args.length() == 1);
304 CONVERT_ARG_HANDLE_CHECKED(JSObject, obj, 0); 304 CONVERT_ARG_HANDLE_CHECKED(JSObject, obj, 0);
305 Handle<Object> result; 305 Handle<Object> result;
306 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, 306 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result,
307 JSObject::PreventExtensions(obj)); 307 JSObject::PreventExtensions(obj));
308 return *result; 308 return *result;
309 } 309 }
310 310
311 311
312 RUNTIME_FUNCTION(Runtime_IsExtensible) { 312 RUNTIME_FUNCTION(Runtime_IsExtensible) {
313 SealHandleScope shs(isolate); 313 HandleScope scope(isolate);
314 DCHECK(args.length() == 1); 314 DCHECK(args.length() == 1);
315 CONVERT_ARG_CHECKED(JSObject, obj, 0); 315 CONVERT_ARG_HANDLE_CHECKED(JSObject, obj, 0);
316 return isolate->heap()->ToBoolean(obj->IsExtensible()); 316 return isolate->heap()->ToBoolean(JSObject::IsExtensible(obj));
317 } 317 }
318 318
319 319
320 RUNTIME_FUNCTION(Runtime_OptimizeObjectForAddingMultipleProperties) { 320 RUNTIME_FUNCTION(Runtime_OptimizeObjectForAddingMultipleProperties) {
321 HandleScope scope(isolate); 321 HandleScope scope(isolate);
322 DCHECK(args.length() == 2); 322 DCHECK(args.length() == 2);
323 CONVERT_ARG_HANDLE_CHECKED(JSObject, object, 0); 323 CONVERT_ARG_HANDLE_CHECKED(JSObject, object, 0);
324 CONVERT_SMI_ARG_CHECKED(properties, 1); 324 CONVERT_SMI_ARG_CHECKED(properties, 1);
325 // Conservative upper limit to prevent fuzz tests from going OOM. 325 // Conservative upper limit to prevent fuzz tests from going OOM.
326 RUNTIME_ASSERT(properties <= 100000); 326 RUNTIME_ASSERT(properties <= 100000);
(...skipping 1279 matching lines...) Expand 10 before | Expand all | Expand 10 after
1606 RUNTIME_FUNCTION(Runtime_IsAccessCheckNeeded) { 1606 RUNTIME_FUNCTION(Runtime_IsAccessCheckNeeded) {
1607 SealHandleScope shs(isolate); 1607 SealHandleScope shs(isolate);
1608 DCHECK_EQ(1, args.length()); 1608 DCHECK_EQ(1, args.length());
1609 CONVERT_ARG_CHECKED(Object, object, 0); 1609 CONVERT_ARG_CHECKED(Object, object, 0);
1610 return isolate->heap()->ToBoolean(object->IsAccessCheckNeeded()); 1610 return isolate->heap()->ToBoolean(object->IsAccessCheckNeeded());
1611 } 1611 }
1612 1612
1613 1613
1614 } // namespace internal 1614 } // namespace internal
1615 } // namespace v8 1615 } // namespace v8
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