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

Side by Side Diff: src/ia32/lithium-codegen-ia32.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, 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 | Annotate | Revision Log
« no previous file with comments | « src/ia32/lithium-codegen-ia32.h ('k') | src/safepoint-table.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 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 548 matching lines...) Expand 10 before | Expand all | Expand 10 after
559 for (int i = 0, length = inlined_closures->length(); 559 for (int i = 0, length = inlined_closures->length();
560 i < length; 560 i < length;
561 i++) { 561 i++) {
562 DefineDeoptimizationLiteral(inlined_closures->at(i)); 562 DefineDeoptimizationLiteral(inlined_closures->at(i));
563 } 563 }
564 564
565 inlined_function_count_ = deoptimization_literals_.length(); 565 inlined_function_count_ = deoptimization_literals_.length();
566 } 566 }
567 567
568 568
569 void LCodeGen::RecordSafepoint(
570 LPointerMap* pointers,
571 Safepoint::Kind kind,
572 int arguments,
573 int deoptimization_index) {
574 const ZoneList<LOperand*>* operands = pointers->operands();
575 Safepoint safepoint = safepoints_.DefineSafepoint(masm(),
576 kind, arguments, deoptimization_index);
577 for (int i = 0; i < operands->length(); i++) {
578 LOperand* pointer = operands->at(i);
579 if (pointer->IsStackSlot()) {
580 safepoint.DefinePointerSlot(pointer->index());
581 } else if (pointer->IsRegister() && (kind & Safepoint::kWithRegisters)) {
582 safepoint.DefinePointerRegister(ToRegister(pointer));
583 }
584 }
585 if (kind & Safepoint::kWithRegisters) {
586 // Register esi always contains a pointer to the context.
587 safepoint.DefinePointerRegister(esi);
588 }
589 }
590
591
569 void LCodeGen::RecordSafepoint(LPointerMap* pointers, 592 void LCodeGen::RecordSafepoint(LPointerMap* pointers,
570 int deoptimization_index) { 593 int deoptimization_index) {
571 const ZoneList<LOperand*>* operands = pointers->operands(); 594 RecordSafepoint(pointers, Safepoint::kSimple, 0, deoptimization_index);
572 Safepoint safepoint = safepoints_.DefineSafepoint(masm(),
573 deoptimization_index);
574 for (int i = 0; i < operands->length(); i++) {
575 LOperand* pointer = operands->at(i);
576 if (pointer->IsStackSlot()) {
577 safepoint.DefinePointerSlot(pointer->index());
578 }
579 }
580 } 595 }
581 596
582 597
583 void LCodeGen::RecordSafepointWithRegisters(LPointerMap* pointers, 598 void LCodeGen::RecordSafepointWithRegisters(LPointerMap* pointers,
584 int arguments, 599 int arguments,
585 int deoptimization_index) { 600 int deoptimization_index) {
586 const ZoneList<LOperand*>* operands = pointers->operands(); 601 RecordSafepoint(pointers, Safepoint::kWithRegisters, arguments,
587 Safepoint safepoint = 602 deoptimization_index);
588 safepoints_.DefineSafepointWithRegisters(
589 masm(), arguments, deoptimization_index);
590 for (int i = 0; i < operands->length(); i++) {
591 LOperand* pointer = operands->at(i);
592 if (pointer->IsStackSlot()) {
593 safepoint.DefinePointerSlot(pointer->index());
594 } else if (pointer->IsRegister()) {
595 safepoint.DefinePointerRegister(ToRegister(pointer));
596 }
597 }
598 // Register esi always contains a pointer to the context.
599 safepoint.DefinePointerRegister(esi);
600 } 603 }
601 604
602 605
603 void LCodeGen::RecordPosition(int position) { 606 void LCodeGen::RecordPosition(int position) {
604 if (!FLAG_debug_info || position == RelocInfo::kNoPosition) return; 607 if (!FLAG_debug_info || position == RelocInfo::kNoPosition) return;
605 masm()->positions_recorder()->RecordPosition(position); 608 masm()->positions_recorder()->RecordPosition(position);
606 } 609 }
607 610
608 611
609 void LCodeGen::DoLabel(LLabel* label) { 612 void LCodeGen::DoLabel(LLabel* label) {
(...skipping 2986 matching lines...) Expand 10 before | Expand all | Expand 10 after
3596 ASSERT(osr_pc_offset_ == -1); 3599 ASSERT(osr_pc_offset_ == -1);
3597 osr_pc_offset_ = masm()->pc_offset(); 3600 osr_pc_offset_ = masm()->pc_offset();
3598 } 3601 }
3599 3602
3600 3603
3601 #undef __ 3604 #undef __
3602 3605
3603 } } // namespace v8::internal 3606 } } // namespace v8::internal
3604 3607
3605 #endif // V8_TARGET_ARCH_IA32 3608 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/lithium-codegen-ia32.h ('k') | src/safepoint-table.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698