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/x64/lithium-codegen-x64.cc

Issue 6341008: Refactor recording of safepoints. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix presubmit. Created 9 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « src/x64/lithium-codegen-x64.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 477 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 for (int i = 0, length = inlined_closures->length(); 488 for (int i = 0, length = inlined_closures->length();
489 i < length; 489 i < length;
490 i++) { 490 i++) {
491 DefineDeoptimizationLiteral(inlined_closures->at(i)); 491 DefineDeoptimizationLiteral(inlined_closures->at(i));
492 } 492 }
493 493
494 inlined_function_count_ = deoptimization_literals_.length(); 494 inlined_function_count_ = deoptimization_literals_.length();
495 } 495 }
496 496
497 497
498 void LCodeGen::RecordSafepoint(
499 LPointerMap* pointers,
500 Safepoint::Kind kind,
501 int arguments,
502 int deoptimization_index) {
503 const ZoneList<LOperand*>* operands = pointers->operands();
504 Safepoint safepoint = safepoints_.DefineSafepoint(masm(),
505 kind, arguments, deoptimization_index);
506 for (int i = 0; i < operands->length(); i++) {
507 LOperand* pointer = operands->at(i);
508 if (pointer->IsStackSlot()) {
509 safepoint.DefinePointerSlot(pointer->index());
510 } else if (pointer->IsRegister() && (kind & Safepoint::kWithRegisters)) {
511 safepoint.DefinePointerRegister(ToRegister(pointer));
512 }
513 }
514 if (kind & Safepoint::kWithRegisters) {
515 // Register rsi always contains a pointer to the context.
516 safepoint.DefinePointerRegister(rsi);
517 }
518 }
519
520
498 void LCodeGen::RecordSafepoint(LPointerMap* pointers, 521 void LCodeGen::RecordSafepoint(LPointerMap* pointers,
499 int deoptimization_index) { 522 int deoptimization_index) {
500 const ZoneList<LOperand*>* operands = pointers->operands(); 523 RecordSafepoint(pointers, Safepoint::kSimple, 0, deoptimization_index);
501 Safepoint safepoint = safepoints_.DefineSafepoint(masm(),
502 deoptimization_index);
503 for (int i = 0; i < operands->length(); i++) {
504 LOperand* pointer = operands->at(i);
505 if (pointer->IsStackSlot()) {
506 safepoint.DefinePointerSlot(pointer->index());
507 }
508 }
509 } 524 }
510 525
511 526
512 void LCodeGen::RecordSafepointWithRegisters(LPointerMap* pointers, 527 void LCodeGen::RecordSafepointWithRegisters(LPointerMap* pointers,
513 int arguments, 528 int arguments,
514 int deoptimization_index) { 529 int deoptimization_index) {
515 const ZoneList<LOperand*>* operands = pointers->operands(); 530 RecordSafepoint(pointers, Safepoint::kWithRegisters, arguments,
516 Safepoint safepoint = 531 deoptimization_index);
517 safepoints_.DefineSafepointWithRegisters(
518 masm(), arguments, deoptimization_index);
519 for (int i = 0; i < operands->length(); i++) {
520 LOperand* pointer = operands->at(i);
521 if (pointer->IsStackSlot()) {
522 safepoint.DefinePointerSlot(pointer->index());
523 } else if (pointer->IsRegister()) {
524 safepoint.DefinePointerRegister(ToRegister(pointer));
525 }
526 }
527 // Register rsi always contains a pointer to the context.
528 safepoint.DefinePointerRegister(rsi);
529 } 532 }
530 533
531 534
532 void LCodeGen::RecordPosition(int position) { 535 void LCodeGen::RecordPosition(int position) {
533 if (!FLAG_debug_info || position == RelocInfo::kNoPosition) return; 536 if (!FLAG_debug_info || position == RelocInfo::kNoPosition) return;
534 masm()->positions_recorder()->RecordPosition(position); 537 masm()->positions_recorder()->RecordPosition(position);
535 } 538 }
536 539
537 540
538 void LCodeGen::DoLabel(LLabel* label) { 541 void LCodeGen::DoLabel(LLabel* label) {
(...skipping 1352 matching lines...) Expand 10 before | Expand all | Expand 10 after
1891 1894
1892 void LCodeGen::DoOsrEntry(LOsrEntry* instr) { 1895 void LCodeGen::DoOsrEntry(LOsrEntry* instr) {
1893 Abort("Unimplemented: %s", "DoOsrEntry"); 1896 Abort("Unimplemented: %s", "DoOsrEntry");
1894 } 1897 }
1895 1898
1896 #undef __ 1899 #undef __
1897 1900
1898 } } // namespace v8::internal 1901 } } // namespace v8::internal
1899 1902
1900 #endif // V8_TARGET_ARCH_X64 1903 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/lithium-codegen-x64.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698