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 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
475 DCHECK(args.length() == 4); | 475 DCHECK(args.length() == 4); |
476 CONVERT_ARG_HANDLE_CHECKED(Object, receiver, 0); | 476 CONVERT_ARG_HANDLE_CHECKED(Object, receiver, 0); |
477 CONVERT_ARG_HANDLE_CHECKED(JSObject, home_object, 1); | 477 CONVERT_ARG_HANDLE_CHECKED(JSObject, home_object, 1); |
478 CONVERT_ARG_HANDLE_CHECKED(Object, key, 2); | 478 CONVERT_ARG_HANDLE_CHECKED(Object, key, 2); |
479 CONVERT_ARG_HANDLE_CHECKED(Object, value, 3); | 479 CONVERT_ARG_HANDLE_CHECKED(Object, value, 3); |
480 | 480 |
481 return StoreKeyedToSuper(isolate, home_object, receiver, key, value, SLOPPY); | 481 return StoreKeyedToSuper(isolate, home_object, receiver, key, value, SLOPPY); |
482 } | 482 } |
483 | 483 |
484 | 484 |
485 RUNTIME_FUNCTION(Runtime_HandleStepInForDerivedConstructors) { | |
486 HandleScope scope(isolate); | |
487 DCHECK(args.length() == 1); | |
488 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); | |
489 Debug* debug = isolate->debug(); | |
490 // Handle stepping into constructors if step into is active. | |
491 if (debug->StepInActive()) debug->HandleStepIn(function, true); | |
492 return *isolate->factory()->undefined_value(); | |
493 } | |
494 | |
495 | |
496 RUNTIME_FUNCTION(Runtime_DefaultConstructorCallSuper) { | 485 RUNTIME_FUNCTION(Runtime_DefaultConstructorCallSuper) { |
497 HandleScope scope(isolate); | 486 HandleScope scope(isolate); |
498 DCHECK(args.length() == 2); | 487 DCHECK(args.length() == 2); |
499 CONVERT_ARG_HANDLE_CHECKED(JSFunction, new_target, 0); | 488 CONVERT_ARG_HANDLE_CHECKED(JSFunction, new_target, 0); |
500 CONVERT_ARG_HANDLE_CHECKED(JSFunction, super_constructor, 1); | 489 CONVERT_ARG_HANDLE_CHECKED(JSFunction, super_constructor, 1); |
501 JavaScriptFrameIterator it(isolate); | 490 JavaScriptFrameIterator it(isolate); |
502 | 491 |
503 // Determine the actual arguments passed to the function. | 492 // Determine the actual arguments passed to the function. |
504 int argument_count = 0; | 493 int argument_count = 0; |
505 base::SmartArrayPointer<Handle<Object>> arguments = | 494 base::SmartArrayPointer<Handle<Object>> arguments = |
506 Runtime::GetCallerArguments(isolate, 0, &argument_count); | 495 Runtime::GetCallerArguments(isolate, 0, &argument_count); |
507 | 496 |
508 Handle<Object> result; | 497 Handle<Object> result; |
509 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | 498 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
510 isolate, result, Execution::New(isolate, super_constructor, new_target, | 499 isolate, result, Execution::New(isolate, super_constructor, new_target, |
511 argument_count, arguments.get())); | 500 argument_count, arguments.get())); |
512 | 501 |
513 return *result; | 502 return *result; |
514 } | 503 } |
515 | 504 |
516 } // namespace internal | 505 } // namespace internal |
517 } // namespace v8 | 506 } // namespace v8 |
OLD | NEW |