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

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

Issue 2504553003: [es6] Perform the IsConstructor test in GetSuperConstructor. (Closed)
Patch Set: Convert GetSuperConstructor to a new interpreter bytecode Created 4 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
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 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 RETURN_RESULT_OR_FAILURE( 396 RETURN_RESULT_OR_FAILURE(
397 isolate, 397 isolate,
398 StoreKeyedToSuper(isolate, home_object, receiver, key, value, SLOPPY)); 398 StoreKeyedToSuper(isolate, home_object, receiver, key, value, SLOPPY));
399 } 399 }
400 400
401 401
402 RUNTIME_FUNCTION(Runtime_GetSuperConstructor) { 402 RUNTIME_FUNCTION(Runtime_GetSuperConstructor) {
403 SealHandleScope shs(isolate); 403 SealHandleScope shs(isolate);
404 DCHECK_EQ(1, args.length()); 404 DCHECK_EQ(1, args.length());
405 CONVERT_ARG_CHECKED(JSFunction, active_function, 0); 405 CONVERT_ARG_CHECKED(JSFunction, active_function, 0);
406 return active_function->map()->prototype(); 406 Object* prototype = active_function->map()->prototype();
407 if (!prototype->IsConstructor()) {
408 return Runtime_ThrowConstructedNonConstructable(1, &prototype, isolate);
Benedikt Meurer 2016/11/23 04:51:00 Please don't call other runtime functions this way
409 }
410 return prototype;
407 } 411 }
408 412
409 } // namespace internal 413 } // namespace internal
410 } // namespace v8 414 } // namespace v8
OLDNEW
« src/interpreter/interpreter.cc ('K') | « src/interpreter/interpreter.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698