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 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 .JumpIfTrue(&start) | 266 .JumpIfTrue(&start) |
267 .CompareOperation(Token::Value::EQ, reg, Strength::WEAK) | 267 .CompareOperation(Token::Value::EQ, reg, Strength::WEAK) |
268 .JumpIfFalse(&start); | 268 .JumpIfFalse(&start); |
269 // Perform an operation that returns a non-boolean operation to | 269 // Perform an operation that returns a non-boolean operation to |
270 // generate JumpIfToBooleanTrue/False. | 270 // generate JumpIfToBooleanTrue/False. |
271 builder.BinaryOperation(Token::Value::ADD, reg, Strength::WEAK) | 271 builder.BinaryOperation(Token::Value::ADD, reg, Strength::WEAK) |
272 .JumpIfTrue(&start) | 272 .JumpIfTrue(&start) |
273 .BinaryOperation(Token::Value::ADD, reg, Strength::WEAK) | 273 .BinaryOperation(Token::Value::ADD, reg, Strength::WEAK) |
274 .JumpIfFalse(&start); | 274 .JumpIfFalse(&start); |
275 | 275 |
| 276 builder.Debugger(); |
| 277 |
276 builder.Return(); | 278 builder.Return(); |
277 | 279 |
278 // Generate BytecodeArray. | 280 // Generate BytecodeArray. |
279 Handle<BytecodeArray> the_array = builder.ToBytecodeArray(); | 281 Handle<BytecodeArray> the_array = builder.ToBytecodeArray(); |
280 CHECK_EQ(the_array->frame_size(), | 282 CHECK_EQ(the_array->frame_size(), |
281 (builder.fixed_and_temporary_register_count() + | 283 (builder.fixed_and_temporary_register_count() + |
282 builder.translation_register_count()) * | 284 builder.translation_register_count()) * |
283 kPointerSize); | 285 kPointerSize); |
284 | 286 |
285 // Build scorecard of bytecodes encountered in the BytecodeArray. | 287 // Build scorecard of bytecodes encountered in the BytecodeArray. |
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
649 iterator.Advance(); | 651 iterator.Advance(); |
650 } | 652 } |
651 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); | 653 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); |
652 iterator.Advance(); | 654 iterator.Advance(); |
653 CHECK(iterator.done()); | 655 CHECK(iterator.done()); |
654 } | 656 } |
655 | 657 |
656 } // namespace interpreter | 658 } // namespace interpreter |
657 } // namespace internal | 659 } // namespace internal |
658 } // namespace v8 | 660 } // namespace v8 |
OLD | NEW |