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 1571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1582 SealHandleScope shs(isolate); | 1582 SealHandleScope shs(isolate); |
1583 DCHECK(args.length() == 1); | 1583 DCHECK(args.length() == 1); |
1584 CONVERT_ARG_CHECKED(Object, obj, 0); | 1584 CONVERT_ARG_CHECKED(Object, obj, 0); |
1585 if (!obj->IsJSReceiver()) return isolate->heap()->null_value(); | 1585 if (!obj->IsJSReceiver()) return isolate->heap()->null_value(); |
1586 return JSReceiver::cast(obj)->class_name(); | 1586 return JSReceiver::cast(obj)->class_name(); |
1587 } | 1587 } |
1588 | 1588 |
1589 | 1589 |
1590 RUNTIME_FUNCTION(Runtime_DefineGetterPropertyUnchecked) { | 1590 RUNTIME_FUNCTION(Runtime_DefineGetterPropertyUnchecked) { |
1591 HandleScope scope(isolate); | 1591 HandleScope scope(isolate); |
1592 DCHECK(args.length() == 3); | 1592 DCHECK(args.length() == 4); |
1593 CONVERT_ARG_HANDLE_CHECKED(JSObject, object, 0); | 1593 CONVERT_ARG_HANDLE_CHECKED(JSObject, object, 0); |
1594 CONVERT_ARG_HANDLE_CHECKED(Name, name, 1); | 1594 CONVERT_ARG_HANDLE_CHECKED(Name, name, 1); |
1595 CONVERT_ARG_HANDLE_CHECKED(JSFunction, getter, 2); | 1595 CONVERT_ARG_HANDLE_CHECKED(JSFunction, getter, 2); |
| 1596 CONVERT_SMI_ARG_CHECKED(unchecked, 3); |
| 1597 RUNTIME_ASSERT((unchecked & ~(READ_ONLY | DONT_ENUM | DONT_DELETE)) == 0); |
| 1598 PropertyAttributes attrs = static_cast<PropertyAttributes>(unchecked); |
1596 | 1599 |
1597 RETURN_FAILURE_ON_EXCEPTION( | 1600 RETURN_FAILURE_ON_EXCEPTION( |
1598 isolate, | 1601 isolate, |
1599 JSObject::DefineAccessor(object, name, getter, | 1602 JSObject::DefineAccessor(object, name, getter, |
1600 isolate->factory()->null_value(), NONE)); | 1603 isolate->factory()->null_value(), attrs)); |
1601 return isolate->heap()->undefined_value(); | 1604 return isolate->heap()->undefined_value(); |
1602 } | 1605 } |
1603 | 1606 |
1604 | 1607 |
1605 RUNTIME_FUNCTION(Runtime_DefineSetterPropertyUnchecked) { | 1608 RUNTIME_FUNCTION(Runtime_DefineSetterPropertyUnchecked) { |
1606 HandleScope scope(isolate); | 1609 HandleScope scope(isolate); |
1607 DCHECK(args.length() == 3); | 1610 DCHECK(args.length() == 4); |
1608 CONVERT_ARG_HANDLE_CHECKED(JSObject, object, 0); | 1611 CONVERT_ARG_HANDLE_CHECKED(JSObject, object, 0); |
1609 CONVERT_ARG_HANDLE_CHECKED(Name, name, 1); | 1612 CONVERT_ARG_HANDLE_CHECKED(Name, name, 1); |
1610 CONVERT_ARG_HANDLE_CHECKED(JSFunction, setter, 2); | 1613 CONVERT_ARG_HANDLE_CHECKED(JSFunction, setter, 2); |
| 1614 CONVERT_SMI_ARG_CHECKED(unchecked, 3); |
| 1615 RUNTIME_ASSERT((unchecked & ~(READ_ONLY | DONT_ENUM | DONT_DELETE)) == 0); |
| 1616 PropertyAttributes attrs = static_cast<PropertyAttributes>(unchecked); |
1611 | 1617 |
1612 RETURN_FAILURE_ON_EXCEPTION( | 1618 RETURN_FAILURE_ON_EXCEPTION( |
1613 isolate, | 1619 isolate, |
1614 JSObject::DefineAccessor(object, name, isolate->factory()->null_value(), | 1620 JSObject::DefineAccessor(object, name, isolate->factory()->null_value(), |
1615 setter, NONE)); | 1621 setter, attrs)); |
1616 return isolate->heap()->undefined_value(); | 1622 return isolate->heap()->undefined_value(); |
1617 } | 1623 } |
1618 } | 1624 } |
1619 } // namespace v8::internal | 1625 } // namespace v8::internal |
OLD | NEW |