| OLD | NEW |
| 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 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, | 265 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, |
| 266 GetOwnProperty(isolate, obj, name)); | 266 GetOwnProperty(isolate, obj, name)); |
| 267 return *result; | 267 return *result; |
| 268 } | 268 } |
| 269 | 269 |
| 270 | 270 |
| 271 RUNTIME_FUNCTION(Runtime_PreventExtensions) { | 271 RUNTIME_FUNCTION(Runtime_PreventExtensions) { |
| 272 HandleScope scope(isolate); | 272 HandleScope scope(isolate); |
| 273 DCHECK(args.length() == 1); | 273 DCHECK(args.length() == 1); |
| 274 CONVERT_ARG_HANDLE_CHECKED(JSReceiver, obj, 0); | 274 CONVERT_ARG_HANDLE_CHECKED(JSReceiver, obj, 0); |
| 275 if (JSReceiver::PreventExtensions(obj, Object::THROW_ON_ERROR).IsNothing()) | 275 MAYBE_RETURN(JSReceiver::PreventExtensions(obj, Object::THROW_ON_ERROR), |
| 276 return isolate->heap()->exception(); | 276 isolate->heap()->exception()); |
| 277 return *obj; | 277 return *obj; |
| 278 } | 278 } |
| 279 | 279 |
| 280 | 280 |
| 281 RUNTIME_FUNCTION(Runtime_IsExtensible) { | 281 RUNTIME_FUNCTION(Runtime_IsExtensible) { |
| 282 HandleScope scope(isolate); | 282 HandleScope scope(isolate); |
| 283 DCHECK(args.length() == 1); | 283 DCHECK(args.length() == 1); |
| 284 CONVERT_ARG_HANDLE_CHECKED(JSObject, obj, 0); | 284 CONVERT_ARG_HANDLE_CHECKED(JSReceiver, obj, 0); |
| 285 return isolate->heap()->ToBoolean(JSObject::IsExtensible(obj)); | 285 Maybe<bool> result = JSReceiver::IsExtensible(obj); |
| 286 MAYBE_RETURN(result, isolate->heap()->exception()); |
| 287 return isolate->heap()->ToBoolean(result.FromJust()); |
| 286 } | 288 } |
| 287 | 289 |
| 288 | 290 |
| 289 RUNTIME_FUNCTION(Runtime_OptimizeObjectForAddingMultipleProperties) { | 291 RUNTIME_FUNCTION(Runtime_OptimizeObjectForAddingMultipleProperties) { |
| 290 HandleScope scope(isolate); | 292 HandleScope scope(isolate); |
| 291 DCHECK(args.length() == 2); | 293 DCHECK(args.length() == 2); |
| 292 CONVERT_ARG_HANDLE_CHECKED(JSObject, object, 0); | 294 CONVERT_ARG_HANDLE_CHECKED(JSObject, object, 0); |
| 293 CONVERT_SMI_ARG_CHECKED(properties, 1); | 295 CONVERT_SMI_ARG_CHECKED(properties, 1); |
| 294 // Conservative upper limit to prevent fuzz tests from going OOM. | 296 // Conservative upper limit to prevent fuzz tests from going OOM. |
| 295 RUNTIME_ASSERT(properties <= 100000); | 297 RUNTIME_ASSERT(properties <= 100000); |
| (...skipping 1272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1568 | 1570 |
| 1569 RUNTIME_FUNCTION(Runtime_ObjectDefineProperties) { | 1571 RUNTIME_FUNCTION(Runtime_ObjectDefineProperties) { |
| 1570 HandleScope scope(isolate); | 1572 HandleScope scope(isolate); |
| 1571 DCHECK(args.length() == 2); | 1573 DCHECK(args.length() == 2); |
| 1572 CONVERT_ARG_HANDLE_CHECKED(Object, o, 0); | 1574 CONVERT_ARG_HANDLE_CHECKED(Object, o, 0); |
| 1573 CONVERT_ARG_HANDLE_CHECKED(Object, properties, 1); | 1575 CONVERT_ARG_HANDLE_CHECKED(Object, properties, 1); |
| 1574 return JSReceiver::DefineProperties(isolate, o, properties); | 1576 return JSReceiver::DefineProperties(isolate, o, properties); |
| 1575 } | 1577 } |
| 1576 } // namespace internal | 1578 } // namespace internal |
| 1577 } // namespace v8 | 1579 } // namespace v8 |
| OLD | NEW |