OLD | NEW |
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_S390 | 8 #if V8_TARGET_ARCH_S390 |
9 | 9 |
10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
(...skipping 1288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1299 if (!*definitely_mismatches) { | 1299 if (!*definitely_mismatches) { |
1300 b(done); | 1300 b(done); |
1301 } | 1301 } |
1302 } else { | 1302 } else { |
1303 Jump(adaptor, RelocInfo::CODE_TARGET); | 1303 Jump(adaptor, RelocInfo::CODE_TARGET); |
1304 } | 1304 } |
1305 bind(®ular_invoke); | 1305 bind(®ular_invoke); |
1306 } | 1306 } |
1307 } | 1307 } |
1308 | 1308 |
1309 void MacroAssembler::FloodFunctionIfStepping(Register fun, Register new_target, | 1309 void MacroAssembler::CheckDebugHook(Register fun, Register new_target, |
1310 const ParameterCount& expected, | 1310 const ParameterCount& expected, |
1311 const ParameterCount& actual) { | 1311 const ParameterCount& actual) { |
1312 Label skip_flooding; | 1312 Label skip_hook; |
1313 ExternalReference last_step_action = | 1313 ExternalReference debug_hook_avtive = |
1314 ExternalReference::debug_last_step_action_address(isolate()); | 1314 ExternalReference::debug_hook_on_function_call_address(isolate()); |
1315 STATIC_ASSERT(StepFrame > StepIn); | 1315 mov(r6, Operand(debug_hook_avtive)); |
1316 mov(r6, Operand(last_step_action)); | |
1317 LoadB(r6, MemOperand(r6)); | 1316 LoadB(r6, MemOperand(r6)); |
1318 CmpP(r6, Operand(StepIn)); | 1317 CmpSmiLiteral(r6, Smi::kZero, r0); |
1319 blt(&skip_flooding); | 1318 beq(&skip_hook); |
1320 { | 1319 { |
1321 FrameScope frame(this, | 1320 FrameScope frame(this, |
1322 has_frame() ? StackFrame::NONE : StackFrame::INTERNAL); | 1321 has_frame() ? StackFrame::NONE : StackFrame::INTERNAL); |
1323 if (expected.is_reg()) { | 1322 if (expected.is_reg()) { |
1324 SmiTag(expected.reg()); | 1323 SmiTag(expected.reg()); |
1325 Push(expected.reg()); | 1324 Push(expected.reg()); |
1326 } | 1325 } |
1327 if (actual.is_reg()) { | 1326 if (actual.is_reg()) { |
1328 SmiTag(actual.reg()); | 1327 SmiTag(actual.reg()); |
1329 Push(actual.reg()); | 1328 Push(actual.reg()); |
1330 } | 1329 } |
1331 if (new_target.is_valid()) { | 1330 if (new_target.is_valid()) { |
1332 Push(new_target); | 1331 Push(new_target); |
1333 } | 1332 } |
1334 Push(fun, fun); | 1333 Push(fun, fun); |
1335 CallRuntime(Runtime::kDebugPrepareStepInIfStepping); | 1334 CallRuntime(Runtime::kDebugOnFunctionCall); |
1336 Pop(fun); | 1335 Pop(fun); |
1337 if (new_target.is_valid()) { | 1336 if (new_target.is_valid()) { |
1338 Pop(new_target); | 1337 Pop(new_target); |
1339 } | 1338 } |
1340 if (actual.is_reg()) { | 1339 if (actual.is_reg()) { |
1341 Pop(actual.reg()); | 1340 Pop(actual.reg()); |
1342 SmiUntag(actual.reg()); | 1341 SmiUntag(actual.reg()); |
1343 } | 1342 } |
1344 if (expected.is_reg()) { | 1343 if (expected.is_reg()) { |
1345 Pop(expected.reg()); | 1344 Pop(expected.reg()); |
1346 SmiUntag(expected.reg()); | 1345 SmiUntag(expected.reg()); |
1347 } | 1346 } |
1348 } | 1347 } |
1349 bind(&skip_flooding); | 1348 bind(&skip_hook); |
1350 } | 1349 } |
1351 | 1350 |
1352 void MacroAssembler::InvokeFunctionCode(Register function, Register new_target, | 1351 void MacroAssembler::InvokeFunctionCode(Register function, Register new_target, |
1353 const ParameterCount& expected, | 1352 const ParameterCount& expected, |
1354 const ParameterCount& actual, | 1353 const ParameterCount& actual, |
1355 InvokeFlag flag, | 1354 InvokeFlag flag, |
1356 const CallWrapper& call_wrapper) { | 1355 const CallWrapper& call_wrapper) { |
1357 // You can't call a function without a valid frame. | 1356 // You can't call a function without a valid frame. |
1358 DCHECK(flag == JUMP_FUNCTION || has_frame()); | 1357 DCHECK(flag == JUMP_FUNCTION || has_frame()); |
1359 | 1358 |
1360 DCHECK(function.is(r3)); | 1359 DCHECK(function.is(r3)); |
1361 DCHECK_IMPLIES(new_target.is_valid(), new_target.is(r5)); | 1360 DCHECK_IMPLIES(new_target.is_valid(), new_target.is(r5)); |
1362 | 1361 |
1363 if (call_wrapper.NeedsDebugStepCheck()) { | 1362 if (call_wrapper.NeedsDebugHookCheck()) { |
1364 FloodFunctionIfStepping(function, new_target, expected, actual); | 1363 CheckDebugHook(function, new_target, expected, actual); |
1365 } | 1364 } |
1366 | 1365 |
1367 // Clear the new.target register if not given. | 1366 // Clear the new.target register if not given. |
1368 if (!new_target.is_valid()) { | 1367 if (!new_target.is_valid()) { |
1369 LoadRoot(r5, Heap::kUndefinedValueRootIndex); | 1368 LoadRoot(r5, Heap::kUndefinedValueRootIndex); |
1370 } | 1369 } |
1371 | 1370 |
1372 Label done; | 1371 Label done; |
1373 bool definitely_mismatches = false; | 1372 bool definitely_mismatches = false; |
1374 InvokePrologue(expected, actual, &done, &definitely_mismatches, flag, | 1373 InvokePrologue(expected, actual, &done, &definitely_mismatches, flag, |
(...skipping 3764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5139 } | 5138 } |
5140 if (mag.shift > 0) ShiftRightArith(result, result, Operand(mag.shift)); | 5139 if (mag.shift > 0) ShiftRightArith(result, result, Operand(mag.shift)); |
5141 ExtractBit(r0, dividend, 31); | 5140 ExtractBit(r0, dividend, 31); |
5142 AddP(result, r0); | 5141 AddP(result, r0); |
5143 } | 5142 } |
5144 | 5143 |
5145 } // namespace internal | 5144 } // namespace internal |
5146 } // namespace v8 | 5145 } // namespace v8 |
5147 | 5146 |
5148 #endif // V8_TARGET_ARCH_S390 | 5147 #endif // V8_TARGET_ARCH_S390 |
OLD | NEW |