OLD | NEW |
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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/interpreter/bytecode-array-builder.h" | 7 #include "src/interpreter/bytecode-array-builder.h" |
8 #include "src/interpreter/bytecode-array-iterator.h" | 8 #include "src/interpreter/bytecode-array-iterator.h" |
9 #include "src/interpreter/bytecode-register-allocator.h" | 9 #include "src/interpreter/bytecode-register-allocator.h" |
10 #include "test/unittests/test-utils.h" | 10 #include "test/unittests/test-utils.h" |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 | 156 |
157 // Emit cast operator invocations. | 157 // Emit cast operator invocations. |
158 builder.CastAccumulatorToNumber() | 158 builder.CastAccumulatorToNumber() |
159 .CastAccumulatorToJSObject() | 159 .CastAccumulatorToJSObject() |
160 .CastAccumulatorToName(); | 160 .CastAccumulatorToName(); |
161 | 161 |
162 // Emit control flow. Return must be the last instruction. | 162 // Emit control flow. Return must be the last instruction. |
163 BytecodeLabel start; | 163 BytecodeLabel start; |
164 builder.Bind(&start); | 164 builder.Bind(&start); |
165 // Short jumps with Imm8 operands | 165 // Short jumps with Imm8 operands |
166 builder.Jump(&start).JumpIfNull(&start).JumpIfUndefined(&start); | 166 builder.Jump(&start) |
| 167 .JumpIfNull(&start) |
| 168 .JumpIfUndefined(&start) |
| 169 .JumpIfHole(&start) |
| 170 .JumpIfNotHole(&start); |
167 // Perform an operation that returns boolean value to | 171 // Perform an operation that returns boolean value to |
168 // generate JumpIfTrue/False | 172 // generate JumpIfTrue/False |
169 builder.CompareOperation(Token::Value::EQ, reg, Strength::WEAK) | 173 builder.CompareOperation(Token::Value::EQ, reg, Strength::WEAK) |
170 .JumpIfTrue(&start) | 174 .JumpIfTrue(&start) |
171 .CompareOperation(Token::Value::EQ, reg, Strength::WEAK) | 175 .CompareOperation(Token::Value::EQ, reg, Strength::WEAK) |
172 .JumpIfFalse(&start); | 176 .JumpIfFalse(&start); |
173 // Perform an operation that returns a non-boolean operation to | 177 // Perform an operation that returns a non-boolean operation to |
174 // generate JumpIfToBooleanTrue/False. | 178 // generate JumpIfToBooleanTrue/False. |
175 builder.BinaryOperation(Token::Value::ADD, reg, Strength::WEAK) | 179 builder.BinaryOperation(Token::Value::ADD, reg, Strength::WEAK) |
176 .JumpIfTrue(&start) | 180 .JumpIfTrue(&start) |
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
656 iterator.Advance(); | 660 iterator.Advance(); |
657 } | 661 } |
658 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); | 662 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); |
659 iterator.Advance(); | 663 iterator.Advance(); |
660 CHECK(iterator.done()); | 664 CHECK(iterator.done()); |
661 } | 665 } |
662 | 666 |
663 } // namespace interpreter | 667 } // namespace interpreter |
664 } // namespace internal | 668 } // namespace internal |
665 } // namespace v8 | 669 } // namespace v8 |
OLD | NEW |