Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 266 if (access.IsInobject()) { | 266 if (access.IsInobject()) { |
| 267 int offset = access.offset(); | 267 int offset = access.offset(); |
| 268 if ((offset % kPointerSize) != 0) { | 268 if ((offset % kPointerSize) != 0) { |
| 269 // Kill the field containing the first word of the access. | 269 // Kill the field containing the first word of the access. |
| 270 HValue* object = instr->object()->ActualValue(); | 270 HValue* object = instr->object()->ActualValue(); |
| 271 int field = offset / kPointerSize; | 271 int field = offset / kPointerSize; |
| 272 KillFieldInternal(object, field, NULL); | 272 KillFieldInternal(object, field, NULL); |
| 273 | 273 |
| 274 // Kill the next field in case of overlap. | 274 // Kill the next field in case of overlap. |
| 275 int size = kPointerSize; | 275 int size = kPointerSize; |
| 276 if (access.representation().IsByte()) size = 1; | 276 if (access.representation().IsInteger8() || |
| 277 access.representation().IsUInteger8()) size = 1; | |
|
Yang
2013/11/08 08:45:59
I favor adding brackets for readability.
Sven Panne
2013/11/08 09:09:30
I would favor something actually OO-like: Adding a
danno
2013/11/08 10:49:12
Done.
danno
2013/11/08 10:49:12
Done.
| |
| 278 if (access.representation().IsInteger16() || | |
| 279 access.representation().IsUInteger16()) size = 2; | |
| 277 else if (access.representation().IsInteger32()) size = 4; | 280 else if (access.representation().IsInteger32()) size = 4; |
| 278 int next_field = (offset + size - 1) / kPointerSize; | 281 int next_field = (offset + size - 1) / kPointerSize; |
| 279 if (next_field != field) KillFieldInternal(object, next_field, NULL); | 282 if (next_field != field) KillFieldInternal(object, next_field, NULL); |
| 280 } | 283 } |
| 281 } | 284 } |
| 282 return instr; | 285 return instr; |
| 283 } | 286 } |
| 284 | 287 |
| 285 // Find an entry for the given object and field pair. | 288 // Find an entry for the given object and field pair. |
| 286 HFieldApproximation* Find(HValue* object, int field) { | 289 HFieldApproximation* Find(HValue* object, int field) { |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 501 } else { | 504 } else { |
| 502 // Perform only local analysis. | 505 // Perform only local analysis. |
| 503 for (int i = 0; i < graph()->blocks()->length(); i++) { | 506 for (int i = 0; i < graph()->blocks()->length(); i++) { |
| 504 table->Kill(); | 507 table->Kill(); |
| 505 engine.AnalyzeOneBlock(graph()->blocks()->at(i), table); | 508 engine.AnalyzeOneBlock(graph()->blocks()->at(i), table); |
| 506 } | 509 } |
| 507 } | 510 } |
| 508 } | 511 } |
| 509 | 512 |
| 510 } } // namespace v8::internal | 513 } } // namespace v8::internal |
| OLD | NEW |