| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 info->function()->name()->IsUtf8EqualTo(CStrVector(FLAG_stop_at))) { | 130 info->function()->name()->IsUtf8EqualTo(CStrVector(FLAG_stop_at))) { |
| 131 __ int3(); | 131 __ int3(); |
| 132 } | 132 } |
| 133 #endif | 133 #endif |
| 134 | 134 |
| 135 // Classic mode functions and builtins need to replace the receiver with the | 135 // Classic mode functions and builtins need to replace the receiver with the |
| 136 // global proxy when called as functions (without an explicit receiver | 136 // global proxy when called as functions (without an explicit receiver |
| 137 // object). | 137 // object). |
| 138 if (info->is_classic_mode() && !info->is_native()) { | 138 if (info->is_classic_mode() && !info->is_native()) { |
| 139 Label ok; | 139 Label ok; |
| 140 __ testq(rcx, rcx); | |
| 141 __ j(zero, &ok, Label::kNear); | |
| 142 | |
| 143 // +1 for return address. | 140 // +1 for return address. |
| 144 StackArgumentsAccessor args(rsp, info->scope()->num_parameters()); | 141 StackArgumentsAccessor args(rsp, info->scope()->num_parameters()); |
| 145 __ movq(rcx, args.GetReceiverOperand()); | 142 __ movq(rcx, args.GetReceiverOperand()); |
| 146 | 143 |
| 147 __ CompareRoot(rcx, Heap::kUndefinedValueRootIndex); | 144 __ CompareRoot(rcx, Heap::kUndefinedValueRootIndex); |
| 148 __ j(not_equal, &ok, Label::kNear); | 145 __ j(not_equal, &ok, Label::kNear); |
| 149 | 146 |
| 150 __ movq(rcx, GlobalObjectOperand()); | 147 __ movq(rcx, GlobalObjectOperand()); |
| 151 __ movq(rcx, FieldOperand(rcx, GlobalObject::kGlobalReceiverOffset)); | 148 __ movq(rcx, FieldOperand(rcx, GlobalObject::kGlobalReceiverOffset)); |
| 152 | 149 |
| (...skipping 3507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3660 | 3657 |
| 3661 Label runtime, done; | 3658 Label runtime, done; |
| 3662 // Check for non-function argument (including proxy). | 3659 // Check for non-function argument (including proxy). |
| 3663 __ JumpIfSmi(rax, &runtime); | 3660 __ JumpIfSmi(rax, &runtime); |
| 3664 __ CmpObjectType(rax, JS_FUNCTION_TYPE, rbx); | 3661 __ CmpObjectType(rax, JS_FUNCTION_TYPE, rbx); |
| 3665 __ j(not_equal, &runtime); | 3662 __ j(not_equal, &runtime); |
| 3666 | 3663 |
| 3667 // InvokeFunction requires the function in rdi. Move it in there. | 3664 // InvokeFunction requires the function in rdi. Move it in there. |
| 3668 __ movq(rdi, result_register()); | 3665 __ movq(rdi, result_register()); |
| 3669 ParameterCount count(arg_count); | 3666 ParameterCount count(arg_count); |
| 3670 __ InvokeFunction(rdi, count, CALL_FUNCTION, | 3667 __ InvokeFunction(rdi, count, CALL_FUNCTION, NullCallWrapper()); |
| 3671 NullCallWrapper(), CALL_AS_FUNCTION); | |
| 3672 __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); | 3668 __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); |
| 3673 __ jmp(&done); | 3669 __ jmp(&done); |
| 3674 | 3670 |
| 3675 __ bind(&runtime); | 3671 __ bind(&runtime); |
| 3676 __ push(rax); | 3672 __ push(rax); |
| 3677 __ CallRuntime(Runtime::kCall, args->length()); | 3673 __ CallRuntime(Runtime::kCall, args->length()); |
| 3678 __ bind(&done); | 3674 __ bind(&done); |
| 3679 | 3675 |
| 3680 context()->Plug(rax); | 3676 context()->Plug(rax); |
| 3681 } | 3677 } |
| (...skipping 1207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4889 | 4885 |
| 4890 ASSERT_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), | 4886 ASSERT_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), |
| 4891 Assembler::target_address_at(call_target_address)); | 4887 Assembler::target_address_at(call_target_address)); |
| 4892 return OSR_AFTER_STACK_CHECK; | 4888 return OSR_AFTER_STACK_CHECK; |
| 4893 } | 4889 } |
| 4894 | 4890 |
| 4895 | 4891 |
| 4896 } } // namespace v8::internal | 4892 } } // namespace v8::internal |
| 4897 | 4893 |
| 4898 #endif // V8_TARGET_ARCH_X64 | 4894 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |