Chromium Code Reviews| 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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 149 HandleScope scope(isolate); | 149 HandleScope scope(isolate); |
| 150 DCHECK(args.length() == 1); | 150 DCHECK(args.length() == 1); |
| 151 CONVERT_ARG_HANDLE_CHECKED(Object, obj, 0); | 151 CONVERT_ARG_HANDLE_CHECKED(Object, obj, 0); |
| 152 Handle<Object> result; | 152 Handle<Object> result; |
| 153 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, | 153 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, |
| 154 Runtime::GetPrototype(isolate, obj)); | 154 Runtime::GetPrototype(isolate, obj)); |
| 155 return *result; | 155 return *result; |
| 156 } | 156 } |
| 157 | 157 |
| 158 | 158 |
| 159 // Set object.__proto__ | |
|
adamk
2015/06/13 00:49:38
I'd say "Set the [[Prototype]] internal slot" inst
Dan Ehrenberg
2015/06/13 05:54:09
Done.
| |
| 159 RUNTIME_FUNCTION(Runtime_InternalSetPrototype) { | 160 RUNTIME_FUNCTION(Runtime_InternalSetPrototype) { |
| 160 HandleScope scope(isolate); | 161 HandleScope scope(isolate); |
| 161 DCHECK(args.length() == 2); | 162 DCHECK(args.length() == 2); |
| 162 CONVERT_ARG_HANDLE_CHECKED(JSObject, obj, 0); | 163 CONVERT_ARG_HANDLE_CHECKED(JSObject, obj, 0); |
| 163 CONVERT_ARG_HANDLE_CHECKED(Object, prototype, 1); | 164 CONVERT_ARG_HANDLE_CHECKED(Object, prototype, 1); |
| 164 DCHECK(!obj->IsAccessCheckNeeded()); | 165 DCHECK(!obj->IsAccessCheckNeeded()); |
| 165 DCHECK(!obj->map()->is_observed()); | 166 DCHECK(!obj->map()->is_observed()); |
| 166 Handle<Object> result; | 167 Handle<Object> result; |
| 167 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | 168 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
| 168 isolate, result, JSObject::SetPrototype(obj, prototype, false)); | 169 isolate, result, JSObject::SetPrototype(obj, prototype, false)); |
| (...skipping 1272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1441 CONVERT_PROPERTY_ATTRIBUTES_CHECKED(attrs, 3); | 1442 CONVERT_PROPERTY_ATTRIBUTES_CHECKED(attrs, 3); |
| 1442 | 1443 |
| 1443 RETURN_FAILURE_ON_EXCEPTION( | 1444 RETURN_FAILURE_ON_EXCEPTION( |
| 1444 isolate, | 1445 isolate, |
| 1445 JSObject::DefineAccessor(object, name, isolate->factory()->null_value(), | 1446 JSObject::DefineAccessor(object, name, isolate->factory()->null_value(), |
| 1446 setter, attrs)); | 1447 setter, attrs)); |
| 1447 return isolate->heap()->undefined_value(); | 1448 return isolate->heap()->undefined_value(); |
| 1448 } | 1449 } |
| 1449 } // namespace internal | 1450 } // namespace internal |
| 1450 } // namespace v8 | 1451 } // namespace v8 |
| OLD | NEW |