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

Side by Side Diff: src/interpreter/bytecodes.cc

Issue 1697473002: [interpreter] Add bytecodes for JumpIfNotHole with constant (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 4 years, 10 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/interpreter/bytecodes.h ('k') | src/interpreter/interpreter.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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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/interpreter/bytecodes.h" 5 #include "src/interpreter/bytecodes.h"
6 6
7 #include "src/frames.h" 7 #include "src/frames.h"
8 #include "src/interpreter/bytecode-traits.h" 8 #include "src/interpreter/bytecode-traits.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 return OperandSize::kNone; 188 return OperandSize::kNone;
189 } 189 }
190 190
191 191
192 // static 192 // static
193 bool Bytecodes::IsConditionalJumpImmediate(Bytecode bytecode) { 193 bool Bytecodes::IsConditionalJumpImmediate(Bytecode bytecode) {
194 return bytecode == Bytecode::kJumpIfTrue || 194 return bytecode == Bytecode::kJumpIfTrue ||
195 bytecode == Bytecode::kJumpIfFalse || 195 bytecode == Bytecode::kJumpIfFalse ||
196 bytecode == Bytecode::kJumpIfToBooleanTrue || 196 bytecode == Bytecode::kJumpIfToBooleanTrue ||
197 bytecode == Bytecode::kJumpIfToBooleanFalse || 197 bytecode == Bytecode::kJumpIfToBooleanFalse ||
198 bytecode == Bytecode::kJumpIfNotHole ||
198 bytecode == Bytecode::kJumpIfNull || 199 bytecode == Bytecode::kJumpIfNull ||
199 bytecode == Bytecode::kJumpIfUndefined || 200 bytecode == Bytecode::kJumpIfUndefined;
200 bytecode == Bytecode::kJumpIfHole ||
201 bytecode == Bytecode::kJumpIfNotHole;
202 } 201 }
203 202
204 203
205 // static 204 // static
206 bool Bytecodes::IsConditionalJumpConstant(Bytecode bytecode) { 205 bool Bytecodes::IsConditionalJumpConstant(Bytecode bytecode) {
207 return bytecode == Bytecode::kJumpIfTrueConstant || 206 return bytecode == Bytecode::kJumpIfTrueConstant ||
208 bytecode == Bytecode::kJumpIfFalseConstant || 207 bytecode == Bytecode::kJumpIfFalseConstant ||
209 bytecode == Bytecode::kJumpIfToBooleanTrueConstant || 208 bytecode == Bytecode::kJumpIfToBooleanTrueConstant ||
210 bytecode == Bytecode::kJumpIfToBooleanFalseConstant || 209 bytecode == Bytecode::kJumpIfToBooleanFalseConstant ||
210 bytecode == Bytecode::kJumpIfNotHoleConstant ||
211 bytecode == Bytecode::kJumpIfNullConstant || 211 bytecode == Bytecode::kJumpIfNullConstant ||
212 bytecode == Bytecode::kJumpIfUndefinedConstant; 212 bytecode == Bytecode::kJumpIfUndefinedConstant;
213 } 213 }
214 214
215 215
216 // static 216 // static
217 bool Bytecodes::IsConditionalJumpConstantWide(Bytecode bytecode) { 217 bool Bytecodes::IsConditionalJumpConstantWide(Bytecode bytecode) {
218 return bytecode == Bytecode::kJumpIfTrueConstantWide || 218 return bytecode == Bytecode::kJumpIfTrueConstantWide ||
219 bytecode == Bytecode::kJumpIfFalseConstantWide || 219 bytecode == Bytecode::kJumpIfFalseConstantWide ||
220 bytecode == Bytecode::kJumpIfToBooleanTrueConstantWide || 220 bytecode == Bytecode::kJumpIfToBooleanTrueConstantWide ||
221 bytecode == Bytecode::kJumpIfToBooleanFalseConstantWide || 221 bytecode == Bytecode::kJumpIfToBooleanFalseConstantWide ||
222 bytecode == Bytecode::kJumpIfNotHoleConstantWide ||
222 bytecode == Bytecode::kJumpIfNullConstantWide || 223 bytecode == Bytecode::kJumpIfNullConstantWide ||
223 bytecode == Bytecode::kJumpIfUndefinedConstantWide; 224 bytecode == Bytecode::kJumpIfUndefinedConstantWide;
224 } 225 }
225 226
226 227
227 // static 228 // static
228 bool Bytecodes::IsConditionalJump(Bytecode bytecode) { 229 bool Bytecodes::IsConditionalJump(Bytecode bytecode) {
229 return IsConditionalJumpImmediate(bytecode) || 230 return IsConditionalJumpImmediate(bytecode) ||
230 IsConditionalJumpConstant(bytecode) || 231 IsConditionalJumpConstant(bytecode) ||
231 IsConditionalJumpConstantWide(bytecode); 232 IsConditionalJumpConstantWide(bytecode);
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
598 } else { 599 } else {
599 std::ostringstream s; 600 std::ostringstream s;
600 s << "r" << index(); 601 s << "r" << index();
601 return s.str(); 602 return s.str();
602 } 603 }
603 } 604 }
604 605
605 } // namespace interpreter 606 } // namespace interpreter
606 } // namespace internal 607 } // namespace internal
607 } // namespace v8 608 } // namespace v8
OLDNEW
« no previous file with comments | « src/interpreter/bytecodes.h ('k') | src/interpreter/interpreter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698