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 <stdlib.h> | 5 #include <stdlib.h> |
6 #include <limits> | 6 #include <limits> |
7 | 7 |
8 #include "src/v8.h" | 8 #include "src/v8.h" |
9 | 9 |
10 #include "src/isolate-inl.h" | 10 #include "src/isolate-inl.h" |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 Handle<Object> args[1] = {super_class}; | 101 Handle<Object> args[1] = {super_class}; |
102 THROW_NEW_ERROR_RETURN_FAILURE( | 102 THROW_NEW_ERROR_RETURN_FAILURE( |
103 isolate, | 103 isolate, |
104 NewTypeError("extends_value_not_a_function", HandleVector(args, 1))); | 104 NewTypeError("extends_value_not_a_function", HandleVector(args, 1))); |
105 } | 105 } |
106 } | 106 } |
107 | 107 |
108 Handle<Map> map = | 108 Handle<Map> map = |
109 isolate->factory()->NewMap(JS_OBJECT_TYPE, JSObject::kHeaderSize); | 109 isolate->factory()->NewMap(JS_OBJECT_TYPE, JSObject::kHeaderSize); |
110 map->SetPrototype(prototype_parent); | 110 map->SetPrototype(prototype_parent); |
111 map->set_constructor(*constructor); | 111 map->SetConstructor(*constructor); |
112 Handle<JSObject> prototype = isolate->factory()->NewJSObjectFromMap(map); | 112 Handle<JSObject> prototype = isolate->factory()->NewJSObjectFromMap(map); |
113 | 113 |
114 Handle<String> name_string = name->IsString() | 114 Handle<String> name_string = name->IsString() |
115 ? Handle<String>::cast(name) | 115 ? Handle<String>::cast(name) |
116 : isolate->factory()->empty_string(); | 116 : isolate->factory()->empty_string(); |
117 constructor->shared()->set_name(*name_string); | 117 constructor->shared()->set_name(*name_string); |
118 | 118 |
119 if (!super_class->IsTheHole()) { | 119 if (!super_class->IsTheHole()) { |
120 Handle<Code> stub(isolate->builtins()->JSConstructStubForDerived()); | 120 Handle<Code> stub(isolate->builtins()->JSConstructStubForDerived()); |
121 constructor->shared()->set_construct_stub(*stub); | 121 constructor->shared()->set_construct_stub(*stub); |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 return *isolate->factory()->undefined_value(); | 423 return *isolate->factory()->undefined_value(); |
424 } | 424 } |
425 | 425 |
426 | 426 |
427 RUNTIME_FUNCTION(RuntimeReference_DefaultConstructorCallSuper) { | 427 RUNTIME_FUNCTION(RuntimeReference_DefaultConstructorCallSuper) { |
428 UNREACHABLE(); | 428 UNREACHABLE(); |
429 return nullptr; | 429 return nullptr; |
430 } | 430 } |
431 } | 431 } |
432 } // namespace v8::internal | 432 } // namespace v8::internal |
OLD | NEW |