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

Unified Diff: src/x64/builtins-x64.cc

Issue 1415783006: Revert of [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, 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/runtime/runtime-function.cc ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/builtins-x64.cc
diff --git a/src/x64/builtins-x64.cc b/src/x64/builtins-x64.cc
index 6d279434f8f7468278c0e53b67ad333f5ffff15b..4e26be9c90844f873dd39c7af3574e4b593c5537 100644
--- a/src/x64/builtins-x64.cc
+++ b/src/x64/builtins-x64.cc
@@ -1696,7 +1696,6 @@
// static
void Builtins::Generate_CallFunction(MacroAssembler* masm) {
- // ES6 section 9.2.1 [[Call]] ( thisArgument, argumentsList)
// ----------- S t a t e -------------
// -- rax : the number of arguments (not including the receiver)
// -- rdi : the function to call (checked to be a JSFunction)
@@ -1705,27 +1704,16 @@
Label convert, convert_global_proxy, convert_to_object, done_convert;
StackArgumentsAccessor args(rsp, rax);
__ AssertFunction(rdi);
- __ movp(rdx, FieldOperand(rdi, JSFunction::kSharedFunctionInfoOffset));
- {
- Label non_class_constructor;
- // Check whether the current function is a classConstructor
- __ testb(FieldOperand(rdx, SharedFunctionInfo::kFunctionKindByteOffset),
- Immediate(SharedFunctionInfo::kClassConstructorBitsWithinByte));
- __ j(zero, &non_class_constructor, Label::kNear);
- // Step: 2, If we call a classConstructor Function throw a TypeError.
- {
- FrameScope frame(masm, StackFrame::INTERNAL);
- __ CallRuntime(Runtime::kThrowConstructorNonCallableError, 0);
- }
- __ bind(&non_class_constructor);
- }
-
+ // TODO(bmeurer): Throw a TypeError if function's [[FunctionKind]] internal
+ // slot is "classConstructor".
// Enter the context of the function; ToObject has to run in the function
// context, and we also need to take the global proxy from the function
// context in case of conversion.
+ // See ES6 section 9.2.1 [[Call]] ( thisArgument, argumentsList)
STATIC_ASSERT(SharedFunctionInfo::kNativeByteOffset ==
SharedFunctionInfo::kStrictModeByteOffset);
__ movp(rsi, FieldOperand(rdi, JSFunction::kContextOffset));
+ __ movp(rdx, FieldOperand(rdi, JSFunction::kSharedFunctionInfoOffset));
// We need to convert the receiver for non-native sloppy mode functions.
__ testb(FieldOperand(rdx, SharedFunctionInfo::kNativeByteOffset),
Immediate((1 << SharedFunctionInfo::kNativeBitWithinByte) |
« no previous file with comments | « src/runtime/runtime-function.cc ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698