OLD | NEW |
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 5345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5356 } | 5356 } |
5357 } else if (index->IsSub()) { | 5357 } else if (index->IsSub()) { |
5358 sign = -1; | 5358 sign = -1; |
5359 HSub* sub = HSub::cast(index); | 5359 HSub* sub = HSub::cast(index); |
5360 if (sub->left()->IsConstant()) { | 5360 if (sub->left()->IsConstant()) { |
5361 subexpression = sub->right(); | 5361 subexpression = sub->right(); |
5362 constant = HConstant::cast(sub->left()); | 5362 constant = HConstant::cast(sub->left()); |
5363 } else if (sub->right()->IsConstant()) { | 5363 } else if (sub->right()->IsConstant()) { |
5364 subexpression = sub->left(); | 5364 subexpression = sub->left(); |
5365 constant = HConstant::cast(sub->right()); | 5365 constant = HConstant::cast(sub->right()); |
5366 } return; | 5366 } else { |
| 5367 return; |
| 5368 } |
5367 } else { | 5369 } else { |
5368 return; | 5370 return; |
5369 } | 5371 } |
5370 | 5372 |
5371 if (!constant->HasInteger32Value()) return; | 5373 if (!constant->HasInteger32Value()) return; |
5372 int32_t value = constant->Integer32Value() * sign; | 5374 int32_t value = constant->Integer32Value() * sign; |
5373 // We limit offset values to 30 bits because we want to avoid the risk of | 5375 // We limit offset values to 30 bits because we want to avoid the risk of |
5374 // overflows when the offset is added to the object header size. | 5376 // overflows when the offset is added to the object header size. |
5375 if (value >= 1 << 30 || value < 0) return; | 5377 if (value >= 1 << 30 || value < 0) return; |
5376 array_operation->SetKey(subexpression); | 5378 array_operation->SetKey(subexpression); |
(...skipping 7092 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12469 } | 12471 } |
12470 } | 12472 } |
12471 | 12473 |
12472 #ifdef DEBUG | 12474 #ifdef DEBUG |
12473 if (graph_ != NULL) graph_->Verify(false); // No full verify. | 12475 if (graph_ != NULL) graph_->Verify(false); // No full verify. |
12474 if (allocator_ != NULL) allocator_->Verify(); | 12476 if (allocator_ != NULL) allocator_->Verify(); |
12475 #endif | 12477 #endif |
12476 } | 12478 } |
12477 | 12479 |
12478 } } // namespace v8::internal | 12480 } } // namespace v8::internal |
OLD | NEW |