Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(504)

Side by Side Diff: src/runtime/runtime-classes.cc

Issue 1453113002: Handle StepIn for constructors through PrepareStep just like for regular calls (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add ports Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/runtime/runtime.h ('k') | src/runtime/runtime-debug.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « src/runtime/runtime.h ('k') | src/runtime/runtime-debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698