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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 CONVERT_SMI_ARG_CHECKED(end_position, 3); | 187 CONVERT_SMI_ARG_CHECKED(end_position, 3); |
188 | 188 |
189 Handle<Object> result; | 189 Handle<Object> result; |
190 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | 190 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
191 isolate, result, DefineClass(isolate, super_class, constructor, | 191 isolate, result, DefineClass(isolate, super_class, constructor, |
192 start_position, end_position)); | 192 start_position, end_position)); |
193 return *result; | 193 return *result; |
194 } | 194 } |
195 | 195 |
196 | 196 |
197 RUNTIME_FUNCTION(Runtime_FinalizeClassDefinition) { | |
198 HandleScope scope(isolate); | |
199 DCHECK(args.length() == 2); | |
200 CONVERT_ARG_HANDLE_CHECKED(JSObject, constructor, 0); | |
201 JSObject::MigrateSlowToFast(constructor, 0, "RuntimeToFastProperties"); | |
202 return *constructor; | |
203 } | |
204 | |
205 static MaybeHandle<Object> LoadFromSuper(Isolate* isolate, | 197 static MaybeHandle<Object> LoadFromSuper(Isolate* isolate, |
206 Handle<Object> receiver, | 198 Handle<Object> receiver, |
207 Handle<JSObject> home_object, | 199 Handle<JSObject> home_object, |
208 Handle<Name> name) { | 200 Handle<Name> name) { |
209 if (home_object->IsAccessCheckNeeded() && | 201 if (home_object->IsAccessCheckNeeded() && |
210 !isolate->MayAccess(handle(isolate->context()), home_object)) { | 202 !isolate->MayAccess(handle(isolate->context()), home_object)) { |
211 isolate->ReportFailedAccessCheck(home_object); | 203 isolate->ReportFailedAccessCheck(home_object); |
212 RETURN_EXCEPTION_IF_SCHEDULED_EXCEPTION(isolate, Object); | 204 RETURN_EXCEPTION_IF_SCHEDULED_EXCEPTION(isolate, Object); |
213 } | 205 } |
214 | 206 |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 | 404 |
413 RUNTIME_FUNCTION(Runtime_GetSuperConstructor) { | 405 RUNTIME_FUNCTION(Runtime_GetSuperConstructor) { |
414 SealHandleScope shs(isolate); | 406 SealHandleScope shs(isolate); |
415 DCHECK_EQ(1, args.length()); | 407 DCHECK_EQ(1, args.length()); |
416 CONVERT_ARG_CHECKED(JSFunction, active_function, 0); | 408 CONVERT_ARG_CHECKED(JSFunction, active_function, 0); |
417 return active_function->map()->prototype(); | 409 return active_function->map()->prototype(); |
418 } | 410 } |
419 | 411 |
420 } // namespace internal | 412 } // namespace internal |
421 } // namespace v8 | 413 } // namespace v8 |
OLD | NEW |