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

Side by Side Diff: src/compiler/change-lowering.cc

Issue 697663003: [turbofan] Also optimize unsigned division by constant. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Slight improvement Created 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/compiler/change-lowering.h" 5 #include "src/compiler/change-lowering.h"
6 6
7 #include "src/compiler/js-graph.h" 7 #include "src/compiler/js-graph.h"
8 #include "src/compiler/linkage.h" 8 #include "src/compiler/linkage.h"
9 #include "src/compiler/machine-operator.h" 9 #include "src/compiler/machine-operator.h"
10 10
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 STATIC_ASSERT(HeapNumber::kValueOffset % kPointerSize == 0); 46 STATIC_ASSERT(HeapNumber::kValueOffset % kPointerSize == 0);
47 const int heap_number_value_offset = 47 const int heap_number_value_offset =
48 ((HeapNumber::kValueOffset / kPointerSize) * (machine()->Is64() ? 8 : 4)); 48 ((HeapNumber::kValueOffset / kPointerSize) * (machine()->Is64() ? 8 : 4));
49 return jsgraph()->IntPtrConstant(heap_number_value_offset - kHeapObjectTag); 49 return jsgraph()->IntPtrConstant(heap_number_value_offset - kHeapObjectTag);
50 } 50 }
51 51
52 52
53 Node* ChangeLowering::SmiMaxValueConstant() { 53 Node* ChangeLowering::SmiMaxValueConstant() {
54 const int smi_value_size = machine()->Is32() ? SmiTagging<4>::SmiValueSize() 54 const int smi_value_size = machine()->Is32() ? SmiTagging<4>::SmiValueSize()
55 : SmiTagging<8>::SmiValueSize(); 55 : SmiTagging<8>::SmiValueSize();
56 return jsgraph()->IntPtrConstant( 56 return jsgraph()->Int32Constant(
57 -(static_cast<int>(0xffffffffu << (smi_value_size - 1)) + 1)); 57 -(static_cast<int>(0xffffffffu << (smi_value_size - 1)) + 1));
58 } 58 }
59 59
60 60
61 Node* ChangeLowering::SmiShiftBitsConstant() { 61 Node* ChangeLowering::SmiShiftBitsConstant() {
62 const int smi_shift_size = machine()->Is32() ? SmiTagging<4>::SmiShiftSize() 62 const int smi_shift_size = machine()->Is32() ? SmiTagging<4>::SmiShiftSize()
63 : SmiTagging<8>::SmiShiftSize(); 63 : SmiTagging<8>::SmiShiftSize();
64 return jsgraph()->IntPtrConstant(smi_shift_size + kSmiTagSize); 64 return jsgraph()->IntPtrConstant(smi_shift_size + kSmiTagSize);
65 } 65 }
66 66
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 } 250 }
251 251
252 252
253 MachineOperatorBuilder* ChangeLowering::machine() const { 253 MachineOperatorBuilder* ChangeLowering::machine() const {
254 return jsgraph()->machine(); 254 return jsgraph()->machine();
255 } 255 }
256 256
257 } // namespace compiler 257 } // namespace compiler
258 } // namespace internal 258 } // namespace internal
259 } // namespace v8 259 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/arm64/instruction-selector-arm64.cc ('k') | src/compiler/ia32/code-generator-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698