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/v8.h" | 5 #include "src/v8.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.h" | 9 #include "src/debug.h" |
10 #include "src/runtime/runtime.h" | 10 #include "src/runtime/runtime.h" |
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
523 // %ObjectFreeze is a fast path and these cases are handled elsewhere. | 523 // %ObjectFreeze is a fast path and these cases are handled elsewhere. |
524 RUNTIME_ASSERT(!object->HasSloppyArgumentsElements() && | 524 RUNTIME_ASSERT(!object->HasSloppyArgumentsElements() && |
525 !object->map()->is_observed() && !object->IsJSProxy()); | 525 !object->map()->is_observed() && !object->IsJSProxy()); |
526 | 526 |
527 Handle<Object> result; | 527 Handle<Object> result; |
528 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, JSObject::Freeze(object)); | 528 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, JSObject::Freeze(object)); |
529 return *result; | 529 return *result; |
530 } | 530 } |
531 | 531 |
532 | 532 |
| 533 RUNTIME_FUNCTION(Runtime_ObjectSeal) { |
| 534 HandleScope scope(isolate); |
| 535 DCHECK(args.length() == 1); |
| 536 CONVERT_ARG_HANDLE_CHECKED(JSObject, object, 0); |
| 537 |
| 538 // %ObjectSeal is a fast path and these cases are handled elsewhere. |
| 539 RUNTIME_ASSERT(!object->HasSloppyArgumentsElements() && |
| 540 !object->map()->is_observed() && !object->IsJSProxy()); |
| 541 |
| 542 Handle<Object> result; |
| 543 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, JSObject::Seal(object)); |
| 544 return *result; |
| 545 } |
| 546 |
| 547 |
533 RUNTIME_FUNCTION(Runtime_GetProperty) { | 548 RUNTIME_FUNCTION(Runtime_GetProperty) { |
534 HandleScope scope(isolate); | 549 HandleScope scope(isolate); |
535 DCHECK(args.length() == 2); | 550 DCHECK(args.length() == 2); |
536 | 551 |
537 CONVERT_ARG_HANDLE_CHECKED(Object, object, 0); | 552 CONVERT_ARG_HANDLE_CHECKED(Object, object, 0); |
538 CONVERT_ARG_HANDLE_CHECKED(Object, key, 1); | 553 CONVERT_ARG_HANDLE_CHECKED(Object, key, 1); |
539 Handle<Object> result; | 554 Handle<Object> result; |
540 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | 555 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
541 isolate, result, Runtime::GetObjectProperty(isolate, object, key)); | 556 isolate, result, Runtime::GetObjectProperty(isolate, object, key)); |
542 return *result; | 557 return *result; |
(...skipping 1042 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1585 | 1600 |
1586 RUNTIME_FUNCTION(RuntimeReference_ClassOf) { | 1601 RUNTIME_FUNCTION(RuntimeReference_ClassOf) { |
1587 SealHandleScope shs(isolate); | 1602 SealHandleScope shs(isolate); |
1588 DCHECK(args.length() == 1); | 1603 DCHECK(args.length() == 1); |
1589 CONVERT_ARG_CHECKED(Object, obj, 0); | 1604 CONVERT_ARG_CHECKED(Object, obj, 0); |
1590 if (!obj->IsJSReceiver()) return isolate->heap()->null_value(); | 1605 if (!obj->IsJSReceiver()) return isolate->heap()->null_value(); |
1591 return JSReceiver::cast(obj)->class_name(); | 1606 return JSReceiver::cast(obj)->class_name(); |
1592 } | 1607 } |
1593 } | 1608 } |
1594 } // namespace v8::internal | 1609 } // namespace v8::internal |
OLD | NEW |