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

Side by Side Diff: src/code-stub-assembler.h

Issue 2151163002: [stubs] Improve code generation for ToBoolean. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: REBASE. Fix redness. Created 4 years, 5 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
« no previous file with comments | « src/code-factory.cc ('k') | src/code-stub-assembler.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 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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 #ifndef V8_CODE_STUB_ASSEMBLER_H_ 5 #ifndef V8_CODE_STUB_ASSEMBLER_H_
6 #define V8_CODE_STUB_ASSEMBLER_H_ 6 #define V8_CODE_STUB_ASSEMBLER_H_
7 7
8 #include <functional> 8 #include <functional>
9 9
10 #include "src/compiler/code-assembler.h" 10 #include "src/compiler/code-assembler.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 compiler::Node* InnerAllocate(compiler::Node* previous, 92 compiler::Node* InnerAllocate(compiler::Node* previous,
93 compiler::Node* offset); 93 compiler::Node* offset);
94 94
95 void Assert(compiler::Node* condition); 95 void Assert(compiler::Node* condition);
96 96
97 // Check a value for smi-ness 97 // Check a value for smi-ness
98 compiler::Node* WordIsSmi(compiler::Node* a); 98 compiler::Node* WordIsSmi(compiler::Node* a);
99 // Check that the value is a positive smi. 99 // Check that the value is a positive smi.
100 compiler::Node* WordIsPositiveSmi(compiler::Node* a); 100 compiler::Node* WordIsPositiveSmi(compiler::Node* a);
101 101
102 void BranchIfSmiEqual(compiler::Node* a, compiler::Node* b, Label* if_true,
103 Label* if_false) {
104 BranchIf(SmiEqual(a, b), if_true, if_false);
105 }
106
102 void BranchIfSmiLessThan(compiler::Node* a, compiler::Node* b, Label* if_true, 107 void BranchIfSmiLessThan(compiler::Node* a, compiler::Node* b, Label* if_true,
103 Label* if_false) { 108 Label* if_false) {
104 BranchIf(SmiLessThan(a, b), if_true, if_false); 109 BranchIf(SmiLessThan(a, b), if_true, if_false);
105 } 110 }
106 111
107 void BranchIfSmiLessThanOrEqual(compiler::Node* a, compiler::Node* b, 112 void BranchIfSmiLessThanOrEqual(compiler::Node* a, compiler::Node* b,
108 Label* if_true, Label* if_false) { 113 Label* if_true, Label* if_false) {
109 BranchIf(SmiLessThanOrEqual(a, b), if_true, if_false); 114 BranchIf(SmiLessThanOrEqual(a, b), if_true, if_false);
110 } 115 }
111 116
112 void BranchIfFloat64IsNaN(compiler::Node* value, Label* if_true, 117 void BranchIfFloat64IsNaN(compiler::Node* value, Label* if_true,
113 Label* if_false) { 118 Label* if_false) {
114 BranchIfFloat64Equal(value, value, if_false, if_true); 119 BranchIfFloat64Equal(value, value, if_false, if_true);
115 } 120 }
116 121
122 // Branches to {if_true} if ToBoolean applied to {value} yields true,
123 // otherwise goes to {if_false}.
124 void BranchIfToBooleanIsTrue(compiler::Node* value, Label* if_true,
125 Label* if_false);
126
117 // Load value from current frame by given offset in bytes. 127 // Load value from current frame by given offset in bytes.
118 compiler::Node* LoadFromFrame(int offset, 128 compiler::Node* LoadFromFrame(int offset,
119 MachineType rep = MachineType::AnyTagged()); 129 MachineType rep = MachineType::AnyTagged());
120 // Load value from current parent frame by given offset in bytes. 130 // Load value from current parent frame by given offset in bytes.
121 compiler::Node* LoadFromParentFrame( 131 compiler::Node* LoadFromParentFrame(
122 int offset, MachineType rep = MachineType::AnyTagged()); 132 int offset, MachineType rep = MachineType::AnyTagged());
123 133
124 // Load an object pointer from a buffer that isn't in the heap. 134 // Load an object pointer from a buffer that isn't in the heap.
125 compiler::Node* LoadBufferObject(compiler::Node* buffer, int offset, 135 compiler::Node* LoadBufferObject(compiler::Node* buffer, int offset,
126 MachineType rep = MachineType::AnyTagged()); 136 MachineType rep = MachineType::AnyTagged());
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 AllocationFlags flags, 487 AllocationFlags flags,
478 compiler::Node* top_adddress, 488 compiler::Node* top_adddress,
479 compiler::Node* limit_address); 489 compiler::Node* limit_address);
480 490
481 static const int kElementLoopUnrollThreshold = 8; 491 static const int kElementLoopUnrollThreshold = 8;
482 }; 492 };
483 493
484 } // namespace internal 494 } // namespace internal
485 } // namespace v8 495 } // namespace v8
486 #endif // V8_CODE_STUB_ASSEMBLER_H_ 496 #endif // V8_CODE_STUB_ASSEMBLER_H_
OLDNEW
« no previous file with comments | « src/code-factory.cc ('k') | src/code-stub-assembler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698