2015-09-10 16:21:34 +00:00
|
|
|
// Copyright 2015 the V8 project authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
|
|
|
#include "src/v8.h"
|
|
|
|
|
|
|
|
#include "src/interpreter/bytecode-array-builder.h"
|
|
|
|
#include "src/interpreter/bytecode-array-iterator.h"
|
|
|
|
#include "test/unittests/test-utils.h"
|
|
|
|
|
|
|
|
namespace v8 {
|
|
|
|
namespace internal {
|
|
|
|
namespace interpreter {
|
|
|
|
|
|
|
|
class BytecodeArrayIteratorTest : public TestWithIsolateAndZone {
|
|
|
|
public:
|
|
|
|
BytecodeArrayIteratorTest() {}
|
|
|
|
~BytecodeArrayIteratorTest() override {}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
TEST_F(BytecodeArrayIteratorTest, IteratesBytecodeArray) {
|
|
|
|
// Use a builder to create an array with containing multiple bytecodes
|
|
|
|
// with 0, 1 and 2 operands.
|
2016-04-01 12:08:53 +00:00
|
|
|
BytecodeArrayBuilder builder(isolate(), zone(), 3, 3, 0);
|
2015-09-10 16:21:34 +00:00
|
|
|
Factory* factory = isolate()->factory();
|
|
|
|
Handle<HeapObject> heap_num_0 = factory->NewHeapNumber(2.718);
|
|
|
|
Handle<HeapObject> heap_num_1 = factory->NewHeapNumber(2147483647);
|
|
|
|
Smi* zero = Smi::FromInt(0);
|
|
|
|
Smi* smi_0 = Smi::FromInt(64);
|
|
|
|
Smi* smi_1 = Smi::FromInt(-65536);
|
|
|
|
Register reg_0(0);
|
|
|
|
Register reg_1(1);
|
2016-04-01 12:08:53 +00:00
|
|
|
Register param = Register::FromParameterIndex(2, builder.parameter_count());
|
2015-12-23 09:34:00 +00:00
|
|
|
Handle<String> name = factory->NewStringFromStaticChars("abc");
|
2016-03-21 17:08:21 +00:00
|
|
|
int name_index = 2;
|
2015-09-10 16:21:34 +00:00
|
|
|
int feedback_slot = 97;
|
|
|
|
|
|
|
|
builder.LoadLiteral(heap_num_0)
|
2016-05-12 19:18:07 +00:00
|
|
|
.StoreAccumulatorInRegister(reg_0)
|
2015-09-10 16:21:34 +00:00
|
|
|
.LoadLiteral(heap_num_1)
|
2016-05-12 19:18:07 +00:00
|
|
|
.StoreAccumulatorInRegister(reg_0)
|
2015-09-10 16:21:34 +00:00
|
|
|
.LoadLiteral(zero)
|
2016-05-12 19:18:07 +00:00
|
|
|
.StoreAccumulatorInRegister(reg_0)
|
2015-09-10 16:21:34 +00:00
|
|
|
.LoadLiteral(smi_0)
|
2016-07-05 13:44:05 +00:00
|
|
|
.StackCheck(0)
|
2016-05-12 19:18:07 +00:00
|
|
|
.StoreAccumulatorInRegister(reg_0)
|
2015-09-10 16:21:34 +00:00
|
|
|
.LoadLiteral(smi_1)
|
2016-07-05 13:44:05 +00:00
|
|
|
.StackCheck(1)
|
2016-05-12 19:18:07 +00:00
|
|
|
.StoreAccumulatorInRegister(reg_1)
|
2015-09-10 16:21:34 +00:00
|
|
|
.LoadAccumulatorWithRegister(reg_0)
|
2016-05-27 15:57:35 +00:00
|
|
|
.BinaryOperation(Token::Value::ADD, reg_0)
|
2016-05-12 19:18:07 +00:00
|
|
|
.StoreAccumulatorInRegister(reg_1)
|
2016-02-17 10:30:10 +00:00
|
|
|
.LoadNamedProperty(reg_1, name, feedback_slot)
|
2016-05-25 09:55:26 +00:00
|
|
|
.BinaryOperation(Token::Value::ADD, reg_0)
|
2016-04-01 12:08:53 +00:00
|
|
|
.StoreAccumulatorInRegister(param)
|
|
|
|
.CallRuntimeForPair(Runtime::kLoadLookupSlotForCall, param, 1, reg_0)
|
2016-07-29 11:14:55 +00:00
|
|
|
.ForInPrepare(reg_0, reg_0)
|
2015-10-02 18:13:41 +00:00
|
|
|
.CallRuntime(Runtime::kLoadIC_Miss, reg_0, 1)
|
2016-02-04 15:06:25 +00:00
|
|
|
.Debugger()
|
2016-06-27 08:42:41 +00:00
|
|
|
.LoadGlobal(0x10000000, TypeofMode::NOT_INSIDE_TYPEOF)
|
2015-09-10 16:21:34 +00:00
|
|
|
.Return();
|
|
|
|
|
|
|
|
// Test iterator sees the expected output from the builder.
|
|
|
|
BytecodeArrayIterator iterator(builder.ToBytecodeArray());
|
2016-04-01 12:08:53 +00:00
|
|
|
const int kPrefixByteSize = 1;
|
|
|
|
int offset = 0;
|
|
|
|
|
2015-09-10 16:21:34 +00:00
|
|
|
CHECK_EQ(iterator.current_bytecode(), Bytecode::kLdaConstant);
|
2016-04-01 12:08:53 +00:00
|
|
|
CHECK_EQ(iterator.current_offset(), offset);
|
2016-03-21 17:08:21 +00:00
|
|
|
CHECK_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
|
2015-09-10 16:21:34 +00:00
|
|
|
CHECK(iterator.GetConstantForIndexOperand(0).is_identical_to(heap_num_0));
|
|
|
|
CHECK(!iterator.done());
|
2016-04-01 12:08:53 +00:00
|
|
|
offset += Bytecodes::Size(Bytecode::kLdaConstant, OperandScale::kSingle);
|
2015-09-10 16:21:34 +00:00
|
|
|
iterator.Advance();
|
|
|
|
|
2016-05-12 19:18:07 +00:00
|
|
|
CHECK_EQ(iterator.current_bytecode(), Bytecode::kStar);
|
|
|
|
CHECK_EQ(iterator.current_offset(), offset);
|
|
|
|
CHECK_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
|
|
|
|
CHECK_EQ(iterator.GetRegisterOperand(0).index(), reg_0.index());
|
|
|
|
CHECK_EQ(iterator.GetRegisterOperandRange(0), 1);
|
|
|
|
CHECK(!iterator.done());
|
|
|
|
offset += Bytecodes::Size(Bytecode::kStar, OperandScale::kSingle);
|
|
|
|
iterator.Advance();
|
|
|
|
|
2015-09-10 16:21:34 +00:00
|
|
|
CHECK_EQ(iterator.current_bytecode(), Bytecode::kLdaConstant);
|
2016-04-01 12:08:53 +00:00
|
|
|
CHECK_EQ(iterator.current_offset(), offset);
|
2016-03-21 17:08:21 +00:00
|
|
|
CHECK_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
|
2015-09-10 16:21:34 +00:00
|
|
|
CHECK(iterator.GetConstantForIndexOperand(0).is_identical_to(heap_num_1));
|
|
|
|
CHECK(!iterator.done());
|
2016-04-01 12:08:53 +00:00
|
|
|
offset += Bytecodes::Size(Bytecode::kLdaConstant, OperandScale::kSingle);
|
2015-09-10 16:21:34 +00:00
|
|
|
iterator.Advance();
|
|
|
|
|
2016-05-12 19:18:07 +00:00
|
|
|
CHECK_EQ(iterator.current_bytecode(), Bytecode::kStar);
|
|
|
|
CHECK_EQ(iterator.current_offset(), offset);
|
|
|
|
CHECK_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
|
|
|
|
CHECK_EQ(iterator.GetRegisterOperand(0).index(), reg_0.index());
|
|
|
|
CHECK_EQ(iterator.GetRegisterOperandRange(0), 1);
|
|
|
|
CHECK(!iterator.done());
|
|
|
|
offset += Bytecodes::Size(Bytecode::kStar, OperandScale::kSingle);
|
|
|
|
iterator.Advance();
|
|
|
|
|
2015-09-10 16:21:34 +00:00
|
|
|
CHECK_EQ(iterator.current_bytecode(), Bytecode::kLdaZero);
|
2016-04-01 12:08:53 +00:00
|
|
|
CHECK_EQ(iterator.current_offset(), offset);
|
2016-03-21 17:08:21 +00:00
|
|
|
CHECK_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
|
2015-09-10 16:21:34 +00:00
|
|
|
CHECK(!iterator.done());
|
2016-04-01 12:08:53 +00:00
|
|
|
offset += Bytecodes::Size(Bytecode::kLdaZero, OperandScale::kSingle);
|
2015-09-10 16:21:34 +00:00
|
|
|
iterator.Advance();
|
|
|
|
|
2016-05-12 19:18:07 +00:00
|
|
|
CHECK_EQ(iterator.current_bytecode(), Bytecode::kStar);
|
|
|
|
CHECK_EQ(iterator.current_offset(), offset);
|
|
|
|
CHECK_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
|
|
|
|
CHECK_EQ(iterator.GetRegisterOperand(0).index(), reg_0.index());
|
|
|
|
CHECK_EQ(iterator.GetRegisterOperandRange(0), 1);
|
|
|
|
CHECK(!iterator.done());
|
|
|
|
offset += Bytecodes::Size(Bytecode::kStar, OperandScale::kSingle);
|
|
|
|
iterator.Advance();
|
|
|
|
|
2016-03-21 17:08:21 +00:00
|
|
|
CHECK_EQ(iterator.current_bytecode(), Bytecode::kLdaSmi);
|
2016-04-01 12:08:53 +00:00
|
|
|
CHECK_EQ(iterator.current_offset(), offset);
|
2016-03-21 17:08:21 +00:00
|
|
|
CHECK_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
|
2015-10-01 17:22:58 +00:00
|
|
|
CHECK_EQ(Smi::FromInt(iterator.GetImmediateOperand(0)), smi_0);
|
2015-09-10 16:21:34 +00:00
|
|
|
CHECK(!iterator.done());
|
2016-04-01 12:08:53 +00:00
|
|
|
offset += Bytecodes::Size(Bytecode::kLdaSmi, OperandScale::kSingle);
|
2015-09-10 16:21:34 +00:00
|
|
|
iterator.Advance();
|
|
|
|
|
2016-07-05 13:44:05 +00:00
|
|
|
CHECK_EQ(iterator.current_bytecode(), Bytecode::kStackCheck);
|
|
|
|
CHECK_EQ(iterator.current_offset(), offset);
|
|
|
|
CHECK_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
|
|
|
|
CHECK_EQ(Bytecodes::NumberOfOperands(iterator.current_bytecode()), 0);
|
|
|
|
CHECK(!iterator.done());
|
|
|
|
offset += Bytecodes::Size(Bytecode::kStackCheck, OperandScale::kSingle);
|
|
|
|
iterator.Advance();
|
|
|
|
|
2016-05-12 19:18:07 +00:00
|
|
|
CHECK_EQ(iterator.current_bytecode(), Bytecode::kStar);
|
|
|
|
CHECK_EQ(iterator.current_offset(), offset);
|
|
|
|
CHECK_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
|
|
|
|
CHECK_EQ(iterator.GetRegisterOperand(0).index(), reg_0.index());
|
|
|
|
CHECK_EQ(iterator.GetRegisterOperandRange(0), 1);
|
|
|
|
CHECK(!iterator.done());
|
|
|
|
offset += Bytecodes::Size(Bytecode::kStar, OperandScale::kSingle);
|
|
|
|
iterator.Advance();
|
|
|
|
|
2016-03-21 17:08:21 +00:00
|
|
|
CHECK_EQ(iterator.current_bytecode(), Bytecode::kLdaSmi);
|
2016-04-01 12:08:53 +00:00
|
|
|
CHECK_EQ(iterator.current_offset(), offset);
|
2016-03-21 17:08:21 +00:00
|
|
|
CHECK_EQ(iterator.current_operand_scale(), OperandScale::kQuadruple);
|
|
|
|
CHECK_EQ(Smi::FromInt(iterator.GetImmediateOperand(0)), smi_1);
|
2015-09-10 16:21:34 +00:00
|
|
|
CHECK(!iterator.done());
|
2016-04-01 12:08:53 +00:00
|
|
|
offset += Bytecodes::Size(Bytecode::kLdaSmi, OperandScale::kQuadruple) +
|
|
|
|
kPrefixByteSize;
|
2015-09-10 16:21:34 +00:00
|
|
|
iterator.Advance();
|
|
|
|
|
2016-07-05 13:44:05 +00:00
|
|
|
CHECK_EQ(iterator.current_bytecode(), Bytecode::kStackCheck);
|
|
|
|
CHECK_EQ(iterator.current_offset(), offset);
|
|
|
|
CHECK_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
|
|
|
|
CHECK_EQ(Bytecodes::NumberOfOperands(iterator.current_bytecode()), 0);
|
|
|
|
CHECK(!iterator.done());
|
|
|
|
offset += Bytecodes::Size(Bytecode::kStackCheck, OperandScale::kSingle);
|
|
|
|
iterator.Advance();
|
|
|
|
|
2016-05-12 19:18:07 +00:00
|
|
|
CHECK_EQ(iterator.current_bytecode(), Bytecode::kStar);
|
|
|
|
CHECK_EQ(iterator.current_offset(), offset);
|
|
|
|
CHECK_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
|
|
|
|
CHECK_EQ(iterator.GetRegisterOperand(0).index(), reg_1.index());
|
|
|
|
CHECK_EQ(iterator.GetRegisterOperandRange(0), 1);
|
|
|
|
CHECK(!iterator.done());
|
|
|
|
offset += Bytecodes::Size(Bytecode::kStar, OperandScale::kSingle);
|
|
|
|
iterator.Advance();
|
|
|
|
|
2015-09-10 16:21:34 +00:00
|
|
|
CHECK_EQ(iterator.current_bytecode(), Bytecode::kLdar);
|
2016-04-01 12:08:53 +00:00
|
|
|
CHECK_EQ(iterator.current_offset(), offset);
|
2016-03-21 17:08:21 +00:00
|
|
|
CHECK_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
|
2015-09-10 16:21:34 +00:00
|
|
|
CHECK_EQ(iterator.GetRegisterOperand(0).index(), reg_0.index());
|
|
|
|
CHECK(!iterator.done());
|
2016-04-01 12:08:53 +00:00
|
|
|
offset += Bytecodes::Size(Bytecode::kLdar, OperandScale::kSingle);
|
2015-09-10 16:21:34 +00:00
|
|
|
iterator.Advance();
|
|
|
|
|
2016-05-27 15:57:35 +00:00
|
|
|
CHECK_EQ(iterator.current_bytecode(), Bytecode::kAdd);
|
|
|
|
CHECK_EQ(iterator.current_offset(), offset);
|
|
|
|
CHECK_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
|
|
|
|
CHECK_EQ(iterator.GetRegisterOperand(0).index(), reg_0.index());
|
|
|
|
CHECK_EQ(iterator.GetRegisterOperandRange(0), 1);
|
|
|
|
CHECK(!iterator.done());
|
|
|
|
offset += Bytecodes::Size(Bytecode::kStar, OperandScale::kSingle);
|
|
|
|
iterator.Advance();
|
|
|
|
|
2016-05-12 19:18:07 +00:00
|
|
|
CHECK_EQ(iterator.current_bytecode(), Bytecode::kStar);
|
|
|
|
CHECK_EQ(iterator.current_offset(), offset);
|
|
|
|
CHECK_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
|
|
|
|
CHECK_EQ(iterator.GetRegisterOperand(0).index(), reg_1.index());
|
|
|
|
CHECK_EQ(iterator.GetRegisterOperandRange(0), 1);
|
|
|
|
CHECK(!iterator.done());
|
|
|
|
offset += Bytecodes::Size(Bytecode::kStar, OperandScale::kSingle);
|
|
|
|
iterator.Advance();
|
|
|
|
|
2016-05-25 10:45:14 +00:00
|
|
|
CHECK_EQ(iterator.current_bytecode(), Bytecode::kLdaNamedProperty);
|
2016-04-01 12:08:53 +00:00
|
|
|
CHECK_EQ(iterator.current_offset(), offset);
|
2016-03-21 17:08:21 +00:00
|
|
|
CHECK_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
|
2015-09-10 16:21:34 +00:00
|
|
|
CHECK_EQ(iterator.GetRegisterOperand(0).index(), reg_1.index());
|
2015-10-22 14:55:32 +00:00
|
|
|
CHECK_EQ(iterator.GetIndexOperand(1), name_index);
|
|
|
|
CHECK_EQ(iterator.GetIndexOperand(2), feedback_slot);
|
2015-09-10 16:21:34 +00:00
|
|
|
CHECK(!iterator.done());
|
2016-05-25 10:45:14 +00:00
|
|
|
offset += Bytecodes::Size(Bytecode::kLdaNamedProperty, OperandScale::kSingle);
|
2015-09-10 16:21:34 +00:00
|
|
|
iterator.Advance();
|
|
|
|
|
2016-05-25 09:55:26 +00:00
|
|
|
CHECK_EQ(iterator.current_bytecode(), Bytecode::kAdd);
|
|
|
|
CHECK_EQ(iterator.current_offset(), offset);
|
|
|
|
CHECK_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
|
|
|
|
CHECK_EQ(iterator.GetRegisterOperand(0).index(), reg_0.index());
|
|
|
|
CHECK_EQ(iterator.GetRegisterOperandRange(0), 1);
|
|
|
|
CHECK(!iterator.done());
|
|
|
|
offset += Bytecodes::Size(Bytecode::kStar, OperandScale::kSingle);
|
|
|
|
iterator.Advance();
|
|
|
|
|
2015-09-10 16:21:34 +00:00
|
|
|
CHECK_EQ(iterator.current_bytecode(), Bytecode::kStar);
|
2016-04-01 12:08:53 +00:00
|
|
|
CHECK_EQ(iterator.current_offset(), offset);
|
|
|
|
CHECK_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
|
|
|
|
CHECK_EQ(iterator.GetRegisterOperand(0).index(), param.index());
|
|
|
|
CHECK_EQ(iterator.GetRegisterOperandRange(0), 1);
|
|
|
|
CHECK(!iterator.done());
|
|
|
|
offset += Bytecodes::Size(Bytecode::kStar, OperandScale::kSingle);
|
|
|
|
iterator.Advance();
|
|
|
|
|
|
|
|
CHECK_EQ(iterator.current_bytecode(), Bytecode::kCallRuntimeForPair);
|
|
|
|
CHECK_EQ(iterator.current_offset(), offset);
|
2016-03-21 17:08:21 +00:00
|
|
|
CHECK_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
|
2016-04-01 12:08:53 +00:00
|
|
|
CHECK_EQ(iterator.GetRuntimeIdOperand(0), Runtime::kLoadLookupSlotForCall);
|
|
|
|
CHECK_EQ(iterator.GetRegisterOperand(1).index(), param.index());
|
|
|
|
CHECK_EQ(iterator.GetRegisterOperandRange(1), 1);
|
|
|
|
CHECK_EQ(iterator.GetRegisterCountOperand(2), 1);
|
|
|
|
CHECK_EQ(iterator.GetRegisterOperand(3).index(), reg_0.index());
|
|
|
|
CHECK_EQ(iterator.GetRegisterOperandRange(3), 2);
|
|
|
|
CHECK(!iterator.done());
|
|
|
|
offset +=
|
|
|
|
Bytecodes::Size(Bytecode::kCallRuntimeForPair, OperandScale::kSingle);
|
|
|
|
iterator.Advance();
|
|
|
|
|
|
|
|
CHECK_EQ(iterator.current_bytecode(), Bytecode::kForInPrepare);
|
|
|
|
CHECK_EQ(iterator.current_offset(), offset);
|
|
|
|
CHECK_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
|
|
|
|
CHECK_EQ(iterator.GetRegisterOperand(0).index(), reg_0.index());
|
2016-07-29 11:14:55 +00:00
|
|
|
CHECK_EQ(iterator.GetRegisterOperandRange(0), 1);
|
|
|
|
CHECK_EQ(iterator.GetRegisterOperand(1).index(), reg_0.index());
|
|
|
|
CHECK_EQ(iterator.GetRegisterOperandRange(1), 3);
|
2015-09-10 16:21:34 +00:00
|
|
|
CHECK(!iterator.done());
|
2016-04-01 12:08:53 +00:00
|
|
|
offset += Bytecodes::Size(Bytecode::kForInPrepare, OperandScale::kSingle);
|
2015-09-10 16:21:34 +00:00
|
|
|
iterator.Advance();
|
|
|
|
|
2015-10-02 18:13:41 +00:00
|
|
|
CHECK_EQ(iterator.current_bytecode(), Bytecode::kCallRuntime);
|
2016-04-01 12:08:53 +00:00
|
|
|
CHECK_EQ(iterator.current_offset(), offset);
|
2016-03-21 17:08:21 +00:00
|
|
|
CHECK_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
|
2016-06-21 14:37:16 +00:00
|
|
|
CHECK_EQ(iterator.GetRuntimeIdOperand(0), Runtime::kLoadIC_Miss);
|
2015-10-02 18:13:41 +00:00
|
|
|
CHECK_EQ(iterator.GetRegisterOperand(1).index(), reg_0.index());
|
2016-02-11 16:40:24 +00:00
|
|
|
CHECK_EQ(iterator.GetRegisterCountOperand(2), 1);
|
2015-10-02 18:13:41 +00:00
|
|
|
CHECK(!iterator.done());
|
2016-04-01 12:08:53 +00:00
|
|
|
offset += Bytecodes::Size(Bytecode::kCallRuntime, OperandScale::kSingle);
|
2015-10-02 18:13:41 +00:00
|
|
|
iterator.Advance();
|
|
|
|
|
2016-02-04 15:06:25 +00:00
|
|
|
CHECK_EQ(iterator.current_bytecode(), Bytecode::kDebugger);
|
2016-04-01 12:08:53 +00:00
|
|
|
CHECK_EQ(iterator.current_offset(), offset);
|
2016-03-21 17:08:21 +00:00
|
|
|
CHECK_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
|
2016-02-04 15:06:25 +00:00
|
|
|
CHECK(!iterator.done());
|
2016-04-01 12:08:53 +00:00
|
|
|
offset += Bytecodes::Size(Bytecode::kDebugger, OperandScale::kSingle);
|
2016-02-04 15:06:25 +00:00
|
|
|
iterator.Advance();
|
|
|
|
|
2016-03-21 17:08:21 +00:00
|
|
|
CHECK_EQ(iterator.current_bytecode(), Bytecode::kLdaGlobal);
|
2016-04-01 12:08:53 +00:00
|
|
|
CHECK_EQ(iterator.current_offset(), offset);
|
2016-03-21 17:08:21 +00:00
|
|
|
CHECK_EQ(iterator.current_operand_scale(), OperandScale::kQuadruple);
|
2016-06-27 08:42:41 +00:00
|
|
|
CHECK_EQ(iterator.current_bytecode_size(), 6);
|
|
|
|
CHECK_EQ(iterator.GetIndexOperand(0), 0x10000000);
|
2016-04-01 12:08:53 +00:00
|
|
|
offset += Bytecodes::Size(Bytecode::kLdaGlobal, OperandScale::kQuadruple) +
|
|
|
|
kPrefixByteSize;
|
2016-03-21 17:08:21 +00:00
|
|
|
iterator.Advance();
|
|
|
|
|
2015-09-10 16:21:34 +00:00
|
|
|
CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn);
|
2016-04-01 12:08:53 +00:00
|
|
|
CHECK_EQ(iterator.current_offset(), offset);
|
2016-03-21 17:08:21 +00:00
|
|
|
CHECK_EQ(iterator.current_operand_scale(), OperandScale::kSingle);
|
2015-09-10 16:21:34 +00:00
|
|
|
CHECK(!iterator.done());
|
|
|
|
iterator.Advance();
|
|
|
|
CHECK(iterator.done());
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace interpreter
|
|
|
|
} // namespace internal
|
|
|
|
} // namespace v8
|