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

Side by Side Diff: src/hydrogen.cc

Issue 10537024: Add guard against self assignment. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 6 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 | « no previous file | 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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 1346 matching lines...) Expand 10 before | Expand all | Expand 10 after
1357 memset(data_, 0, kNumberOfTrackedSideEffects * kPointerSize); 1357 memset(data_, 0, kNumberOfTrackedSideEffects * kPointerSize);
1358 } 1358 }
1359 1359
1360 1360
1361 HSideEffectMap::HSideEffectMap(HSideEffectMap* other) : count_(other->count_) { 1361 HSideEffectMap::HSideEffectMap(HSideEffectMap* other) : count_(other->count_) {
1362 *this = *other; // Calls operator=. 1362 *this = *other; // Calls operator=.
1363 } 1363 }
1364 1364
1365 1365
1366 HSideEffectMap& HSideEffectMap::operator= (const HSideEffectMap& other) { 1366 HSideEffectMap& HSideEffectMap::operator= (const HSideEffectMap& other) {
1367 memcpy(data_, other.data_, kNumberOfTrackedSideEffects * kPointerSize); 1367 if (this != &other) {
1368 memcpy(data_, other.data_, kNumberOfTrackedSideEffects * kPointerSize);
1369 }
1368 return *this; 1370 return *this;
1369 } 1371 }
1370 1372
1371 void HSideEffectMap::Kill(GVNFlagSet flags) { 1373 void HSideEffectMap::Kill(GVNFlagSet flags) {
1372 for (int i = 0; i < kNumberOfTrackedSideEffects; i++) { 1374 for (int i = 0; i < kNumberOfTrackedSideEffects; i++) {
1373 GVNFlag changes_flag = HValue::ChangesFlagFromInt(i); 1375 GVNFlag changes_flag = HValue::ChangesFlagFromInt(i);
1374 if (flags.Contains(changes_flag)) { 1376 if (flags.Contains(changes_flag)) {
1375 if (data_[i] != NULL) count_--; 1377 if (data_[i] != NULL) count_--;
1376 data_[i] = NULL; 1378 data_[i] = NULL;
1377 } 1379 }
(...skipping 7749 matching lines...) Expand 10 before | Expand all | Expand 10 after
9127 } 9129 }
9128 } 9130 }
9129 9131
9130 #ifdef DEBUG 9132 #ifdef DEBUG
9131 if (graph_ != NULL) graph_->Verify(false); // No full verify. 9133 if (graph_ != NULL) graph_->Verify(false); // No full verify.
9132 if (allocator_ != NULL) allocator_->Verify(); 9134 if (allocator_ != NULL) allocator_->Verify();
9133 #endif 9135 #endif
9134 } 9136 }
9135 9137
9136 } } // namespace v8::internal 9138 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698