Commit d1ffd45e authored by jgruber's avatar jgruber Committed by Commit Bot

[debug] Untangle DebugInfo from break point support (mips,mips64)

The mips/mips64 port of http://crrev.com/2909893002. Original commit message:

DebugInfo was very closely tied to break point support:
* It contained only information relevant to break points.
* It was created and freed by break point implementation.
* Existence of a DebugInfo on the shared function info implied existence of
  break points.

This CL is a step towards making DebugInfo usable by other debugging
functionality such as block coverage by decoupling it from break point support,
which is now only one kind of information stored on the DebugInfo object.

BUG=v8:6000

Change-Id: Ia770ff3c048022652d8abbe30d372fde5cb452a4
Reviewed-on: https://chromium-review.googlesource.com/528112Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45807}
parent 6738bbeb
......@@ -1042,14 +1042,12 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
// Get the bytecode array from the function object (or from the DebugInfo if
// it is present) and load it into kInterpreterBytecodeArrayRegister.
Label maybe_load_debug_bytecode_array, bytecode_array_loaded;
__ lw(a0, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset));
Label load_debug_bytecode_array, bytecode_array_loaded;
Register debug_info = kInterpreterBytecodeArrayRegister;
DCHECK(!debug_info.is(a0));
__ lw(debug_info, FieldMemOperand(a0, SharedFunctionInfo::kDebugInfoOffset));
__ JumpIfNotSmi(debug_info, &load_debug_bytecode_array);
__ lw(kInterpreterBytecodeArrayRegister,
FieldMemOperand(a0, SharedFunctionInfo::kFunctionDataOffset));
__ lw(t0, FieldMemOperand(a0, SharedFunctionInfo::kDebugInfoOffset));
__ JumpIfNotSmi(t0, &maybe_load_debug_bytecode_array);
__ bind(&bytecode_array_loaded);
// Check whether we should continue to use the interpreter.
......@@ -1141,10 +1139,16 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
LeaveInterpreterFrame(masm, t0);
__ Jump(ra);
// Load debug copy of the bytecode array.
__ bind(&load_debug_bytecode_array);
// Load debug copy of the bytecode array if it exists.
// kInterpreterBytecodeArrayRegister is already loaded with
// SharedFunctionInfo::kFunctionDataOffset.
__ bind(&maybe_load_debug_bytecode_array);
__ lw(t1, FieldMemOperand(t0, DebugInfo::kFlagsOffset));
__ SmiUntag(t1);
__ And(t1, t1, Operand(DebugInfo::kHasBreakInfo));
__ Branch(&bytecode_array_loaded, eq, t1, Operand(zero_reg));
__ lw(kInterpreterBytecodeArrayRegister,
FieldMemOperand(debug_info, DebugInfo::kDebugBytecodeArrayOffset));
FieldMemOperand(t0, DebugInfo::kDebugBytecodeArrayOffset));
__ Branch(&bytecode_array_loaded);
// If the shared code is no longer this entry trampoline, then the underlying
......
......@@ -1043,14 +1043,12 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
// Get the bytecode array from the function object (or from the DebugInfo if
// it is present) and load it into kInterpreterBytecodeArrayRegister.
Label maybe_load_debug_bytecode_array, bytecode_array_loaded;
__ Ld(a0, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset));
Label load_debug_bytecode_array, bytecode_array_loaded;
Register debug_info = kInterpreterBytecodeArrayRegister;
DCHECK(!debug_info.is(a0));
__ Ld(debug_info, FieldMemOperand(a0, SharedFunctionInfo::kDebugInfoOffset));
__ JumpIfNotSmi(debug_info, &load_debug_bytecode_array);
__ Ld(kInterpreterBytecodeArrayRegister,
FieldMemOperand(a0, SharedFunctionInfo::kFunctionDataOffset));
__ Ld(a4, FieldMemOperand(a0, SharedFunctionInfo::kDebugInfoOffset));
__ JumpIfNotSmi(a4, &maybe_load_debug_bytecode_array);
__ bind(&bytecode_array_loaded);
// Check whether we should continue to use the interpreter.
......@@ -1142,10 +1140,16 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
LeaveInterpreterFrame(masm, t0);
__ Jump(ra);
// Load debug copy of the bytecode array.
__ bind(&load_debug_bytecode_array);
// Load debug copy of the bytecode array if it exists.
// kInterpreterBytecodeArrayRegister is already loaded with
// SharedFunctionInfo::kFunctionDataOffset.
__ bind(&maybe_load_debug_bytecode_array);
__ Ld(a5, FieldMemOperand(a4, DebugInfo::kFlagsOffset));
__ SmiUntag(a5);
__ And(a5, a5, Operand(DebugInfo::kHasBreakInfo));
__ Branch(&bytecode_array_loaded, eq, a5, Operand(zero_reg));
__ Ld(kInterpreterBytecodeArrayRegister,
FieldMemOperand(debug_info, DebugInfo::kDebugBytecodeArrayOffset));
FieldMemOperand(a4, DebugInfo::kDebugBytecodeArrayOffset));
__ Branch(&bytecode_array_loaded);
// If the shared code is no longer this entry trampoline, then the underlying
......
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