| 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 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 .JumpIfTrue(&start) | 282 .JumpIfTrue(&start) |
| 283 .CompareOperation(Token::Value::EQ, reg) | 283 .CompareOperation(Token::Value::EQ, reg) |
| 284 .JumpIfFalse(&start); | 284 .JumpIfFalse(&start); |
| 285 // Perform an operation that returns a non-boolean operation to | 285 // Perform an operation that returns a non-boolean operation to |
| 286 // generate JumpIfToBooleanTrue/False. | 286 // generate JumpIfToBooleanTrue/False. |
| 287 builder.BinaryOperation(Token::Value::ADD, reg) | 287 builder.BinaryOperation(Token::Value::ADD, reg) |
| 288 .JumpIfTrue(&start) | 288 .JumpIfTrue(&start) |
| 289 .BinaryOperation(Token::Value::ADD, reg) | 289 .BinaryOperation(Token::Value::ADD, reg) |
| 290 .JumpIfFalse(&start); | 290 .JumpIfFalse(&start); |
| 291 | 291 |
| 292 // Intrinsics handled by the interpreter. |
| 293 builder.CallRuntime(Runtime::kInlineIsArray, reg, 1) |
| 294 .CallRuntime(Runtime::kInlineIsArray, wide, 1); |
| 295 |
| 292 builder.Debugger(); | 296 builder.Debugger(); |
| 293 for (size_t i = 0; i < arraysize(end); i++) { | 297 for (size_t i = 0; i < arraysize(end); i++) { |
| 294 builder.Bind(&end[i]); | 298 builder.Bind(&end[i]); |
| 295 } | 299 } |
| 296 builder.Return(); | 300 builder.Return(); |
| 297 | 301 |
| 298 // Generate BytecodeArray. | 302 // Generate BytecodeArray. |
| 299 Handle<BytecodeArray> the_array = builder.ToBytecodeArray(); | 303 Handle<BytecodeArray> the_array = builder.ToBytecodeArray(); |
| 300 CHECK_EQ(the_array->frame_size(), | 304 CHECK_EQ(the_array->frame_size(), |
| 301 builder.fixed_and_temporary_register_count() * kPointerSize); | 305 builder.fixed_and_temporary_register_count() * kPointerSize); |
| (...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 777 static_cast<size_t>(kMaxUInt16)) == OperandSize::kShort); | 781 static_cast<size_t>(kMaxUInt16)) == OperandSize::kShort); |
| 778 CHECK(BytecodeArrayBuilder::SizeForUnsignedOperand( | 782 CHECK(BytecodeArrayBuilder::SizeForUnsignedOperand( |
| 779 static_cast<size_t>(kMaxUInt16 + 1)) == OperandSize::kQuad); | 783 static_cast<size_t>(kMaxUInt16 + 1)) == OperandSize::kQuad); |
| 780 CHECK(BytecodeArrayBuilder::SizeForUnsignedOperand( | 784 CHECK(BytecodeArrayBuilder::SizeForUnsignedOperand( |
| 781 static_cast<size_t>(kMaxUInt32)) == OperandSize::kQuad); | 785 static_cast<size_t>(kMaxUInt32)) == OperandSize::kQuad); |
| 782 } | 786 } |
| 783 | 787 |
| 784 } // namespace interpreter | 788 } // namespace interpreter |
| 785 } // namespace internal | 789 } // namespace internal |
| 786 } // namespace v8 | 790 } // namespace v8 |
| OLD | NEW |