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...) Expand 10 before | Expand all | Expand 10 after 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. | |
152 RUNTIME_FUNCTION(Runtime_InternalSetPrototype) { | 151 RUNTIME_FUNCTION(Runtime_InternalSetPrototype) { |
153 HandleScope scope(isolate); | 152 HandleScope scope(isolate); |
154 DCHECK(args.length() == 2); | 153 DCHECK(args.length() == 2); |
155 CONVERT_ARG_HANDLE_CHECKED(JSObject, obj, 0); | 154 CONVERT_ARG_HANDLE_CHECKED(JSObject, obj, 0); |
156 CONVERT_ARG_HANDLE_CHECKED(Object, prototype, 1); | 155 CONVERT_ARG_HANDLE_CHECKED(Object, prototype, 1); |
157 DCHECK(!obj->IsAccessCheckNeeded()); | 156 DCHECK(!obj->IsAccessCheckNeeded()); |
158 DCHECK(!obj->map()->is_observed()); | 157 DCHECK(!obj->map()->is_observed()); |
159 Handle<Object> result; | 158 Handle<Object> result; |
160 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | 159 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
161 isolate, result, JSObject::SetPrototype(obj, prototype, false)); | 160 isolate, result, JSObject::SetPrototype(obj, prototype, false)); |
(...skipping 1263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1425 CONVERT_PROPERTY_ATTRIBUTES_CHECKED(attrs, 3); | 1424 CONVERT_PROPERTY_ATTRIBUTES_CHECKED(attrs, 3); |
1426 | 1425 |
1427 RETURN_FAILURE_ON_EXCEPTION( | 1426 RETURN_FAILURE_ON_EXCEPTION( |
1428 isolate, | 1427 isolate, |
1429 JSObject::DefineAccessor(object, name, isolate->factory()->null_value(), | 1428 JSObject::DefineAccessor(object, name, isolate->factory()->null_value(), |
1430 setter, attrs)); | 1429 setter, attrs)); |
1431 return isolate->heap()->undefined_value(); | 1430 return isolate->heap()->undefined_value(); |
1432 } | 1431 } |
1433 } // namespace internal | 1432 } // namespace internal |
1434 } // namespace v8 | 1433 } // namespace v8 |
OLD | NEW |