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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 } | 44 } |
45 | 45 |
46 | 46 |
47 RUNTIME_FUNCTION(Runtime_ThrowArrayNotSubclassableError) { | 47 RUNTIME_FUNCTION(Runtime_ThrowArrayNotSubclassableError) { |
48 HandleScope scope(isolate); | 48 HandleScope scope(isolate); |
49 DCHECK(args.length() == 0); | 49 DCHECK(args.length() == 0); |
50 THROW_NEW_ERROR_RETURN_FAILURE( | 50 THROW_NEW_ERROR_RETURN_FAILURE( |
51 isolate, NewTypeError(MessageTemplate::kArrayNotSubclassable)); | 51 isolate, NewTypeError(MessageTemplate::kArrayNotSubclassable)); |
52 } | 52 } |
53 | 53 |
54 | 54 RUNTIME_FUNCTION(Runtime_ThrowStaticPrototypeError) { |
55 static Object* ThrowStaticPrototypeError(Isolate* isolate) { | 55 HandleScope scope(isolate); |
| 56 DCHECK(args.length() == 0); |
56 THROW_NEW_ERROR_RETURN_FAILURE( | 57 THROW_NEW_ERROR_RETURN_FAILURE( |
57 isolate, NewTypeError(MessageTemplate::kStaticPrototype)); | 58 isolate, NewTypeError(MessageTemplate::kStaticPrototype)); |
58 } | 59 } |
59 | 60 |
60 | |
61 RUNTIME_FUNCTION(Runtime_ThrowStaticPrototypeError) { | |
62 HandleScope scope(isolate); | |
63 DCHECK(args.length() == 0); | |
64 return ThrowStaticPrototypeError(isolate); | |
65 } | |
66 | |
67 | |
68 RUNTIME_FUNCTION(Runtime_ThrowIfStaticPrototype) { | |
69 HandleScope scope(isolate); | |
70 DCHECK(args.length() == 1); | |
71 CONVERT_ARG_HANDLE_CHECKED(Name, name, 0); | |
72 if (Name::Equals(name, isolate->factory()->prototype_string())) { | |
73 return ThrowStaticPrototypeError(isolate); | |
74 } | |
75 return *name; | |
76 } | |
77 | |
78 | |
79 RUNTIME_FUNCTION(Runtime_HomeObjectSymbol) { | 61 RUNTIME_FUNCTION(Runtime_HomeObjectSymbol) { |
80 DCHECK(args.length() == 0); | 62 DCHECK(args.length() == 0); |
81 return isolate->heap()->home_object_symbol(); | 63 return isolate->heap()->home_object_symbol(); |
82 } | 64 } |
83 | 65 |
84 static MaybeHandle<Object> DefineClass(Isolate* isolate, | 66 static MaybeHandle<Object> DefineClass(Isolate* isolate, |
85 Handle<Object> super_class, | 67 Handle<Object> super_class, |
86 Handle<JSFunction> constructor, | 68 Handle<JSFunction> constructor, |
87 int start_position, int end_position) { | 69 int start_position, int end_position) { |
88 Handle<Object> prototype_parent; | 70 Handle<Object> prototype_parent; |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 | 383 |
402 RUNTIME_FUNCTION(Runtime_GetSuperConstructor) { | 384 RUNTIME_FUNCTION(Runtime_GetSuperConstructor) { |
403 SealHandleScope shs(isolate); | 385 SealHandleScope shs(isolate); |
404 DCHECK_EQ(1, args.length()); | 386 DCHECK_EQ(1, args.length()); |
405 CONVERT_ARG_CHECKED(JSFunction, active_function, 0); | 387 CONVERT_ARG_CHECKED(JSFunction, active_function, 0); |
406 return active_function->map()->prototype(); | 388 return active_function->map()->prototype(); |
407 } | 389 } |
408 | 390 |
409 } // namespace internal | 391 } // namespace internal |
410 } // namespace v8 | 392 } // namespace v8 |
OLD | NEW |