Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 1329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1340 | 1340 |
| 1341 ASSERT(function_address.is(x1) || function_address.is(x2)); | 1341 ASSERT(function_address.is(x1) || function_address.is(x2)); |
| 1342 | 1342 |
| 1343 Label profiler_disabled; | 1343 Label profiler_disabled; |
| 1344 Label end_profiler_check; | 1344 Label end_profiler_check; |
| 1345 bool* is_profiling_flag = isolate()->cpu_profiler()->is_profiling_address(); | 1345 bool* is_profiling_flag = isolate()->cpu_profiler()->is_profiling_address(); |
| 1346 STATIC_ASSERT(sizeof(*is_profiling_flag) == 1); | 1346 STATIC_ASSERT(sizeof(*is_profiling_flag) == 1); |
| 1347 Mov(x10, reinterpret_cast<uintptr_t>(is_profiling_flag)); | 1347 Mov(x10, reinterpret_cast<uintptr_t>(is_profiling_flag)); |
| 1348 Ldrb(w10, MemOperand(x10)); | 1348 Ldrb(w10, MemOperand(x10)); |
| 1349 Cbz(w10, &profiler_disabled); | 1349 Cbz(w10, &profiler_disabled); |
| 1350 Mov(x3, Operand(thunk_ref)); | |
|
ulan
2014/02/10 20:21:23
I took this from the ARM port.
jbramley
2014/02/11 10:45:25
Ah, I must have overlooked it in the merge.
Out o
dcarney
2014/02/11 15:19:29
the profiler is almost always disabled
after clean
| |
| 1351 B(&end_profiler_check); | |
| 1350 | 1352 |
| 1351 // Additional parameter is the address of the actual callback. | 1353 Bind(&profiler_disabled); |
| 1352 Mov(function_address, Operand(thunk_ref)); | 1354 Mov(x3, function_address); |
| 1353 if (!function_address.Is(x3)) { | 1355 Bind(&end_profiler_check); |
| 1354 B(&end_profiler_check); | |
| 1355 Bind(&profiler_disabled); | |
| 1356 Mov(x3, function_address); | |
| 1357 Bind(&end_profiler_check); | |
| 1358 } else { | |
| 1359 Bind(&profiler_disabled); | |
| 1360 Bind(&end_profiler_check); | |
| 1361 } | |
| 1362 | 1356 |
| 1363 // Save the callee-save registers we are going to use. | 1357 // Save the callee-save registers we are going to use. |
| 1364 // TODO(all): Is this necessary? ARM doesn't do it. | 1358 // TODO(all): Is this necessary? ARM doesn't do it. |
| 1365 STATIC_ASSERT(kCallApiFunctionSpillSpace == 4); | 1359 STATIC_ASSERT(kCallApiFunctionSpillSpace == 4); |
| 1366 Poke(x19, (spill_offset + 0) * kXRegSizeInBytes); | 1360 Poke(x19, (spill_offset + 0) * kXRegSizeInBytes); |
| 1367 Poke(x20, (spill_offset + 1) * kXRegSizeInBytes); | 1361 Poke(x20, (spill_offset + 1) * kXRegSizeInBytes); |
| 1368 Poke(x21, (spill_offset + 2) * kXRegSizeInBytes); | 1362 Poke(x21, (spill_offset + 2) * kXRegSizeInBytes); |
| 1369 Poke(x22, (spill_offset + 3) * kXRegSizeInBytes); | 1363 Poke(x22, (spill_offset + 3) * kXRegSizeInBytes); |
| 1370 | 1364 |
| 1371 // Allocate HandleScope in callee-save registers. | 1365 // Allocate HandleScope in callee-save registers. |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 1388 PushSafepointRegisters(); | 1382 PushSafepointRegisters(); |
| 1389 Mov(x0, Operand(ExternalReference::isolate_address(isolate()))); | 1383 Mov(x0, Operand(ExternalReference::isolate_address(isolate()))); |
| 1390 CallCFunction(ExternalReference::log_enter_external_function(isolate()), 1); | 1384 CallCFunction(ExternalReference::log_enter_external_function(isolate()), 1); |
| 1391 PopSafepointRegisters(); | 1385 PopSafepointRegisters(); |
| 1392 } | 1386 } |
| 1393 | 1387 |
| 1394 // Native call returns to the DirectCEntry stub which redirects to the | 1388 // Native call returns to the DirectCEntry stub which redirects to the |
| 1395 // return address pushed on stack (could have moved after GC). | 1389 // return address pushed on stack (could have moved after GC). |
| 1396 // DirectCEntry stub itself is generated early and never moves. | 1390 // DirectCEntry stub itself is generated early and never moves. |
| 1397 DirectCEntryStub stub; | 1391 DirectCEntryStub stub; |
| 1398 stub.GenerateCall(this, function_address); | 1392 stub.GenerateCall(this, x3); |
| 1399 | 1393 |
| 1400 if (FLAG_log_timer_events) { | 1394 if (FLAG_log_timer_events) { |
| 1401 FrameScope frame(this, StackFrame::MANUAL); | 1395 FrameScope frame(this, StackFrame::MANUAL); |
| 1402 PushSafepointRegisters(); | 1396 PushSafepointRegisters(); |
| 1403 Mov(x0, Operand(ExternalReference::isolate_address(isolate()))); | 1397 Mov(x0, Operand(ExternalReference::isolate_address(isolate()))); |
| 1404 CallCFunction(ExternalReference::log_leave_external_function(isolate()), 1); | 1398 CallCFunction(ExternalReference::log_leave_external_function(isolate()), 1); |
| 1405 PopSafepointRegisters(); | 1399 PopSafepointRegisters(); |
| 1406 } | 1400 } |
| 1407 | 1401 |
| 1408 Label promote_scheduled_exception; | 1402 Label promote_scheduled_exception; |
| (...skipping 3393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4802 } | 4796 } |
| 4803 } | 4797 } |
| 4804 | 4798 |
| 4805 | 4799 |
| 4806 #undef __ | 4800 #undef __ |
| 4807 | 4801 |
| 4808 | 4802 |
| 4809 } } // namespace v8::internal | 4803 } } // namespace v8::internal |
| 4810 | 4804 |
| 4811 #endif // V8_TARGET_ARCH_A64 | 4805 #endif // V8_TARGET_ARCH_A64 |
| OLD | NEW |