Commit 54188964 authored by jarin's avatar jarin Committed by Commit bot

Make the frame inspector use TranslatedState rather than the full deoptimizer.

This is mostly preparation for allowing the function closure to be materialized.

As a drive-by fix, I have added ignition source position support to the frame inspector (this fixed some ignition test failures).

Review URL: https://codereview.chromium.org/1698743002

Cr-Commit-Position: refs/heads/master@{#33975}
parent 359ba8e0
...@@ -85,27 +85,6 @@ void Deoptimizer::PatchCodeForDeoptimization(Isolate* isolate, Code* code) { ...@@ -85,27 +85,6 @@ void Deoptimizer::PatchCodeForDeoptimization(Isolate* isolate, Code* code) {
} }
void Deoptimizer::FillInputFrame(Address tos, JavaScriptFrame* frame) {
// Set the register values. The values are not important as there are no
// callee saved registers in JavaScript frames, so all registers are
// spilled. Registers fp and sp are set to the correct values though.
for (int i = 0; i < Register::kNumRegisters; i++) {
input_->SetRegister(i, i * 4);
}
input_->SetRegister(sp.code(), reinterpret_cast<intptr_t>(frame->sp()));
input_->SetRegister(fp.code(), reinterpret_cast<intptr_t>(frame->fp()));
for (int i = 0; i < DoubleRegister::kMaxNumRegisters; i++) {
input_->SetDoubleRegister(i, 0.0);
}
// Fill the frame content from the actual data on the frame.
for (unsigned i = 0; i < input_->GetFrameSize(); i += kPointerSize) {
input_->SetFrameSlot(i, Memory::uint32_at(tos + i));
}
}
void Deoptimizer::SetPlatformCompiledStubRegisters( void Deoptimizer::SetPlatformCompiledStubRegisters(
FrameDescription* output_frame, CodeStubDescriptor* descriptor) { FrameDescription* output_frame, CodeStubDescriptor* descriptor) {
ApiFunction function(descriptor->deoptimization_handler()); ApiFunction function(descriptor->deoptimization_handler());
......
...@@ -65,28 +65,6 @@ void Deoptimizer::PatchCodeForDeoptimization(Isolate* isolate, Code* code) { ...@@ -65,28 +65,6 @@ void Deoptimizer::PatchCodeForDeoptimization(Isolate* isolate, Code* code) {
} }
void Deoptimizer::FillInputFrame(Address tos, JavaScriptFrame* frame) {
// Set the register values. The values are not important as there are no
// callee saved registers in JavaScript frames, so all registers are
// spilled. Registers fp and sp are set to the correct values though.
for (int i = 0; i < Register::NumRegisters(); i++) {
input_->SetRegister(i, 0);
}
// TODO(all): Do we also need to set a value to csp?
input_->SetRegister(jssp.code(), reinterpret_cast<intptr_t>(frame->sp()));
input_->SetRegister(fp.code(), reinterpret_cast<intptr_t>(frame->fp()));
for (int i = 0; i < DoubleRegister::kMaxNumRegisters; i++) {
input_->SetDoubleRegister(i, 0.0);
}
// Fill the frame content from the actual data on the frame.
for (unsigned i = 0; i < input_->GetFrameSize(); i += kPointerSize) {
input_->SetFrameSlot(i, Memory::uint64_at(tos + i));
}
}
bool Deoptimizer::HasAlignmentPadding(SharedFunctionInfo* shared) { bool Deoptimizer::HasAlignmentPadding(SharedFunctionInfo* shared) {
// There is no dynamic alignment padding on ARM64 in the input frame. // There is no dynamic alignment padding on ARM64 in the input frame.
return false; return false;
......
This diff is collapsed.
...@@ -27,6 +27,7 @@ class TranslatedValue { ...@@ -27,6 +27,7 @@ class TranslatedValue {
Handle<Object> GetValue(); Handle<Object> GetValue();
bool IsMaterializedObject() const; bool IsMaterializedObject() const;
bool IsMaterializableByDebugger() const;
private: private:
friend class TranslatedState; friend class TranslatedState;
...@@ -508,10 +509,6 @@ class Deoptimizer : public Malloced { ...@@ -508,10 +509,6 @@ class Deoptimizer : public Malloced {
void MaterializeHeapObjects(JavaScriptFrameIterator* it); void MaterializeHeapObjects(JavaScriptFrameIterator* it);
void MaterializeHeapNumbersForDebuggerInspectableFrame(
int frame_index, int parameter_count, int expression_count,
DeoptimizedFrameInfo* info);
static void ComputeOutputFrames(Deoptimizer* deoptimizer); static void ComputeOutputFrames(Deoptimizer* deoptimizer);
...@@ -645,11 +642,6 @@ class Deoptimizer : public Malloced { ...@@ -645,11 +642,6 @@ class Deoptimizer : public Malloced {
// searching all code objects). // searching all code objects).
Code* FindDeoptimizingCode(Address addr); Code* FindDeoptimizingCode(Address addr);
// Fill the input from from a JavaScript frame. This is used when
// the debugger needs to inspect an optimized frame. For normal
// deoptimizations the input frame is filled in generated code.
void FillInputFrame(Address tos, JavaScriptFrame* frame);
// Fill the given output frame's registers to contain the failure handler // Fill the given output frame's registers to contain the failure handler
// address and the number of parameters for a stub failure trampoline. // address and the number of parameters for a stub failure trampoline.
void SetPlatformCompiledStubRegisters(FrameDescription* output_frame, void SetPlatformCompiledStubRegisters(FrameDescription* output_frame,
...@@ -744,8 +736,7 @@ class RegisterValues { ...@@ -744,8 +736,7 @@ class RegisterValues {
class FrameDescription { class FrameDescription {
public: public:
FrameDescription(uint32_t frame_size, explicit FrameDescription(uint32_t frame_size, int parameter_count = 0);
JSFunction* function);
void* operator new(size_t size, uint32_t frame_size) { void* operator new(size_t size, uint32_t frame_size) {
// Subtracts kPointerSize, as the member frame_content_ already supplies // Subtracts kPointerSize, as the member frame_content_ already supplies
...@@ -766,8 +757,6 @@ class FrameDescription { ...@@ -766,8 +757,6 @@ class FrameDescription {
return static_cast<uint32_t>(frame_size_); return static_cast<uint32_t>(frame_size_);
} }
JSFunction* GetFunction() const { return function_; }
unsigned GetOffsetFromSlotIndex(int slot_index); unsigned GetOffsetFromSlotIndex(int slot_index);
intptr_t GetFrameSlot(unsigned offset) { intptr_t GetFrameSlot(unsigned offset) {
...@@ -775,8 +764,7 @@ class FrameDescription { ...@@ -775,8 +764,7 @@ class FrameDescription {
} }
Address GetFramePointerAddress() { Address GetFramePointerAddress() {
int fp_offset = GetFrameSize() - int fp_offset = GetFrameSize() - parameter_count() * kPointerSize -
(ComputeParametersCount() + 1) * kPointerSize -
StandardFrameConstants::kCallerSPOffset; StandardFrameConstants::kCallerSPOffset;
return reinterpret_cast<Address>(GetFrameSlotPointer(fp_offset)); return reinterpret_cast<Address>(GetFrameSlotPointer(fp_offset));
} }
...@@ -834,17 +822,8 @@ class FrameDescription { ...@@ -834,17 +822,8 @@ class FrameDescription {
StackFrame::Type GetFrameType() const { return type_; } StackFrame::Type GetFrameType() const { return type_; }
void SetFrameType(StackFrame::Type type) { type_ = type; } void SetFrameType(StackFrame::Type type) { type_ = type; }
// Get the incoming arguments count. // Argument count, including receiver.
int ComputeParametersCount(); int parameter_count() { return parameter_count_; }
// Get a parameter value for an unoptimized frame.
Object* GetParameter(int index);
// Get the expression stack height for a unoptimized frame.
unsigned GetExpressionCount();
// Get the expression stack value for an unoptimized frame.
Object* GetExpression(int index);
static int registers_offset() { static int registers_offset() {
return OFFSET_OF(FrameDescription, register_values_.registers_); return OFFSET_OF(FrameDescription, register_values_.registers_);
...@@ -877,7 +856,7 @@ class FrameDescription { ...@@ -877,7 +856,7 @@ class FrameDescription {
// keep the variable-size array frame_content_ of type intptr_t at // keep the variable-size array frame_content_ of type intptr_t at
// the end of the structure aligned. // the end of the structure aligned.
uintptr_t frame_size_; // Number of bytes. uintptr_t frame_size_; // Number of bytes.
JSFunction* function_; int parameter_count_;
RegisterValues register_values_; RegisterValues register_values_;
intptr_t top_; intptr_t top_;
intptr_t pc_; intptr_t pc_;
...@@ -1072,10 +1051,9 @@ class MaterializedObjectStore { ...@@ -1072,10 +1051,9 @@ class MaterializedObjectStore {
// formal parameter count. // formal parameter count.
class DeoptimizedFrameInfo : public Malloced { class DeoptimizedFrameInfo : public Malloced {
public: public:
DeoptimizedFrameInfo(Deoptimizer* deoptimizer, DeoptimizedFrameInfo(TranslatedState* state,
int frame_index, TranslatedState::iterator frame_it, Isolate* isolate);
bool has_arguments_adaptor,
bool has_construct_stub);
// Return the number of incoming arguments. // Return the number of incoming arguments.
int parameters_count() { return static_cast<int>(parameters_.size()); } int parameters_count() { return static_cast<int>(parameters_.size()); }
......
...@@ -169,27 +169,6 @@ void Deoptimizer::PatchCodeForDeoptimization(Isolate* isolate, Code* code) { ...@@ -169,27 +169,6 @@ void Deoptimizer::PatchCodeForDeoptimization(Isolate* isolate, Code* code) {
} }
void Deoptimizer::FillInputFrame(Address tos, JavaScriptFrame* frame) {
// Set the register values. The values are not important as there are no
// callee saved registers in JavaScript frames, so all registers are
// spilled. Registers ebp and esp are set to the correct values though.
for (int i = 0; i < Register::kNumRegisters; i++) {
input_->SetRegister(i, i * 4);
}
input_->SetRegister(esp.code(), reinterpret_cast<intptr_t>(frame->sp()));
input_->SetRegister(ebp.code(), reinterpret_cast<intptr_t>(frame->fp()));
for (int i = 0; i < XMMRegister::kMaxNumRegisters; i++) {
input_->SetDoubleRegister(i, 0.0);
}
// Fill the frame content from the actual data on the frame.
for (unsigned i = 0; i < input_->GetFrameSize(); i += kPointerSize) {
input_->SetFrameSlot(i, Memory::uint32_at(tos + i));
}
}
void Deoptimizer::SetPlatformCompiledStubRegisters( void Deoptimizer::SetPlatformCompiledStubRegisters(
FrameDescription* output_frame, CodeStubDescriptor* descriptor) { FrameDescription* output_frame, CodeStubDescriptor* descriptor) {
intptr_t handler = intptr_t handler =
......
...@@ -80,27 +80,6 @@ void Deoptimizer::PatchCodeForDeoptimization(Isolate* isolate, Code* code) { ...@@ -80,27 +80,6 @@ void Deoptimizer::PatchCodeForDeoptimization(Isolate* isolate, Code* code) {
} }
void Deoptimizer::FillInputFrame(Address tos, JavaScriptFrame* frame) {
// Set the register values. The values are not important as there are no
// callee saved registers in JavaScript frames, so all registers are
// spilled. Registers fp and sp are set to the correct values though.
for (int i = 0; i < Register::kNumRegisters; i++) {
input_->SetRegister(i, i * 4);
}
input_->SetRegister(sp.code(), reinterpret_cast<intptr_t>(frame->sp()));
input_->SetRegister(fp.code(), reinterpret_cast<intptr_t>(frame->fp()));
for (int i = 0; i < DoubleRegister::kMaxNumRegisters; i++) {
input_->SetDoubleRegister(i, 0.0);
}
// Fill the frame content from the actual data on the frame.
for (unsigned i = 0; i < input_->GetFrameSize(); i += kPointerSize) {
input_->SetFrameSlot(i, Memory::uint32_at(tos + i));
}
}
void Deoptimizer::SetPlatformCompiledStubRegisters( void Deoptimizer::SetPlatformCompiledStubRegisters(
FrameDescription* output_frame, CodeStubDescriptor* descriptor) { FrameDescription* output_frame, CodeStubDescriptor* descriptor) {
ApiFunction function(descriptor->deoptimization_handler()); ApiFunction function(descriptor->deoptimization_handler());
......
...@@ -80,27 +80,6 @@ void Deoptimizer::PatchCodeForDeoptimization(Isolate* isolate, Code* code) { ...@@ -80,27 +80,6 @@ void Deoptimizer::PatchCodeForDeoptimization(Isolate* isolate, Code* code) {
} }
void Deoptimizer::FillInputFrame(Address tos, JavaScriptFrame* frame) {
// Set the register values. The values are not important as there are no
// callee saved registers in JavaScript frames, so all registers are
// spilled. Registers fp and sp are set to the correct values though.
for (int i = 0; i < Register::kNumRegisters; i++) {
input_->SetRegister(i, i * 4);
}
input_->SetRegister(sp.code(), reinterpret_cast<intptr_t>(frame->sp()));
input_->SetRegister(fp.code(), reinterpret_cast<intptr_t>(frame->fp()));
for (int i = 0; i < DoubleRegister::kMaxNumRegisters; i++) {
input_->SetDoubleRegister(i, 0.0);
}
// Fill the frame content from the actual data on the frame.
for (unsigned i = 0; i < input_->GetFrameSize(); i += kPointerSize) {
input_->SetFrameSlot(i, Memory::uint64_at(tos + i));
}
}
void Deoptimizer::SetPlatformCompiledStubRegisters( void Deoptimizer::SetPlatformCompiledStubRegisters(
FrameDescription* output_frame, CodeStubDescriptor* descriptor) { FrameDescription* output_frame, CodeStubDescriptor* descriptor) {
ApiFunction function(descriptor->deoptimization_handler()); ApiFunction function(descriptor->deoptimization_handler());
......
...@@ -88,31 +88,6 @@ void Deoptimizer::PatchCodeForDeoptimization(Isolate* isolate, Code* code) { ...@@ -88,31 +88,6 @@ void Deoptimizer::PatchCodeForDeoptimization(Isolate* isolate, Code* code) {
} }
void Deoptimizer::FillInputFrame(Address tos, JavaScriptFrame* frame) {
// Set the register values. The values are not important as there are no
// callee saved registers in JavaScript frames, so all registers are
// spilled. Registers fp and sp are set to the correct values though.
// We ensure the values are Smis to avoid confusing the garbage
// collector in the event that any values are retreived and stored
// elsewhere.
for (int i = 0; i < Register::kNumRegisters; i++) {
input_->SetRegister(i, reinterpret_cast<intptr_t>(Smi::FromInt(i)));
}
input_->SetRegister(sp.code(), reinterpret_cast<intptr_t>(frame->sp()));
input_->SetRegister(fp.code(), reinterpret_cast<intptr_t>(frame->fp()));
for (int i = 0; i < DoubleRegister::kNumRegisters; i++) {
input_->SetDoubleRegister(i, 0.0);
}
// Fill the frame content from the actual data on the frame.
for (unsigned i = 0; i < input_->GetFrameSize(); i += kPointerSize) {
input_->SetFrameSlot(
i, reinterpret_cast<intptr_t>(Memory::Address_at(tos + i)));
}
}
void Deoptimizer::SetPlatformCompiledStubRegisters( void Deoptimizer::SetPlatformCompiledStubRegisters(
FrameDescription* output_frame, CodeStubDescriptor* descriptor) { FrameDescription* output_frame, CodeStubDescriptor* descriptor) {
ApiFunction function(descriptor->deoptimization_handler()); ApiFunction function(descriptor->deoptimization_handler());
......
...@@ -88,26 +88,6 @@ void Deoptimizer::PatchCodeForDeoptimization(Isolate* isolate, Code* code) { ...@@ -88,26 +88,6 @@ void Deoptimizer::PatchCodeForDeoptimization(Isolate* isolate, Code* code) {
} }
void Deoptimizer::FillInputFrame(Address tos, JavaScriptFrame* frame) {
// Set the register values. The values are not important as there are no
// callee saved registers in JavaScript frames, so all registers are
// spilled. Registers rbp and rsp are set to the correct values though.
for (int i = 0; i < Register::kNumRegisters; i++) {
input_->SetRegister(i, i * 4);
}
input_->SetRegister(rsp.code(), reinterpret_cast<intptr_t>(frame->sp()));
input_->SetRegister(rbp.code(), reinterpret_cast<intptr_t>(frame->fp()));
for (int i = 0; i < DoubleRegister::kMaxNumRegisters; i++) {
input_->SetDoubleRegister(i, 0.0);
}
// Fill the frame content from the actual data on the frame.
for (unsigned i = 0; i < input_->GetFrameSize(); i += kPointerSize) {
input_->SetFrameSlot(i, Memory::uintptr_at(tos + i));
}
}
void Deoptimizer::SetPlatformCompiledStubRegisters( void Deoptimizer::SetPlatformCompiledStubRegisters(
FrameDescription* output_frame, CodeStubDescriptor* descriptor) { FrameDescription* output_frame, CodeStubDescriptor* descriptor) {
intptr_t handler = intptr_t handler =
......
...@@ -169,27 +169,6 @@ void Deoptimizer::PatchCodeForDeoptimization(Isolate* isolate, Code* code) { ...@@ -169,27 +169,6 @@ void Deoptimizer::PatchCodeForDeoptimization(Isolate* isolate, Code* code) {
} }
void Deoptimizer::FillInputFrame(Address tos, JavaScriptFrame* frame) {
// Set the register values. The values are not important as there are no
// callee saved registers in JavaScript frames, so all registers are
// spilled. Registers ebp and esp are set to the correct values though.
for (int i = 0; i < Register::kNumRegisters; i++) {
input_->SetRegister(i, i * 4);
}
input_->SetRegister(esp.code(), reinterpret_cast<intptr_t>(frame->sp()));
input_->SetRegister(ebp.code(), reinterpret_cast<intptr_t>(frame->fp()));
for (int i = 0; i < X87Register::kMaxNumRegisters; i++) {
input_->SetDoubleRegister(i, 0.0);
}
// Fill the frame content from the actual data on the frame.
for (unsigned i = 0; i < input_->GetFrameSize(); i += kPointerSize) {
input_->SetFrameSlot(i, Memory::uint32_at(tos + i));
}
}
void Deoptimizer::SetPlatformCompiledStubRegisters( void Deoptimizer::SetPlatformCompiledStubRegisters(
FrameDescription* output_frame, CodeStubDescriptor* descriptor) { FrameDescription* output_frame, CodeStubDescriptor* descriptor) {
intptr_t handler = intptr_t handler =
......
...@@ -764,12 +764,6 @@ ...@@ -764,12 +764,6 @@
'regress/debug*': [SKIP], 'regress/debug*': [SKIP],
'regress/regress-debug*': [SKIP], 'regress/regress-debug*': [SKIP],
# TODO(yangguo,4690): Failing in debugger DebuggerInspectableFrame.
'for-in-opt': [FAIL],
'regress/regress-4309-2': [FAIL],
'regress/regress-4309-3': [FAIL],
'regress/regress-4309-1': [FAIL],
# TODO(yangguo,4690): debug-scopes.cc failure in ScopeIterator::Type # TODO(yangguo,4690): debug-scopes.cc failure in ScopeIterator::Type
# DCHECK(context_->IsFunctionContext() || !scope_info->HasContext()); # DCHECK(context_->IsFunctionContext() || !scope_info->HasContext());
'regress/regress-crbug-582051': [SKIP], 'regress/regress-crbug-582051': [SKIP],
......
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