Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(803)

Unified Diff: src/arm64/macro-assembler-arm64.cc

Issue 1474943005: Revert of [debugger] flood function for stepping before calling it. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/arm64/macro-assembler-arm64.h ('k') | src/assembler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm64/macro-assembler-arm64.cc
diff --git a/src/arm64/macro-assembler-arm64.cc b/src/arm64/macro-assembler-arm64.cc
index b5ce1b8b1c0a1871dfedf226174395014eff5541..a27f625c5e2ea0e4858e4c018ab0fbbe67e91b1f 100644
--- a/src/arm64/macro-assembler-arm64.cc
+++ b/src/arm64/macro-assembler-arm64.cc
@@ -2539,7 +2539,7 @@
call_wrapper.AfterCall();
if (!*definitely_mismatches) {
// If the arg counts don't match, no extra code is emitted by
- // MAsm::InvokeFunctionCode and we can just fall through.
+ // MAsm::InvokeCode and we can just fall through.
B(done);
}
} else {
@@ -2550,62 +2550,18 @@
}
-void MacroAssembler::FloodFunctionIfStepping(Register fun, Register new_target,
- const ParameterCount& expected,
- const ParameterCount& actual) {
- Label skip_flooding;
- ExternalReference debug_step_action =
- ExternalReference::debug_last_step_action_address(isolate());
- Mov(x4, Operand(debug_step_action));
- ldrb(x4, MemOperand(x4));
- CompareAndBranch(x4, Operand(StepIn), ne, &skip_flooding);
- {
- FrameScope frame(this,
- has_frame() ? StackFrame::NONE : StackFrame::INTERNAL);
- if (expected.is_reg()) {
- SmiTag(expected.reg());
- Push(expected.reg());
- }
- if (actual.is_reg()) {
- SmiTag(actual.reg());
- Push(actual.reg());
- }
- if (new_target.is_valid()) {
- Push(new_target);
- }
- Push(fun);
- Push(fun);
- CallRuntime(Runtime::kDebugPrepareStepInIfStepping, 1);
- Pop(fun);
- if (new_target.is_valid()) {
- Pop(new_target);
- }
- if (actual.is_reg()) {
- Pop(actual.reg());
- SmiUntag(actual.reg());
- }
- if (expected.is_reg()) {
- Pop(expected.reg());
- SmiUntag(expected.reg());
- }
- }
- bind(&skip_flooding);
-}
-
-
-void MacroAssembler::InvokeFunctionCode(Register function, Register new_target,
- const ParameterCount& expected,
- const ParameterCount& actual,
- InvokeFlag flag,
- const CallWrapper& call_wrapper) {
+void MacroAssembler::InvokeCode(Register code,
+ Register new_target,
+ const ParameterCount& expected,
+ const ParameterCount& actual,
+ InvokeFlag flag,
+ const CallWrapper& call_wrapper) {
// You can't call a function without a valid frame.
DCHECK(flag == JUMP_FUNCTION || has_frame());
- DCHECK(function.is(x1));
+
+ // Ensure new target is passed in the correct register. Otherwise clear the
+ // appropriate register in case new target is not given.
DCHECK_IMPLIES(new_target.is_valid(), new_target.is(x3));
-
- FloodFunctionIfStepping(function, new_target, expected, actual);
-
- // Clear the new.target register if not given.
if (!new_target.is_valid()) {
LoadRoot(x3, Heap::kUndefinedValueRootIndex);
}
@@ -2619,11 +2575,6 @@
// have handled the call through the argument adaptor mechanism.
// The called function expects the call kind in x5.
if (!definitely_mismatches) {
- // We call indirectly through the code field in the function to
- // allow recompilation to take effect without changing any of the
- // call sites.
- Register code = x4;
- Ldr(code, FieldMemOperand(function, JSFunction::kCodeEntryOffset));
if (flag == CALL_FUNCTION) {
call_wrapper.BeforeCall(CallSize(code));
Call(code);
@@ -2653,6 +2604,7 @@
DCHECK(function.is(x1));
Register expected_reg = x2;
+ Register code_reg = x4;
Ldr(cp, FieldMemOperand(function, JSFunction::kContextOffset));
// The number of arguments is stored as an int32_t, and -1 is a marker
@@ -2663,10 +2615,11 @@
Ldrsw(expected_reg,
FieldMemOperand(expected_reg,
SharedFunctionInfo::kFormalParameterCountOffset));
+ Ldr(code_reg,
+ FieldMemOperand(function, JSFunction::kCodeEntryOffset));
ParameterCount expected(expected_reg);
- InvokeFunctionCode(function, new_target, expected, actual, flag,
- call_wrapper);
+ InvokeCode(code_reg, new_target, expected, actual, flag, call_wrapper);
}
@@ -2682,10 +2635,16 @@
// (See FullCodeGenerator::Generate().)
DCHECK(function.Is(x1));
+ Register code_reg = x4;
+
// Set up the context.
Ldr(cp, FieldMemOperand(function, JSFunction::kContextOffset));
- InvokeFunctionCode(function, no_reg, expected, actual, flag, call_wrapper);
+ // We call indirectly through the code field in the function to
+ // allow recompilation to take effect without changing any of the
+ // call sites.
+ Ldr(code_reg, FieldMemOperand(function, JSFunction::kCodeEntryOffset));
+ InvokeCode(code_reg, no_reg, expected, actual, flag, call_wrapper);
}
« no previous file with comments | « src/arm64/macro-assembler-arm64.h ('k') | src/assembler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698