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/messages.h" | 10 #include "src/messages.h" |
(...skipping 130 matching lines...) Loading... |
141 HandleScope scope(isolate); | 141 HandleScope scope(isolate); |
142 DCHECK(args.length() == 1); | 142 DCHECK(args.length() == 1); |
143 CONVERT_ARG_HANDLE_CHECKED(Object, obj, 0); | 143 CONVERT_ARG_HANDLE_CHECKED(Object, obj, 0); |
144 Handle<Object> result; | 144 Handle<Object> result; |
145 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, | 145 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, |
146 Runtime::GetPrototype(isolate, obj)); | 146 Runtime::GetPrototype(isolate, obj)); |
147 return *result; | 147 return *result; |
148 } | 148 } |
149 | 149 |
150 | 150 |
| 151 // Set the [[Prototype]] internal slot of an object. |
151 RUNTIME_FUNCTION(Runtime_InternalSetPrototype) { | 152 RUNTIME_FUNCTION(Runtime_InternalSetPrototype) { |
152 HandleScope scope(isolate); | 153 HandleScope scope(isolate); |
153 DCHECK(args.length() == 2); | 154 DCHECK(args.length() == 2); |
154 CONVERT_ARG_HANDLE_CHECKED(JSObject, obj, 0); | 155 CONVERT_ARG_HANDLE_CHECKED(JSObject, obj, 0); |
155 CONVERT_ARG_HANDLE_CHECKED(Object, prototype, 1); | 156 CONVERT_ARG_HANDLE_CHECKED(Object, prototype, 1); |
156 DCHECK(!obj->IsAccessCheckNeeded()); | 157 DCHECK(!obj->IsAccessCheckNeeded()); |
157 DCHECK(!obj->map()->is_observed()); | 158 DCHECK(!obj->map()->is_observed()); |
158 Handle<Object> result; | 159 Handle<Object> result; |
159 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | 160 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
160 isolate, result, JSObject::SetPrototype(obj, prototype, false)); | 161 isolate, result, JSObject::SetPrototype(obj, prototype, false)); |
(...skipping 1263 matching lines...) Loading... |
1424 CONVERT_PROPERTY_ATTRIBUTES_CHECKED(attrs, 3); | 1425 CONVERT_PROPERTY_ATTRIBUTES_CHECKED(attrs, 3); |
1425 | 1426 |
1426 RETURN_FAILURE_ON_EXCEPTION( | 1427 RETURN_FAILURE_ON_EXCEPTION( |
1427 isolate, | 1428 isolate, |
1428 JSObject::DefineAccessor(object, name, isolate->factory()->null_value(), | 1429 JSObject::DefineAccessor(object, name, isolate->factory()->null_value(), |
1429 setter, attrs)); | 1430 setter, attrs)); |
1430 return isolate->heap()->undefined_value(); | 1431 return isolate->heap()->undefined_value(); |
1431 } | 1432 } |
1432 } // namespace internal | 1433 } // namespace internal |
1433 } // namespace v8 | 1434 } // namespace v8 |
OLD | NEW |