OLD | NEW |
---|---|
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 #if V8_TARGET_ARCH_X64 | 5 #if V8_TARGET_ARCH_X64 |
6 | 6 |
7 #include "src/bootstrapper.h" | 7 #include "src/bootstrapper.h" |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
10 #include "src/ic/handler-compiler.h" | 10 #include "src/ic/handler-compiler.h" |
(...skipping 2090 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2101 __ movp(rax, args.GetReceiverOperand()); | 2101 __ movp(rax, args.GetReceiverOperand()); |
2102 | 2102 |
2103 __ JumpIfSmi(rax, &wrap); | 2103 __ JumpIfSmi(rax, &wrap); |
2104 | 2104 |
2105 __ CmpObjectType(rax, FIRST_SPEC_OBJECT_TYPE, rcx); | 2105 __ CmpObjectType(rax, FIRST_SPEC_OBJECT_TYPE, rcx); |
2106 __ j(below, &wrap); | 2106 __ j(below, &wrap); |
2107 | 2107 |
2108 __ bind(&cont); | 2108 __ bind(&cont); |
2109 } | 2109 } |
2110 | 2110 |
2111 { | |
Benedikt Meurer
2015/10/22 11:08:05
You need to do the same in the CallFunctionStub.
| |
2112 Label non_classConstructor; | |
2113 __ movp(rdx, FieldOperand(rdi, JSFunction::kSharedFunctionInfoOffset)); | |
2114 // Check whether the current function is a classConstructor | |
2115 __ testb(FieldOperand(rdx, SharedFunctionInfo::kIsArrowByteOffset), | |
2116 Immediate(FunctionKind::kClassConstructor)); | |
2117 __ 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
| |
2118 // In the case of a classConstructor, let the CallFunction builtin handle | |
2119 // throwing a TypeError. | |
2120 __ Jump(masm->isolate()->builtins()->CallFunction(), | |
2121 RelocInfo::CODE_TARGET); | |
2122 __ bind(&non_classConstructor); | |
2123 } | |
2124 | |
2111 __ InvokeFunction(rdi, actual, JUMP_FUNCTION, NullCallWrapper()); | 2125 __ InvokeFunction(rdi, actual, JUMP_FUNCTION, NullCallWrapper()); |
Benedikt Meurer
2015/10/22 11:08:05
Please check if it's viable to use __Jump(builtin-
| |
2112 | 2126 |
2113 __ bind(&slow); | 2127 __ bind(&slow); |
2114 EmitSlowCase(masm, &args, argc); | 2128 EmitSlowCase(masm, &args, argc); |
2115 | 2129 |
2116 if (CallAsMethod()) { | 2130 if (CallAsMethod()) { |
2117 __ bind(&wrap); | 2131 __ bind(&wrap); |
2118 EmitWrapCase(masm, &args, &cont); | 2132 EmitWrapCase(masm, &args, &cont); |
2119 } | 2133 } |
2120 | 2134 |
2121 __ bind(&extra_checks_or_miss); | 2135 __ bind(&extra_checks_or_miss); |
(...skipping 3473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5595 kStackSpace, nullptr, return_value_operand, NULL); | 5609 kStackSpace, nullptr, return_value_operand, NULL); |
5596 } | 5610 } |
5597 | 5611 |
5598 | 5612 |
5599 #undef __ | 5613 #undef __ |
5600 | 5614 |
5601 } // namespace internal | 5615 } // namespace internal |
5602 } // namespace v8 | 5616 } // namespace v8 |
5603 | 5617 |
5604 #endif // V8_TARGET_ARCH_X64 | 5618 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |