Commit d4cc132e authored by Georg Neis's avatar Georg Neis Committed by Commit Bot

[turbofan] Extend/change serializer list of bytecodes.

In particular, don't clear environment for StackCheck.
Clear it for all throw and generator-related operations.

Also improve some printing.

Bug: v8:7790
Change-Id: I45d0994a06ba7ca430e78d631d85b2c6b2e9e323
Reviewed-on: https://chromium-review.googlesource.com/c/1439376
Commit-Queue: Georg Neis <neis@chromium.org>
Reviewed-by: 's avatarMaya Lekova <mslekova@chromium.org>
Reviewed-by: 's avatarJaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59157}
parent 2423deb5
......@@ -1148,7 +1148,8 @@ class SharedFunctionInfoData : public HeapObjectData {
int builtin_id() const { return builtin_id_; }
BytecodeArrayData* GetBytecodeArray() const { return GetBytecodeArray_; }
void SetSerializedForCompilation(FeedbackVectorRef feedback);
void SetSerializedForCompilation(JSHeapBroker* broker,
FeedbackVectorRef feedback);
bool IsSerializedForCompilation(FeedbackVectorRef feedback) const;
#define DECL_ACCESSOR(type, name) \
type name() const { return name##_; }
......@@ -1187,8 +1188,10 @@ SharedFunctionInfoData::SharedFunctionInfoData(
}
void SharedFunctionInfoData::SetSerializedForCompilation(
FeedbackVectorRef feedback) {
JSHeapBroker* broker, FeedbackVectorRef feedback) {
CHECK(serialized_for_compilation_.insert(feedback.object()).second);
TRACE(broker, "Set function " << object() << " with " << feedback.object()
<< " as serialized for compilation.");
}
bool SharedFunctionInfoData::IsSerializedForCompilation(
......@@ -2690,7 +2693,8 @@ void JSFunctionRef::Serialize() {
void SharedFunctionInfoRef::SetSerializedForCompilation(
FeedbackVectorRef feedback) {
CHECK_EQ(broker()->mode(), JSHeapBroker::kSerializing);
data()->AsSharedFunctionInfo()->SetSerializedForCompilation(feedback);
data()->AsSharedFunctionInfo()->SetSerializedForCompilation(broker(),
feedback);
}
bool SharedFunctionInfoRef::IsSerializedForCompilation(
......
......@@ -227,6 +227,9 @@ void SerializerForBackgroundCompilation::VisitExtraWide(
UNREACHABLE();
}
void SerializerForBackgroundCompilation::VisitStackCheck(
BytecodeArrayIterator* iterator) {}
void SerializerForBackgroundCompilation::VisitLdaUndefined(
interpreter::BytecodeArrayIterator* iterator) {
environment()->accumulator_hints().Clear();
......
......@@ -34,6 +34,7 @@ namespace compiler {
V(CreateBlockContext) \
V(CreateFunctionContext) \
V(CreateEvalContext) \
V(Debugger) \
V(Jump) \
V(JumpConstant) \
V(JumpIfFalse) \
......@@ -57,10 +58,16 @@ namespace compiler {
V(JumpLoop) \
V(PushContext) \
V(PopContext) \
V(ResumeGenerator) \
V(ReThrow) \
V(StaContextSlot) \
V(StaCurrentContextSlot) \
V(Throw)
V(SuspendGenerator) \
V(SwitchOnGeneratorState) \
V(Throw) \
V(ThrowReferenceErrorIfHole) \
V(ThrowSuperNotCalledIfHole) \
V(ThrowSuperAlreadyCalledIfNotHole)
#define CLEAR_ACCUMULATOR_LIST(V) \
V(CreateEmptyObjectLiteral) \
......@@ -102,6 +109,7 @@ namespace compiler {
V(LdaZero) \
V(Mov) \
V(Return) \
V(StackCheck) \
V(Star) \
V(Wide) \
CLEAR_ENVIRONMENT_LIST(V) \
......
......@@ -459,6 +459,7 @@ void ByteArray::ByteArrayPrint(std::ostream& os) { // NOLINT
void BytecodeArray::BytecodeArrayPrint(std::ostream& os) { // NOLINT
PrintHeader(os, "BytecodeArray");
os << "\n";
Disassemble(os);
}
......
......@@ -15381,6 +15381,7 @@ void BytecodeArray::Disassemble(std::ostream& os) {
DisallowHeapAllocation no_gc;
os << "Parameter count " << parameter_count() << "\n";
os << "Register count " << register_count() << "\n";
os << "Frame size " << frame_size() << "\n";
Address base_address = GetFirstBytecodeAddress();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment