2016-05-12 19:18:07 +00:00
|
|
|
// Copyright 2016 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"
|
|
|
|
|
2016-06-03 14:52:59 +00:00
|
|
|
#include "src/api.h"
|
|
|
|
#include "src/factory.h"
|
2016-05-12 19:18:07 +00:00
|
|
|
#include "src/interpreter/bytecode-array-writer.h"
|
2016-06-03 14:52:59 +00:00
|
|
|
#include "src/interpreter/bytecode-label.h"
|
|
|
|
#include "src/interpreter/constant-array-builder.h"
|
2016-05-12 19:18:07 +00:00
|
|
|
#include "src/isolate.h"
|
2017-01-09 13:43:28 +00:00
|
|
|
#include "src/objects-inl.h"
|
2016-06-28 05:51:09 +00:00
|
|
|
#include "src/source-position-table.h"
|
2016-05-12 19:18:07 +00:00
|
|
|
#include "src/utils.h"
|
|
|
|
#include "test/unittests/interpreter/bytecode-utils.h"
|
|
|
|
#include "test/unittests/test-utils.h"
|
|
|
|
|
|
|
|
namespace v8 {
|
|
|
|
namespace internal {
|
|
|
|
namespace interpreter {
|
|
|
|
|
|
|
|
class BytecodeArrayWriterUnittest : public TestWithIsolateAndZone {
|
|
|
|
public:
|
|
|
|
BytecodeArrayWriterUnittest()
|
2016-08-18 13:42:05 +00:00
|
|
|
: constant_array_builder_(zone(), isolate()->factory()->the_hole_value()),
|
2016-07-08 08:48:22 +00:00
|
|
|
bytecode_array_writer_(
|
2016-08-18 13:42:05 +00:00
|
|
|
zone(), &constant_array_builder_,
|
2016-07-08 08:48:22 +00:00
|
|
|
SourcePositionTableBuilder::RECORD_SOURCE_POSITIONS) {}
|
2016-05-12 19:18:07 +00:00
|
|
|
~BytecodeArrayWriterUnittest() override {}
|
|
|
|
|
2016-09-22 16:34:16 +00:00
|
|
|
void Write(Bytecode bytecode, BytecodeSourceInfo info = BytecodeSourceInfo());
|
2016-06-10 10:34:50 +00:00
|
|
|
void Write(Bytecode bytecode, uint32_t operand0,
|
2016-09-22 16:34:16 +00:00
|
|
|
BytecodeSourceInfo info = BytecodeSourceInfo());
|
2016-05-12 19:18:07 +00:00
|
|
|
void Write(Bytecode bytecode, uint32_t operand0, uint32_t operand1,
|
2016-09-22 16:34:16 +00:00
|
|
|
BytecodeSourceInfo info = BytecodeSourceInfo());
|
2016-05-12 19:18:07 +00:00
|
|
|
void Write(Bytecode bytecode, uint32_t operand0, uint32_t operand1,
|
2016-09-22 16:34:16 +00:00
|
|
|
uint32_t operand2, BytecodeSourceInfo info = BytecodeSourceInfo());
|
2016-05-12 19:18:07 +00:00
|
|
|
void Write(Bytecode bytecode, uint32_t operand0, uint32_t operand1,
|
2016-06-10 10:34:50 +00:00
|
|
|
uint32_t operand2, uint32_t operand3,
|
2016-09-22 16:34:16 +00:00
|
|
|
BytecodeSourceInfo info = BytecodeSourceInfo());
|
2016-05-12 19:18:07 +00:00
|
|
|
|
2016-06-03 14:52:59 +00:00
|
|
|
void WriteJump(Bytecode bytecode, BytecodeLabel* label,
|
2016-09-22 16:34:16 +00:00
|
|
|
BytecodeSourceInfo info = BytecodeSourceInfo());
|
|
|
|
void WriteJumpLoop(Bytecode bytecode, BytecodeLabel* label, int depth,
|
|
|
|
BytecodeSourceInfo info = BytecodeSourceInfo());
|
2016-06-03 14:52:59 +00:00
|
|
|
|
2016-05-12 19:18:07 +00:00
|
|
|
BytecodeArrayWriter* writer() { return &bytecode_array_writer_; }
|
2016-06-03 14:52:59 +00:00
|
|
|
ZoneVector<unsigned char>* bytecodes() { return writer()->bytecodes(); }
|
|
|
|
SourcePositionTableBuilder* source_position_table_builder() {
|
|
|
|
return writer()->source_position_table_builder();
|
|
|
|
}
|
2016-05-12 19:18:07 +00:00
|
|
|
|
|
|
|
private:
|
2016-06-03 14:52:59 +00:00
|
|
|
ConstantArrayBuilder constant_array_builder_;
|
2016-05-12 19:18:07 +00:00
|
|
|
BytecodeArrayWriter bytecode_array_writer_;
|
|
|
|
};
|
|
|
|
|
|
|
|
void BytecodeArrayWriterUnittest::Write(Bytecode bytecode,
|
2016-09-22 16:34:16 +00:00
|
|
|
BytecodeSourceInfo info) {
|
2016-10-24 20:47:41 +00:00
|
|
|
BytecodeNode node(bytecode, info);
|
2016-09-22 16:34:16 +00:00
|
|
|
writer()->Write(&node);
|
2016-05-12 19:18:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void BytecodeArrayWriterUnittest::Write(Bytecode bytecode, uint32_t operand0,
|
2016-09-22 16:34:16 +00:00
|
|
|
BytecodeSourceInfo info) {
|
2016-10-24 20:47:41 +00:00
|
|
|
BytecodeNode node(bytecode, operand0, info);
|
2016-09-22 16:34:16 +00:00
|
|
|
writer()->Write(&node);
|
2016-05-12 19:18:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void BytecodeArrayWriterUnittest::Write(Bytecode bytecode, uint32_t operand0,
|
|
|
|
uint32_t operand1,
|
2016-09-22 16:34:16 +00:00
|
|
|
BytecodeSourceInfo info) {
|
2016-10-24 20:47:41 +00:00
|
|
|
BytecodeNode node(bytecode, operand0, operand1, info);
|
2016-09-22 16:34:16 +00:00
|
|
|
writer()->Write(&node);
|
2016-05-12 19:18:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void BytecodeArrayWriterUnittest::Write(Bytecode bytecode, uint32_t operand0,
|
|
|
|
uint32_t operand1, uint32_t operand2,
|
2016-09-22 16:34:16 +00:00
|
|
|
BytecodeSourceInfo info) {
|
2016-10-24 20:47:41 +00:00
|
|
|
BytecodeNode node(bytecode, operand0, operand1, operand2, info);
|
2016-09-22 16:34:16 +00:00
|
|
|
writer()->Write(&node);
|
2016-05-12 19:18:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void BytecodeArrayWriterUnittest::Write(Bytecode bytecode, uint32_t operand0,
|
|
|
|
uint32_t operand1, uint32_t operand2,
|
|
|
|
uint32_t operand3,
|
2016-09-22 16:34:16 +00:00
|
|
|
BytecodeSourceInfo info) {
|
2016-10-24 20:47:41 +00:00
|
|
|
BytecodeNode node(bytecode, operand0, operand1, operand2, operand3, info);
|
2016-09-22 16:34:16 +00:00
|
|
|
writer()->Write(&node);
|
2016-05-12 19:18:07 +00:00
|
|
|
}
|
|
|
|
|
2016-06-03 14:52:59 +00:00
|
|
|
void BytecodeArrayWriterUnittest::WriteJump(Bytecode bytecode,
|
|
|
|
BytecodeLabel* label,
|
2016-09-22 16:34:16 +00:00
|
|
|
BytecodeSourceInfo info) {
|
2016-10-24 20:47:41 +00:00
|
|
|
BytecodeNode node(bytecode, 0, info);
|
2016-06-03 14:52:59 +00:00
|
|
|
writer()->WriteJump(&node, label);
|
|
|
|
}
|
|
|
|
|
2016-09-13 13:07:15 +00:00
|
|
|
void BytecodeArrayWriterUnittest::WriteJumpLoop(Bytecode bytecode,
|
2016-09-22 16:34:16 +00:00
|
|
|
BytecodeLabel* label, int depth,
|
|
|
|
BytecodeSourceInfo info) {
|
2016-10-24 20:47:41 +00:00
|
|
|
BytecodeNode node(bytecode, 0, depth, info);
|
2016-09-13 13:07:15 +00:00
|
|
|
writer()->WriteJump(&node, label);
|
|
|
|
}
|
|
|
|
|
2016-05-12 19:18:07 +00:00
|
|
|
TEST_F(BytecodeArrayWriterUnittest, SimpleExample) {
|
2016-11-11 12:12:31 +00:00
|
|
|
CHECK_EQ(bytecodes()->size(), 0u);
|
2016-05-12 19:18:07 +00:00
|
|
|
|
|
|
|
Write(Bytecode::kStackCheck, {10, false});
|
2016-11-11 12:12:31 +00:00
|
|
|
CHECK_EQ(bytecodes()->size(), 1u);
|
2016-05-12 19:18:07 +00:00
|
|
|
|
2016-06-10 10:34:50 +00:00
|
|
|
Write(Bytecode::kLdaSmi, 127, {55, true});
|
2016-11-11 12:12:31 +00:00
|
|
|
CHECK_EQ(bytecodes()->size(), 3u);
|
2016-05-12 19:18:07 +00:00
|
|
|
|
2016-06-10 10:34:50 +00:00
|
|
|
Write(Bytecode::kLdar, Register(200).ToOperand());
|
2016-11-11 12:12:31 +00:00
|
|
|
CHECK_EQ(bytecodes()->size(), 7u);
|
2016-05-12 19:18:07 +00:00
|
|
|
|
|
|
|
Write(Bytecode::kReturn, {70, true});
|
2016-11-11 12:12:31 +00:00
|
|
|
CHECK_EQ(bytecodes()->size(), 8u);
|
2016-05-12 19:18:07 +00:00
|
|
|
|
2016-06-10 10:34:50 +00:00
|
|
|
static const uint8_t bytes[] = {B(StackCheck), B(LdaSmi), U8(127), B(Wide),
|
|
|
|
B(Ldar), R16(200), B(Return)};
|
2016-06-03 14:52:59 +00:00
|
|
|
CHECK_EQ(bytecodes()->size(), arraysize(bytes));
|
2016-05-12 19:18:07 +00:00
|
|
|
for (size_t i = 0; i < arraysize(bytes); ++i) {
|
2016-06-03 14:52:59 +00:00
|
|
|
CHECK_EQ(bytecodes()->at(i), bytes[i]);
|
2016-05-12 19:18:07 +00:00
|
|
|
}
|
|
|
|
|
2016-08-18 13:42:05 +00:00
|
|
|
Handle<BytecodeArray> bytecode_array = writer()->ToBytecodeArray(
|
|
|
|
isolate(), 0, 0, factory()->empty_fixed_array());
|
2016-06-03 14:52:59 +00:00
|
|
|
CHECK_EQ(bytecodes()->size(), arraysize(bytes));
|
2016-05-12 19:18:07 +00:00
|
|
|
|
|
|
|
PositionTableEntry expected_positions[] = {
|
|
|
|
{0, 10, false}, {1, 55, true}, {7, 70, true}};
|
2016-07-08 08:48:22 +00:00
|
|
|
SourcePositionTableIterator source_iterator(
|
|
|
|
bytecode_array->source_position_table());
|
2016-05-12 19:18:07 +00:00
|
|
|
for (size_t i = 0; i < arraysize(expected_positions); ++i) {
|
|
|
|
const PositionTableEntry& expected = expected_positions[i];
|
2016-06-28 05:51:09 +00:00
|
|
|
CHECK_EQ(source_iterator.code_offset(), expected.code_offset);
|
This CL enables precise source positions for all V8 compilers. It merges compiler::SourcePosition and internal::SourcePosition to a single class used throughout the codebase. The new internal::SourcePosition instances store an id identifying an inlined function in addition to a script offset.
SourcePosition::InliningId() refers to a the new table DeoptimizationInputData::InliningPositions(), which provides the following data for every inlining id:
- The inlined SharedFunctionInfo as an offset into DeoptimizationInfo::LiteralArray
- The SourcePosition of the inlining. Recursively, this yields the full inlining stack.
Before the Code object is created, the same information can be found in CompilationInfo::inlined_functions().
If SourcePosition::InliningId() is SourcePosition::kNotInlined, it refers to the outer (non-inlined) function.
So every SourcePosition has full information about its inlining stack, as long as the corresponding Code object is known. The internal represenation of a source position is a positive 64bit integer.
All compilers create now appropriate source positions for inlined functions. In the case of Turbofan, this required using AstGraphBuilderWithPositions for inlined functions too. So this class is now moved to a header file.
At the moment, the additional information in source positions is only used in --trace-deopt and --code-comments. The profiler needs to be updated, at the moment it gets the correct script offsets from the deopt info, but the wrong script id from the reconstructed deopt stack, which can lead to wrong outputs. This should be resolved by making the profiler use the new inlining information for deopts.
I activated the inlined deoptimization tests in test-cpu-profiler.cc for Turbofan, changing them to a case where the deopt stack and the inlining position agree. It is currently still broken for other cases.
The following additional changes were necessary:
- The source position table (internal::SourcePositionTableBuilder etc.) supports now 64bit source positions. Encoding source positions in a single 64bit int together with the difference encoding in the source position table results in very little overhead for the inlining id, since only 12% of the source positions in Octane have a changed inlining id.
- The class HPositionInfo was effectively dead code and is now removed.
- SourcePosition has new printing and information facilities, including computing a full inlining stack.
- I had to rename compiler/source-position.{h,cc} to compiler/compiler-source-position-table.{h,cc} to avoid clashes with the new src/source-position.cc file.
- I wrote the new wrapper PodArray for ByteArray. It is a template working with any POD-type. This is used in DeoptimizationInputData::InliningPositions().
- I removed HInlinedFunctionInfo and HGraph::inlined_function_infos, because they were only used for the now obsolete Crankshaft inlining ids.
- Crankshaft managed a list of inlined functions in Lithium: LChunk::inlined_functions. This is an analog structure to CompilationInfo::inlined_functions. So I removed LChunk::inlined_functions and made Crankshaft use CompilationInfo::inlined_functions instead, because this was necessary to register the offsets into the literal array in a uniform way. This is a safe change because LChunk::inlined_functions has no other uses and the functions in CompilationInfo::inlined_functions have a strictly longer lifespan, being created earlier (in Hydrogen already).
BUG=v8:5432
Review-Url: https://codereview.chromium.org/2451853002
Cr-Commit-Position: refs/heads/master@{#40975}
2016-11-14 17:21:37 +00:00
|
|
|
CHECK_EQ(source_iterator.source_position().ScriptOffset(),
|
|
|
|
expected.source_position);
|
2016-05-12 19:18:07 +00:00
|
|
|
CHECK_EQ(source_iterator.is_statement(), expected.is_statement);
|
|
|
|
source_iterator.Advance();
|
|
|
|
}
|
|
|
|
CHECK(source_iterator.done());
|
|
|
|
}
|
|
|
|
|
|
|
|
TEST_F(BytecodeArrayWriterUnittest, ComplexExample) {
|
|
|
|
static const uint8_t expected_bytes[] = {
|
|
|
|
// clang-format off
|
|
|
|
/* 0 30 E> */ B(StackCheck),
|
|
|
|
/* 1 42 S> */ B(LdaConstant), U8(0),
|
2016-09-22 16:34:16 +00:00
|
|
|
/* 3 42 E> */ B(Add), R8(1), U8(1),
|
2016-09-13 13:07:15 +00:00
|
|
|
/* 5 68 S> */ B(JumpIfUndefined), U8(39),
|
|
|
|
/* 7 */ B(JumpIfNull), U8(37),
|
2016-07-29 11:14:55 +00:00
|
|
|
/* 9 */ B(ToObject), R8(3),
|
|
|
|
/* 11 */ B(ForInPrepare), R8(3), R8(4),
|
2016-05-12 19:18:07 +00:00
|
|
|
/* 14 */ B(LdaZero),
|
|
|
|
/* 15 */ B(Star), R8(7),
|
2016-08-29 08:47:12 +00:00
|
|
|
/* 17 63 S> */ B(ForInContinue), R8(7), R8(6),
|
2016-09-13 13:07:15 +00:00
|
|
|
/* 20 */ B(JumpIfFalse), U8(24),
|
2016-05-12 19:18:07 +00:00
|
|
|
/* 22 */ B(ForInNext), R8(3), R8(7), R8(4), U8(1),
|
|
|
|
/* 27 */ B(JumpIfUndefined), U8(10),
|
|
|
|
/* 29 */ B(Star), R8(0),
|
|
|
|
/* 31 54 E> */ B(StackCheck),
|
|
|
|
/* 32 */ B(Ldar), R8(0),
|
|
|
|
/* 34 */ B(Star), R8(2),
|
|
|
|
/* 36 85 S> */ B(Return),
|
|
|
|
/* 37 */ B(ForInStep), R8(7),
|
|
|
|
/* 39 */ B(Star), R8(7),
|
2016-09-13 13:07:15 +00:00
|
|
|
/* 41 */ B(JumpLoop), U8(-24), U8(0),
|
|
|
|
/* 44 */ B(LdaUndefined),
|
|
|
|
/* 45 85 S> */ B(Return),
|
2016-05-12 19:18:07 +00:00
|
|
|
// clang-format on
|
|
|
|
};
|
|
|
|
|
|
|
|
static const PositionTableEntry expected_positions[] = {
|
2016-09-22 16:34:16 +00:00
|
|
|
{0, 30, false}, {1, 42, true}, {3, 42, false}, {6, 68, true},
|
|
|
|
{18, 63, true}, {32, 54, false}, {37, 85, true}, {46, 85, true}};
|
2016-05-12 19:18:07 +00:00
|
|
|
|
2016-06-03 14:52:59 +00:00
|
|
|
BytecodeLabel back_jump, jump_for_in, jump_end_1, jump_end_2, jump_end_3;
|
|
|
|
|
2016-05-12 19:18:07 +00:00
|
|
|
#define R(i) static_cast<uint32_t>(Register(i).ToOperand())
|
|
|
|
Write(Bytecode::kStackCheck, {30, false});
|
2016-06-10 10:34:50 +00:00
|
|
|
Write(Bytecode::kLdaConstant, U8(0), {42, true});
|
2016-09-22 16:34:16 +00:00
|
|
|
Write(Bytecode::kAdd, R(1), U8(1), {42, false});
|
2016-06-10 10:34:50 +00:00
|
|
|
WriteJump(Bytecode::kJumpIfUndefined, &jump_end_1, {68, true});
|
|
|
|
WriteJump(Bytecode::kJumpIfNull, &jump_end_2);
|
2016-07-29 11:14:55 +00:00
|
|
|
Write(Bytecode::kToObject, R(3));
|
|
|
|
Write(Bytecode::kForInPrepare, R(3), R(4));
|
2016-05-12 19:18:07 +00:00
|
|
|
Write(Bytecode::kLdaZero);
|
2016-06-10 10:34:50 +00:00
|
|
|
Write(Bytecode::kStar, R(7));
|
2016-06-03 14:52:59 +00:00
|
|
|
writer()->BindLabel(&back_jump);
|
2016-08-29 08:47:12 +00:00
|
|
|
Write(Bytecode::kForInContinue, R(7), R(6), {63, true});
|
|
|
|
WriteJump(Bytecode::kJumpIfFalse, &jump_end_3);
|
2016-06-10 10:34:50 +00:00
|
|
|
Write(Bytecode::kForInNext, R(3), R(7), R(4), U8(1));
|
|
|
|
WriteJump(Bytecode::kJumpIfUndefined, &jump_for_in);
|
|
|
|
Write(Bytecode::kStar, R(0));
|
2016-05-12 19:18:07 +00:00
|
|
|
Write(Bytecode::kStackCheck, {54, false});
|
2016-06-10 10:34:50 +00:00
|
|
|
Write(Bytecode::kLdar, R(0));
|
|
|
|
Write(Bytecode::kStar, R(2));
|
2016-05-12 19:18:07 +00:00
|
|
|
Write(Bytecode::kReturn, {85, true});
|
2016-06-03 14:52:59 +00:00
|
|
|
writer()->BindLabel(&jump_for_in);
|
2016-06-10 10:34:50 +00:00
|
|
|
Write(Bytecode::kForInStep, R(7));
|
|
|
|
Write(Bytecode::kStar, R(7));
|
2016-09-13 13:07:15 +00:00
|
|
|
WriteJumpLoop(Bytecode::kJumpLoop, &back_jump, 0);
|
2016-06-03 14:52:59 +00:00
|
|
|
writer()->BindLabel(&jump_end_1);
|
|
|
|
writer()->BindLabel(&jump_end_2);
|
|
|
|
writer()->BindLabel(&jump_end_3);
|
2016-05-12 19:18:07 +00:00
|
|
|
Write(Bytecode::kLdaUndefined);
|
|
|
|
Write(Bytecode::kReturn, {85, true});
|
|
|
|
#undef R
|
|
|
|
|
2016-06-03 14:52:59 +00:00
|
|
|
CHECK_EQ(bytecodes()->size(), arraysize(expected_bytes));
|
2016-05-12 19:18:07 +00:00
|
|
|
for (size_t i = 0; i < arraysize(expected_bytes); ++i) {
|
2016-06-03 14:52:59 +00:00
|
|
|
CHECK_EQ(static_cast<int>(bytecodes()->at(i)),
|
2016-05-12 19:18:07 +00:00
|
|
|
static_cast<int>(expected_bytes[i]));
|
|
|
|
}
|
|
|
|
|
2016-08-18 13:42:05 +00:00
|
|
|
Handle<BytecodeArray> bytecode_array = writer()->ToBytecodeArray(
|
|
|
|
isolate(), 0, 0, factory()->empty_fixed_array());
|
2016-08-17 09:31:24 +00:00
|
|
|
SourcePositionTableIterator source_iterator(
|
|
|
|
bytecode_array->source_position_table());
|
2016-05-12 19:18:07 +00:00
|
|
|
for (size_t i = 0; i < arraysize(expected_positions); ++i) {
|
|
|
|
const PositionTableEntry& expected = expected_positions[i];
|
2016-06-28 05:51:09 +00:00
|
|
|
CHECK_EQ(source_iterator.code_offset(), expected.code_offset);
|
This CL enables precise source positions for all V8 compilers. It merges compiler::SourcePosition and internal::SourcePosition to a single class used throughout the codebase. The new internal::SourcePosition instances store an id identifying an inlined function in addition to a script offset.
SourcePosition::InliningId() refers to a the new table DeoptimizationInputData::InliningPositions(), which provides the following data for every inlining id:
- The inlined SharedFunctionInfo as an offset into DeoptimizationInfo::LiteralArray
- The SourcePosition of the inlining. Recursively, this yields the full inlining stack.
Before the Code object is created, the same information can be found in CompilationInfo::inlined_functions().
If SourcePosition::InliningId() is SourcePosition::kNotInlined, it refers to the outer (non-inlined) function.
So every SourcePosition has full information about its inlining stack, as long as the corresponding Code object is known. The internal represenation of a source position is a positive 64bit integer.
All compilers create now appropriate source positions for inlined functions. In the case of Turbofan, this required using AstGraphBuilderWithPositions for inlined functions too. So this class is now moved to a header file.
At the moment, the additional information in source positions is only used in --trace-deopt and --code-comments. The profiler needs to be updated, at the moment it gets the correct script offsets from the deopt info, but the wrong script id from the reconstructed deopt stack, which can lead to wrong outputs. This should be resolved by making the profiler use the new inlining information for deopts.
I activated the inlined deoptimization tests in test-cpu-profiler.cc for Turbofan, changing them to a case where the deopt stack and the inlining position agree. It is currently still broken for other cases.
The following additional changes were necessary:
- The source position table (internal::SourcePositionTableBuilder etc.) supports now 64bit source positions. Encoding source positions in a single 64bit int together with the difference encoding in the source position table results in very little overhead for the inlining id, since only 12% of the source positions in Octane have a changed inlining id.
- The class HPositionInfo was effectively dead code and is now removed.
- SourcePosition has new printing and information facilities, including computing a full inlining stack.
- I had to rename compiler/source-position.{h,cc} to compiler/compiler-source-position-table.{h,cc} to avoid clashes with the new src/source-position.cc file.
- I wrote the new wrapper PodArray for ByteArray. It is a template working with any POD-type. This is used in DeoptimizationInputData::InliningPositions().
- I removed HInlinedFunctionInfo and HGraph::inlined_function_infos, because they were only used for the now obsolete Crankshaft inlining ids.
- Crankshaft managed a list of inlined functions in Lithium: LChunk::inlined_functions. This is an analog structure to CompilationInfo::inlined_functions. So I removed LChunk::inlined_functions and made Crankshaft use CompilationInfo::inlined_functions instead, because this was necessary to register the offsets into the literal array in a uniform way. This is a safe change because LChunk::inlined_functions has no other uses and the functions in CompilationInfo::inlined_functions have a strictly longer lifespan, being created earlier (in Hydrogen already).
BUG=v8:5432
Review-Url: https://codereview.chromium.org/2451853002
Cr-Commit-Position: refs/heads/master@{#40975}
2016-11-14 17:21:37 +00:00
|
|
|
CHECK_EQ(source_iterator.source_position().ScriptOffset(),
|
|
|
|
expected.source_position);
|
2016-05-12 19:18:07 +00:00
|
|
|
CHECK_EQ(source_iterator.is_statement(), expected.is_statement);
|
|
|
|
source_iterator.Advance();
|
|
|
|
}
|
|
|
|
CHECK(source_iterator.done());
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace interpreter
|
|
|
|
} // namespace internal
|
|
|
|
} // namespace v8
|