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

Side by Side Diff: src/virtual-frame.cc

Issue 42324: Add a bit to a virtual frame element telling if it's been copied. Set... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 9 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
OLDNEW
1 // Copyright 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 // We do not allow copies of copies, so we follow one link to 86 // We do not allow copies of copies, so we follow one link to
87 // the actual backing store of a copy before making a copy. 87 // the actual backing store of a copy before making a copy.
88 index = target.index(); 88 index = target.index();
89 ASSERT(elements_[index].is_memory() || elements_[index].is_register()); 89 ASSERT(elements_[index].is_memory() || elements_[index].is_register());
90 // Fall through. 90 // Fall through.
91 91
92 case FrameElement::MEMORY: // Fall through. 92 case FrameElement::MEMORY: // Fall through.
93 case FrameElement::REGISTER: 93 case FrameElement::REGISTER:
94 // All copies are backed by memory or register locations. 94 // All copies are backed by memory or register locations.
95 result.type_ = 95 result.type_ =
96 FrameElement::TypeField::encode(FrameElement::COPY) | 96 FrameElement::TypeField::encode(FrameElement::COPY)
97 FrameElement::SyncField::encode(FrameElement::NOT_SYNCED); 97 | FrameElement::IsCopiedField::encode(false)
98 | FrameElement::SyncField::encode(FrameElement::NOT_SYNCED);
98 result.data_.index_ = index; 99 result.data_.index_ = index;
100 elements_[index].set_copied();
99 break; 101 break;
100 102
101 case FrameElement::INVALID: 103 case FrameElement::INVALID:
102 // We should not try to copy invalid elements. 104 // We should not try to copy invalid elements.
103 UNREACHABLE(); 105 UNREACHABLE();
104 break; 106 break;
105 } 107 }
106 return result; 108 return result;
107 } 109 }
108 110
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 bool same_constant = original.is_constant() 362 bool same_constant = original.is_constant()
361 && value->is_constant() 363 && value->is_constant()
362 && original.handle().is_identical_to(value->handle()); 364 && original.handle().is_identical_to(value->handle());
363 if (same_register || same_constant) { 365 if (same_register || same_constant) {
364 value->Unuse(); 366 value->Unuse();
365 return; 367 return;
366 } 368 }
367 369
368 // If the original may be a copy, adjust to preserve the copy-on-write 370 // If the original may be a copy, adjust to preserve the copy-on-write
369 // semantics of copied elements. 371 // semantics of copied elements.
370 if (original.is_register() || original.is_memory()) { 372 if (original.is_copied() &&
373 (original.is_register() || original.is_memory())) {
371 FrameElement ignored = AdjustCopies(frame_index); 374 FrameElement ignored = AdjustCopies(frame_index);
372 } 375 }
373 376
374 // If the original is a register reference, deallocate it. 377 // If the original is a register reference, deallocate it.
375 if (original.is_register()) { 378 if (original.is_register()) {
376 Unuse(original.reg()); 379 Unuse(original.reg());
377 } 380 }
378 381
379 FrameElement new_element; 382 FrameElement new_element;
380 if (value->is_register()) { 383 if (value->is_register()) {
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 for (int i = 0; i < kNumRegisters; i++) { 558 for (int i = 0; i < kNumRegisters; i++) {
556 if (frame_registers_.count(i) != other->frame_registers_.count(i)) { 559 if (frame_registers_.count(i) != other->frame_registers_.count(i)) {
557 return false; 560 return false;
558 } 561 }
559 } 562 }
560 563
561 return true; 564 return true;
562 } 565 }
563 566
564 } } // namespace v8::internal 567 } } // namespace v8::internal
OLDNEW
« src/virtual-frame.h ('K') | « src/virtual-frame.h ('k') | src/virtual-frame-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698