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 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
651 iterator.Advance(); | 655 iterator.Advance(); |
652 } | 656 } |
653 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); | 657 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); |
654 iterator.Advance(); | 658 iterator.Advance(); |
655 CHECK(iterator.done()); | 659 CHECK(iterator.done()); |
656 } | 660 } |
657 | 661 |
658 } // namespace interpreter | 662 } // namespace interpreter |
659 } // namespace internal | 663 } // namespace internal |
660 } // namespace v8 | 664 } // namespace v8 |
OLD | NEW |