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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_X64 | 7 #if V8_TARGET_ARCH_X64 |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 3983 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3994 __ fstp_d(Operand(rsp, 0)); | 3994 __ fstp_d(Operand(rsp, 0)); |
3995 __ movsd(input_reg, Operand(rsp, 0)); | 3995 __ movsd(input_reg, Operand(rsp, 0)); |
3996 __ addp(rsp, Immediate(kDoubleSize)); | 3996 __ addp(rsp, Immediate(kDoubleSize)); |
3997 __ bind(&done); | 3997 __ bind(&done); |
3998 } | 3998 } |
3999 | 3999 |
4000 | 4000 |
4001 void LCodeGen::DoMathClz32(LMathClz32* instr) { | 4001 void LCodeGen::DoMathClz32(LMathClz32* instr) { |
4002 Register input = ToRegister(instr->value()); | 4002 Register input = ToRegister(instr->value()); |
4003 Register result = ToRegister(instr->result()); | 4003 Register result = ToRegister(instr->result()); |
4004 Label not_zero_input; | |
4005 __ bsrl(result, input); | |
4006 | 4004 |
4007 __ j(not_zero, ¬_zero_input); | 4005 __ Lzcntl(result, input); |
4008 __ Set(result, 63); // 63^31 == 32 | |
4009 | |
4010 __ bind(¬_zero_input); | |
4011 __ xorl(result, Immediate(31)); // for x in [0..31], 31^x == 31-x. | |
4012 } | 4006 } |
4013 | 4007 |
4014 | 4008 |
4015 void LCodeGen::DoInvokeFunction(LInvokeFunction* instr) { | 4009 void LCodeGen::DoInvokeFunction(LInvokeFunction* instr) { |
4016 DCHECK(ToRegister(instr->context()).is(rsi)); | 4010 DCHECK(ToRegister(instr->context()).is(rsi)); |
4017 DCHECK(ToRegister(instr->function()).is(rdi)); | 4011 DCHECK(ToRegister(instr->function()).is(rdi)); |
4018 DCHECK(instr->HasPointerMap()); | 4012 DCHECK(instr->HasPointerMap()); |
4019 | 4013 |
4020 Handle<JSFunction> known_function = instr->hydrogen()->known_function(); | 4014 Handle<JSFunction> known_function = instr->hydrogen()->known_function(); |
4021 if (known_function.is_null()) { | 4015 if (known_function.is_null()) { |
(...skipping 1917 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5939 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5933 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
5940 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5934 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5941 } | 5935 } |
5942 | 5936 |
5943 | 5937 |
5944 #undef __ | 5938 #undef __ |
5945 | 5939 |
5946 } } // namespace v8::internal | 5940 } } // namespace v8::internal |
5947 | 5941 |
5948 #endif // V8_TARGET_ARCH_X64 | 5942 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |