| 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/runtime/runtime-utils.h" | 5 #include "src/runtime/runtime-utils.h" |
| 6 | 6 |
| 7 #include <stdlib.h> | 7 #include <stdlib.h> |
| 8 #include <limits> | 8 #include <limits> |
| 9 | 9 |
| 10 #include "src/arguments.h" | 10 #include "src/arguments.h" |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 Handle<Object> prototype_parent; | 88 Handle<Object> prototype_parent; |
| 89 Handle<Object> constructor_parent; | 89 Handle<Object> constructor_parent; |
| 90 | 90 |
| 91 if (super_class->IsTheHole(isolate)) { | 91 if (super_class->IsTheHole(isolate)) { |
| 92 prototype_parent = isolate->initial_object_prototype(); | 92 prototype_parent = isolate->initial_object_prototype(); |
| 93 } else { | 93 } else { |
| 94 if (super_class->IsNull(isolate)) { | 94 if (super_class->IsNull(isolate)) { |
| 95 prototype_parent = isolate->factory()->null_value(); | 95 prototype_parent = isolate->factory()->null_value(); |
| 96 } else if (super_class->IsConstructor()) { | 96 } else if (super_class->IsConstructor()) { |
| 97 DCHECK(!super_class->IsJSFunction() || | 97 DCHECK(!super_class->IsJSFunction() || |
| 98 !Handle<JSFunction>::cast(super_class)->shared()->is_resumable()); | 98 !IsResumableFunction( |
| 99 Handle<JSFunction>::cast(super_class)->shared()->kind())); |
| 99 ASSIGN_RETURN_ON_EXCEPTION( | 100 ASSIGN_RETURN_ON_EXCEPTION( |
| 100 isolate, prototype_parent, | 101 isolate, prototype_parent, |
| 101 Runtime::GetObjectProperty(isolate, super_class, | 102 Runtime::GetObjectProperty(isolate, super_class, |
| 102 isolate->factory()->prototype_string()), | 103 isolate->factory()->prototype_string()), |
| 103 Object); | 104 Object); |
| 104 if (!prototype_parent->IsNull(isolate) && | 105 if (!prototype_parent->IsNull(isolate) && |
| 105 !prototype_parent->IsJSReceiver()) { | 106 !prototype_parent->IsJSReceiver()) { |
| 106 THROW_NEW_ERROR( | 107 THROW_NEW_ERROR( |
| 107 isolate, NewTypeError(MessageTemplate::kPrototypeParentNotAnObject, | 108 isolate, NewTypeError(MessageTemplate::kPrototypeParentNotAnObject, |
| 108 prototype_parent), | 109 prototype_parent), |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 | 401 |
| 401 RUNTIME_FUNCTION(Runtime_GetSuperConstructor) { | 402 RUNTIME_FUNCTION(Runtime_GetSuperConstructor) { |
| 402 SealHandleScope shs(isolate); | 403 SealHandleScope shs(isolate); |
| 403 DCHECK_EQ(1, args.length()); | 404 DCHECK_EQ(1, args.length()); |
| 404 CONVERT_ARG_CHECKED(JSFunction, active_function, 0); | 405 CONVERT_ARG_CHECKED(JSFunction, active_function, 0); |
| 405 return active_function->map()->prototype(); | 406 return active_function->map()->prototype(); |
| 406 } | 407 } |
| 407 | 408 |
| 408 } // namespace internal | 409 } // namespace internal |
| 409 } // namespace v8 | 410 } // namespace v8 |
| OLD | NEW |