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

Unified Diff: src/x64/code-stubs-x64.cc

Issue 1418623007: [runtime] Fix ES6 9.2.1 [[Call]] when encountering a classConstructor. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 months 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 side-by-side diff with in-line comments
Download patch
Index: src/x64/code-stubs-x64.cc
diff --git a/src/x64/code-stubs-x64.cc b/src/x64/code-stubs-x64.cc
index 481e100c77361db3b333794d1e82e34e5f19aa32..2e2095f145d0539aa2996a66b02b619197178dda 100644
--- a/src/x64/code-stubs-x64.cc
+++ b/src/x64/code-stubs-x64.cc
@@ -2108,6 +2108,20 @@ void CallICStub::Generate(MacroAssembler* masm) {
__ bind(&cont);
}
+ {
Benedikt Meurer 2015/10/22 11:08:05 You need to do the same in the CallFunctionStub.
+ Label non_classConstructor;
+ __ movp(rdx, FieldOperand(rdi, JSFunction::kSharedFunctionInfoOffset));
+ // Check whether the current function is a classConstructor
+ __ testb(FieldOperand(rdx, SharedFunctionInfo::kIsArrowByteOffset),
+ Immediate(FunctionKind::kClassConstructor));
+ __ j(zero, &non_classConstructor);
Benedikt Meurer 2015/10/22 11:08:05 You can use Label::kNear here.
Camillo Bruni 2015/11/03 16:05:27 done
+ // In the case of a classConstructor, let the CallFunction builtin handle
+ // throwing a TypeError.
+ __ Jump(masm->isolate()->builtins()->CallFunction(),
+ RelocInfo::CODE_TARGET);
+ __ bind(&non_classConstructor);
+ }
+
__ InvokeFunction(rdi, actual, JUMP_FUNCTION, NullCallWrapper());
Benedikt Meurer 2015/10/22 11:08:05 Please check if it's viable to use __Jump(builtin-
__ bind(&slow);

Powered by Google App Engine
This is Rietveld 408576698