Chromium Code Reviews
Help | Chromium Project | Sign in
(112)

Side by Side Diff: src/hydrogen.cc

Issue 11088026: Make sure that the context argument of HAdd is never NULL. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 1 year, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/hydrogen-instructions.h » ('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 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 3549 matching lines...) Expand 10 before | Expand all | Expand 10 after
3560 void BuildOffsetAdd(HBoundsCheck* check, 3560 void BuildOffsetAdd(HBoundsCheck* check,
3561 HAdd** add, 3561 HAdd** add,
3562 HConstant** constant, 3562 HConstant** constant,
3563 HValue* original_value, 3563 HValue* original_value,
3564 Representation representation, 3564 Representation representation,
3565 int32_t new_offset) { 3565 int32_t new_offset) {
3566 HConstant* new_constant = new(BasicBlock()->zone()) 3566 HConstant* new_constant = new(BasicBlock()->zone())
3567 HConstant(new_offset, Representation::Integer32()); 3567 HConstant(new_offset, Representation::Integer32());
3568 if (*add == NULL) { 3568 if (*add == NULL) {
3569 new_constant->InsertBefore(check); 3569 new_constant->InsertBefore(check);
3570 *add = new(BasicBlock()->zone()) HAdd(NULL, 3570 HValue* context = HBinaryOperation::cast(check->index())->context();
Jakob 2012/10/09 13:49:22 I'd appreciate a comment here why check->index() i
3571 *add = new(BasicBlock()->zone()) HAdd(context,
3571 original_value, 3572 original_value,
3572 new_constant); 3573 new_constant);
3573 (*add)->AssumeRepresentation(representation); 3574 (*add)->AssumeRepresentation(representation);
3574 (*add)->InsertBefore(check); 3575 (*add)->InsertBefore(check);
3575 } else { 3576 } else {
3576 new_constant->InsertBefore(*add); 3577 new_constant->InsertBefore(*add);
3577 (*constant)->DeleteAndReplaceWith(new_constant); 3578 (*constant)->DeleteAndReplaceWith(new_constant);
3578 } 3579 }
3579 *constant = new_constant; 3580 *constant = new_constant;
3580 } 3581 }
(...skipping 6356 matching lines...) Expand 10 before | Expand all | Expand 10 after
9937 } 9938 }
9938 } 9939 }
9939 9940
9940 #ifdef DEBUG 9941 #ifdef DEBUG
9941 if (graph_ != NULL) graph_->Verify(false); // No full verify. 9942 if (graph_ != NULL) graph_->Verify(false); // No full verify.
9942 if (allocator_ != NULL) allocator_->Verify(); 9943 if (allocator_ != NULL) allocator_->Verify();
9943 #endif 9944 #endif
9944 } 9945 }
9945 9946
9946 } } // namespace v8::internal 9947 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/hydrogen-instructions.h » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld 1280:2d3e6564b7b6