| 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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 CONVERT_SMI_ARG_CHECKED(end_position, 3); | 196 CONVERT_SMI_ARG_CHECKED(end_position, 3); |
| 197 | 197 |
| 198 Handle<Object> result; | 198 Handle<Object> result; |
| 199 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | 199 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
| 200 isolate, result, DefineClass(isolate, super_class, constructor, | 200 isolate, result, DefineClass(isolate, super_class, constructor, |
| 201 start_position, end_position)); | 201 start_position, end_position)); |
| 202 return *result; | 202 return *result; |
| 203 } | 203 } |
| 204 | 204 |
| 205 | 205 |
| 206 RUNTIME_FUNCTION(Runtime_DefineClassMethod) { | |
| 207 HandleScope scope(isolate); | |
| 208 DCHECK(args.length() == 3); | |
| 209 CONVERT_ARG_HANDLE_CHECKED(JSObject, object, 0); | |
| 210 CONVERT_ARG_HANDLE_CHECKED(Name, name, 1); | |
| 211 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 2); | |
| 212 | |
| 213 RETURN_FAILURE_ON_EXCEPTION(isolate, | |
| 214 JSObject::DefinePropertyOrElementIgnoreAttributes( | |
| 215 object, name, function, DONT_ENUM)); | |
| 216 return isolate->heap()->undefined_value(); | |
| 217 } | |
| 218 | |
| 219 | |
| 220 RUNTIME_FUNCTION(Runtime_FinalizeClassDefinition) { | 206 RUNTIME_FUNCTION(Runtime_FinalizeClassDefinition) { |
| 221 HandleScope scope(isolate); | 207 HandleScope scope(isolate); |
| 222 DCHECK(args.length() == 2); | 208 DCHECK(args.length() == 2); |
| 223 CONVERT_ARG_HANDLE_CHECKED(JSObject, constructor, 0); | 209 CONVERT_ARG_HANDLE_CHECKED(JSObject, constructor, 0); |
| 224 CONVERT_ARG_HANDLE_CHECKED(JSObject, prototype, 1); | 210 CONVERT_ARG_HANDLE_CHECKED(JSObject, prototype, 1); |
| 225 | 211 |
| 226 JSObject::MigrateSlowToFast(constructor, 0, "RuntimeToFastProperties"); | 212 JSObject::MigrateSlowToFast(constructor, 0, "RuntimeToFastProperties"); |
| 227 | 213 |
| 228 if (constructor->map()->is_strong()) { | 214 if (constructor->map()->is_strong()) { |
| 229 DCHECK(prototype->map()->is_strong()); | 215 DCHECK(prototype->map()->is_strong()); |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 459 | 445 |
| 460 RUNTIME_FUNCTION(Runtime_GetSuperConstructor) { | 446 RUNTIME_FUNCTION(Runtime_GetSuperConstructor) { |
| 461 SealHandleScope shs(isolate); | 447 SealHandleScope shs(isolate); |
| 462 DCHECK_EQ(1, args.length()); | 448 DCHECK_EQ(1, args.length()); |
| 463 CONVERT_ARG_CHECKED(JSFunction, active_function, 0); | 449 CONVERT_ARG_CHECKED(JSFunction, active_function, 0); |
| 464 return active_function->map()->prototype(); | 450 return active_function->map()->prototype(); |
| 465 } | 451 } |
| 466 | 452 |
| 467 } // namespace internal | 453 } // namespace internal |
| 468 } // namespace v8 | 454 } // namespace v8 |
| OLD | NEW |