Changeset 220921 in webkit for trunk/Source/JavaScriptCore/assembler/testmasm.cpp
- Timestamp:
- Aug 18, 2017, 10:54:50 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/assembler/testmasm.cpp
r220823 r220921 185 185 #endif 186 186 187 jit.probe([&] (Probe Context* context) {187 jit.probe([&] (Probe::State* context) { 188 188 auto& cpu = context->cpu; 189 189 probeWasCalled = true; … … 227 227 228 228 // Write expected values. 229 jit.probe([&] (Probe Context* context) {229 jit.probe([&] (Probe::State* context) { 230 230 auto& cpu = context->cpu; 231 231 probeCallCount++; … … 240 240 241 241 // Validate that expected values were written. 242 jit.probe([&] (Probe Context* context) {242 jit.probe([&] (Probe::State* context) { 243 243 auto& cpu = context->cpu; 244 244 probeCallCount++; … … 283 283 284 284 // Write expected values into the registers (except for sp, fp, and pc). 285 jit.probe([&] (Probe Context* context) {285 jit.probe([&] (Probe::State* context) { 286 286 auto& cpu = context->cpu; 287 287 probeCallCount++; … … 299 299 300 300 // Invoke the probe to call a lot of functions and trash register values. 301 jit.probe([&] (Probe Context*) {301 jit.probe([&] (Probe::State*) { 302 302 probeCallCount++; 303 303 CHECK_EQ(testFunctionToTrashGPRs(0, 1, 2, 3, 4, 5, 6, 7, 8, 9), 10); … … 306 306 307 307 // Validate that the registers have the expected values. 308 jit.probe([&] (Probe Context* context) {308 jit.probe([&] (Probe::State* context) { 309 309 auto& cpu = context->cpu; 310 310 probeCallCount++; … … 323 323 324 324 // Restore the original state. 325 jit.probe([&] (Probe Context* context) {325 jit.probe([&] (Probe::State* context) { 326 326 auto& cpu = context->cpu; 327 327 probeCallCount++; … … 336 336 337 337 // Validate that the original state was restored. 338 jit.probe([&] (Probe Context* context) {338 jit.probe([&] (Probe::State* context) { 339 339 auto& cpu = context->cpu; 340 340 probeCallCount++; … … 354 354 } 355 355 356 void testProbeModifiesStackPointer(WTF::Function<void*(Probe Context*)> computeModifiedStack)356 void testProbeModifiesStackPointer(WTF::Function<void*(Probe::State*)> computeModifiedStack) 357 357 { 358 358 unsigned probeCallCount = 0; … … 378 378 // Preserve original stack pointer and modify the sp, and 379 379 // write expected values into other registers (except for fp, and pc). 380 jit.probe([&] (Probe Context* context) {380 jit.probe([&] (Probe::State* context) { 381 381 auto& cpu = context->cpu; 382 382 probeCallCount++; … … 402 402 403 403 // Validate that the registers have the expected values. 404 jit.probe([&] (Probe Context* context) {404 jit.probe([&] (Probe::State* context) { 405 405 auto& cpu = context->cpu; 406 406 probeCallCount++; … … 421 421 422 422 // Restore the original state. 423 jit.probe([&] (Probe Context* context) {423 jit.probe([&] (Probe::State* context) { 424 424 auto& cpu = context->cpu; 425 425 probeCallCount++; … … 436 436 437 437 // Validate that the original state was restored. 438 jit.probe([&] (Probe Context* context) {438 jit.probe([&] (Probe::State* context) { 439 439 auto& cpu = context->cpu; 440 440 probeCallCount++; … … 456 456 } 457 457 458 void testProbeModifiesStackPointerToInsideProbe ContextOnStack()458 void testProbeModifiesStackPointerToInsideProbeStateOnStack() 459 459 { 460 460 size_t increment = sizeof(uintptr_t); … … 463 463 increment = 2 * sizeof(uintptr_t); 464 464 #endif 465 for (size_t offset = 0; offset < sizeof(Probe Context); offset += increment) {466 testProbeModifiesStackPointer([=] (Probe Context* context) -> void* {465 for (size_t offset = 0; offset < sizeof(Probe::State); offset += increment) { 466 testProbeModifiesStackPointer([=] (Probe::State* context) -> void* { 467 467 return reinterpret_cast<uint8_t*>(context) + offset; 468 468 }); … … 478 478 #endif 479 479 for (size_t offset = 0; offset < 1 * KB; offset += increment) { 480 testProbeModifiesStackPointer([=] (Probe Context* context) -> void* {480 testProbeModifiesStackPointer([=] (Probe::State* context) -> void* { 481 481 return reinterpret_cast<uint8_t*>(context->cpu.sp()) - offset; 482 482 }); … … 494 494 MacroAssemblerCodeRef continuation = compile([&] (CCallHelpers& jit) { 495 495 // Validate that we reached the continuation. 496 jit.probe([&] (Probe Context*) {496 jit.probe([&] (Probe::State*) { 497 497 probeCallCount++; 498 498 continuationWasReached = true; … … 507 507 508 508 // Write expected values into the registers. 509 jit.probe([&] (Probe Context* context) {509 jit.probe([&] (Probe::State* context) { 510 510 probeCallCount++; 511 511 context->pc() = continuation.code().executableAddress(); … … 526 526 }; 527 527 528 static void fillStack(Probe Context* context)528 static void fillStack(Probe::State* context) 529 529 { 530 530 auto& cpu = context->cpu; … … 540 540 CHECK_EQ(cpu.sp(), newSP); 541 541 542 // Verify that the probe has put the Probe Contextout of harm's way.542 // Verify that the probe has put the Probe::State out of harm's way. 543 543 CHECK_EQ((reinterpret_cast<void*>(context + 1) <= cpu.sp()), true); 544 544 … … 590 590 591 591 // Write expected values into the registers. 592 jit.probe([&] (Probe Context* context) {592 jit.probe([&] (Probe::State* context) { 593 593 auto& cpu = context->cpu; 594 594 probeCallCount++; … … 615 615 context->initializeStackArg = &data; 616 616 617 // Ensure that we'll be writing over the regions of the stack where the Probe Contextis.617 // Ensure that we'll be writing over the regions of the stack where the Probe::State is. 618 618 originalSP = cpu.sp(); 619 619 newSP = reinterpret_cast<uintptr_t*>(context) - numberOfExtraEntriesToWrite; … … 622 622 623 623 // Validate that the registers and stack have the expected values. 624 jit.probe([&] (Probe Context* context) {624 jit.probe([&] (Probe::State* context) { 625 625 auto& cpu = context->cpu; 626 626 probeCallCount++; … … 649 649 650 650 // Restore the original state. 651 jit.probe([&] (Probe Context* context) {651 jit.probe([&] (Probe::State* context) { 652 652 auto& cpu = context->cpu; 653 653 probeCallCount++; … … 701 701 RUN(testProbeWritesArgumentRegisters()); 702 702 RUN(testProbePreservesGPRS()); 703 RUN(testProbeModifiesStackPointerToInsideProbe ContextOnStack());703 RUN(testProbeModifiesStackPointerToInsideProbeStateOnStack()); 704 704 RUN(testProbeModifiesStackPointerToNBytesBelowSP()); 705 705 RUN(testProbeModifiesProgramCounter());
Note:
See TracChangeset
for help on using the changeset viewer.