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

Side by Side Diff: src/hydrogen-load-elimination.cc

Issue 244383002: Fix field type handling in load elimination. (Closed) Base URL: git@github.com:v8/v8.git@master
Patch Set: Created 6 years, 8 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
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/ia32/lithium-codegen-ia32.cc » ('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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 switch (instr->opcode()) { 71 switch (instr->opcode()) {
72 case HValue::kLoadNamedField: { 72 case HValue::kLoadNamedField: {
73 HLoadNamedField* l = HLoadNamedField::cast(instr); 73 HLoadNamedField* l = HLoadNamedField::cast(instr);
74 TRACE((" process L%d field %d (o%d)\n", 74 TRACE((" process L%d field %d (o%d)\n",
75 instr->id(), 75 instr->id(),
76 FieldOf(l->access()), 76 FieldOf(l->access()),
77 l->object()->ActualValue()->id())); 77 l->object()->ActualValue()->id()));
78 HValue* result = load(l); 78 HValue* result = load(l);
79 if (result != instr && 79 if (result != instr &&
80 result->type().Equals(instr->type()) && 80 result->type().Equals(instr->type()) &&
81 result->representation().Equals(instr->representation())) { 81 result->representation().Equals(instr->representation()) &&
82 (!result->IsLoadNamedField() ||
83 HLoadNamedField::cast(instr)->map_set()->IsSubset(
84 HLoadNamedField::cast(result)->map_set()))) {
82 // The load can be replaced with a previous load or a value. 85 // The load can be replaced with a previous load or a value.
83 TRACE((" replace L%d -> v%d\n", instr->id(), result->id())); 86 TRACE((" replace L%d -> v%d\n", instr->id(), result->id()));
84 instr->DeleteAndReplaceWith(result); 87 instr->DeleteAndReplaceWith(result);
85 } 88 }
86 break; 89 break;
87 } 90 }
88 case HValue::kStoreNamedField: { 91 case HValue::kStoreNamedField: {
89 HStoreNamedField* s = HStoreNamedField::cast(instr); 92 HStoreNamedField* s = HStoreNamedField::cast(instr);
90 TRACE((" process S%d field %d (o%d) = v%d\n", 93 TRACE((" process S%d field %d (o%d) = v%d\n",
91 instr->id(), 94 instr->id(),
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 } else { 531 } else {
529 // Perform only local analysis. 532 // Perform only local analysis.
530 for (int i = 0; i < graph()->blocks()->length(); i++) { 533 for (int i = 0; i < graph()->blocks()->length(); i++) {
531 table->Kill(); 534 table->Kill();
532 engine.AnalyzeOneBlock(graph()->blocks()->at(i), table); 535 engine.AnalyzeOneBlock(graph()->blocks()->at(i), table);
533 } 536 }
534 } 537 }
535 } 538 }
536 539
537 } } // namespace v8::internal 540 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698