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

Side by Side Diff: src/ppc/macro-assembler-ppc.cc

Issue 2632513002: PPC/s390: [debugger] infrastructure for side-effect-free debug-evaluate. (Closed)
Patch Set: Created 3 years, 11 months 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 unified diff | Download patch
« no previous file with comments | « src/ppc/macro-assembler-ppc.h ('k') | src/s390/macro-assembler-s390.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <assert.h> // For assert 5 #include <assert.h> // For assert
6 #include <limits.h> // For LONG_MIN, LONG_MAX. 6 #include <limits.h> // For LONG_MIN, LONG_MAX.
7 7
8 #if V8_TARGET_ARCH_PPC 8 #if V8_TARGET_ARCH_PPC
9 9
10 #include "src/base/bits.h" 10 #include "src/base/bits.h"
(...skipping 1385 matching lines...) Expand 10 before | Expand all | Expand 10 after
1396 if (!*definitely_mismatches) { 1396 if (!*definitely_mismatches) {
1397 b(done); 1397 b(done);
1398 } 1398 }
1399 } else { 1399 } else {
1400 Jump(adaptor, RelocInfo::CODE_TARGET); 1400 Jump(adaptor, RelocInfo::CODE_TARGET);
1401 } 1401 }
1402 bind(&regular_invoke); 1402 bind(&regular_invoke);
1403 } 1403 }
1404 } 1404 }
1405 1405
1406 1406 void MacroAssembler::CheckDebugHook(Register fun, Register new_target,
1407 void MacroAssembler::FloodFunctionIfStepping(Register fun, Register new_target, 1407 const ParameterCount& expected,
1408 const ParameterCount& expected, 1408 const ParameterCount& actual) {
1409 const ParameterCount& actual) { 1409 Label skip_hook;
1410 Label skip_flooding; 1410 ExternalReference debug_hook_avtive =
1411 ExternalReference last_step_action = 1411 ExternalReference::debug_hook_on_function_call_address(isolate());
1412 ExternalReference::debug_last_step_action_address(isolate()); 1412 mov(r7, Operand(debug_hook_avtive));
1413 STATIC_ASSERT(StepFrame > StepIn);
1414 mov(r7, Operand(last_step_action));
1415 LoadByte(r7, MemOperand(r7), r0); 1413 LoadByte(r7, MemOperand(r7), r0);
1416 extsb(r7, r7); 1414 extsb(r7, r7);
1417 cmpi(r7, Operand(StepIn)); 1415 CmpSmiLiteral(r7, Smi::kZero, r0);
1418 blt(&skip_flooding); 1416 beq(&skip_hook);
1419 { 1417 {
1420 FrameScope frame(this, 1418 FrameScope frame(this,
1421 has_frame() ? StackFrame::NONE : StackFrame::INTERNAL); 1419 has_frame() ? StackFrame::NONE : StackFrame::INTERNAL);
1422 if (expected.is_reg()) { 1420 if (expected.is_reg()) {
1423 SmiTag(expected.reg()); 1421 SmiTag(expected.reg());
1424 Push(expected.reg()); 1422 Push(expected.reg());
1425 } 1423 }
1426 if (actual.is_reg()) { 1424 if (actual.is_reg()) {
1427 SmiTag(actual.reg()); 1425 SmiTag(actual.reg());
1428 Push(actual.reg()); 1426 Push(actual.reg());
1429 } 1427 }
1430 if (new_target.is_valid()) { 1428 if (new_target.is_valid()) {
1431 Push(new_target); 1429 Push(new_target);
1432 } 1430 }
1433 Push(fun, fun); 1431 Push(fun, fun);
1434 CallRuntime(Runtime::kDebugPrepareStepInIfStepping); 1432 CallRuntime(Runtime::kDebugOnFunctionCall);
1435 Pop(fun); 1433 Pop(fun);
1436 if (new_target.is_valid()) { 1434 if (new_target.is_valid()) {
1437 Pop(new_target); 1435 Pop(new_target);
1438 } 1436 }
1439 if (actual.is_reg()) { 1437 if (actual.is_reg()) {
1440 Pop(actual.reg()); 1438 Pop(actual.reg());
1441 SmiUntag(actual.reg()); 1439 SmiUntag(actual.reg());
1442 } 1440 }
1443 if (expected.is_reg()) { 1441 if (expected.is_reg()) {
1444 Pop(expected.reg()); 1442 Pop(expected.reg());
1445 SmiUntag(expected.reg()); 1443 SmiUntag(expected.reg());
1446 } 1444 }
1447 } 1445 }
1448 bind(&skip_flooding); 1446 bind(&skip_hook);
1449 } 1447 }
1450 1448
1451 1449
1452 void MacroAssembler::InvokeFunctionCode(Register function, Register new_target, 1450 void MacroAssembler::InvokeFunctionCode(Register function, Register new_target,
1453 const ParameterCount& expected, 1451 const ParameterCount& expected,
1454 const ParameterCount& actual, 1452 const ParameterCount& actual,
1455 InvokeFlag flag, 1453 InvokeFlag flag,
1456 const CallWrapper& call_wrapper) { 1454 const CallWrapper& call_wrapper) {
1457 // You can't call a function without a valid frame. 1455 // You can't call a function without a valid frame.
1458 DCHECK(flag == JUMP_FUNCTION || has_frame()); 1456 DCHECK(flag == JUMP_FUNCTION || has_frame());
1459 DCHECK(function.is(r4)); 1457 DCHECK(function.is(r4));
1460 DCHECK_IMPLIES(new_target.is_valid(), new_target.is(r6)); 1458 DCHECK_IMPLIES(new_target.is_valid(), new_target.is(r6));
1461 1459
1462 if (call_wrapper.NeedsDebugStepCheck()) { 1460 if (call_wrapper.NeedsDebugHookCheck()) {
1463 FloodFunctionIfStepping(function, new_target, expected, actual); 1461 CheckDebugHook(function, new_target, expected, actual);
1464 } 1462 }
1465 1463
1466 // Clear the new.target register if not given. 1464 // Clear the new.target register if not given.
1467 if (!new_target.is_valid()) { 1465 if (!new_target.is_valid()) {
1468 LoadRoot(r6, Heap::kUndefinedValueRootIndex); 1466 LoadRoot(r6, Heap::kUndefinedValueRootIndex);
1469 } 1467 }
1470 1468
1471 Label done; 1469 Label done;
1472 bool definitely_mismatches = false; 1470 bool definitely_mismatches = false;
1473 InvokePrologue(expected, actual, &done, &definitely_mismatches, flag, 1471 InvokePrologue(expected, actual, &done, &definitely_mismatches, flag,
(...skipping 2914 matching lines...) Expand 10 before | Expand all | Expand 10 after
4388 } 4386 }
4389 if (mag.shift > 0) srawi(result, result, mag.shift); 4387 if (mag.shift > 0) srawi(result, result, mag.shift);
4390 ExtractBit(r0, dividend, 31); 4388 ExtractBit(r0, dividend, 31);
4391 add(result, result, r0); 4389 add(result, result, r0);
4392 } 4390 }
4393 4391
4394 } // namespace internal 4392 } // namespace internal
4395 } // namespace v8 4393 } // namespace v8
4396 4394
4397 #endif // V8_TARGET_ARCH_PPC 4395 #endif // V8_TARGET_ARCH_PPC
OLDNEW
« no previous file with comments | « src/ppc/macro-assembler-ppc.h ('k') | src/s390/macro-assembler-s390.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698