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

Side by Side Diff: src/arm64/lithium-arm64.cc

Issue 528993002: First step to cleanup the power-of-2 mess. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: clang-format Created 6 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/arm64/assembler-arm64.cc ('k') | src/arm64/lithium-codegen-arm64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "src/arm64/lithium-codegen-arm64.h" 7 #include "src/arm64/lithium-codegen-arm64.h"
8 #include "src/hydrogen-osr.h" 8 #include "src/hydrogen-osr.h"
9 #include "src/lithium-inl.h" 9 #include "src/lithium-inl.h"
10 10
(...skipping 1919 matching lines...) Expand 10 before | Expand all | Expand 10 after
1930 // 2^n, -(2^n) 1930 // 2^n, -(2^n)
1931 // Without support for overflow detection: 1931 // Without support for overflow detection:
1932 // 2^n + 1, -(2^n - 1) 1932 // 2^n + 1, -(2^n - 1)
1933 if (most_const->IsConstant()) { 1933 if (most_const->IsConstant()) {
1934 int32_t constant = HConstant::cast(most_const)->Integer32Value(); 1934 int32_t constant = HConstant::cast(most_const)->Integer32Value();
1935 bool small_constant = (constant >= -1) && (constant <= 2); 1935 bool small_constant = (constant >= -1) && (constant <= 2);
1936 bool end_range_constant = (constant <= -kMaxInt) || (constant == kMaxInt); 1936 bool end_range_constant = (constant <= -kMaxInt) || (constant == kMaxInt);
1937 int32_t constant_abs = Abs(constant); 1937 int32_t constant_abs = Abs(constant);
1938 1938
1939 if (!end_range_constant && 1939 if (!end_range_constant &&
1940 (small_constant || 1940 (small_constant || (base::bits::IsPowerOfTwo32(constant_abs)) ||
1941 (IsPowerOf2(constant_abs)) || 1941 (!can_overflow && (base::bits::IsPowerOfTwo32(constant_abs + 1) ||
1942 (!can_overflow && (IsPowerOf2(constant_abs + 1) || 1942 base::bits::IsPowerOfTwo32(constant_abs - 1))))) {
1943 IsPowerOf2(constant_abs - 1))))) {
1944 LConstantOperand* right = UseConstant(most_const); 1943 LConstantOperand* right = UseConstant(most_const);
1945 bool need_register = IsPowerOf2(constant_abs) && !small_constant; 1944 bool need_register =
1945 base::bits::IsPowerOfTwo32(constant_abs) && !small_constant;
1946 LOperand* left = need_register ? UseRegister(least_const) 1946 LOperand* left = need_register ? UseRegister(least_const)
1947 : UseRegisterAtStart(least_const); 1947 : UseRegisterAtStart(least_const);
1948 LInstruction* result = 1948 LInstruction* result =
1949 DefineAsRegister(new(zone()) LMulConstIS(left, right)); 1949 DefineAsRegister(new(zone()) LMulConstIS(left, right));
1950 if ((bailout_on_minus_zero && constant <= 0) || can_overflow) { 1950 if ((bailout_on_minus_zero && constant <= 0) || can_overflow) {
1951 result = AssignEnvironment(result); 1951 result = AssignEnvironment(result);
1952 } 1952 }
1953 return result; 1953 return result;
1954 } 1954 }
1955 } 1955 }
(...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after
2737 HAllocateBlockContext* instr) { 2737 HAllocateBlockContext* instr) {
2738 LOperand* context = UseFixed(instr->context(), cp); 2738 LOperand* context = UseFixed(instr->context(), cp);
2739 LOperand* function = UseRegisterAtStart(instr->function()); 2739 LOperand* function = UseRegisterAtStart(instr->function());
2740 LAllocateBlockContext* result = 2740 LAllocateBlockContext* result =
2741 new(zone()) LAllocateBlockContext(context, function); 2741 new(zone()) LAllocateBlockContext(context, function);
2742 return MarkAsCall(DefineFixed(result, cp), instr); 2742 return MarkAsCall(DefineFixed(result, cp), instr);
2743 } 2743 }
2744 2744
2745 2745
2746 } } // namespace v8::internal 2746 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm64/assembler-arm64.cc ('k') | src/arm64/lithium-codegen-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698