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