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

Side by Side Diff: src/hydrogen.cc

Issue 15023016: Merged r14584, r14596 into 3.18 branch. (Closed) Base URL: https://v8.googlecode.com/svn/branches/3.18
Patch Set: Created 7 years, 7 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 | src/version.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 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 7256 matching lines...) Expand 10 before | Expand all | Expand 10 after
7267 AddInstruction(instr); 7267 AddInstruction(instr);
7268 if (instr->HasObservableSideEffects()) { 7268 if (instr->HasObservableSideEffects()) {
7269 AddSimulate(expr->AssignmentId(), REMOVABLE_SIMULATE); 7269 AddSimulate(expr->AssignmentId(), REMOVABLE_SIMULATE);
7270 } 7270 }
7271 return ast_context()->ReturnValue(Pop()); 7271 return ast_context()->ReturnValue(Pop());
7272 7272
7273 } else { 7273 } else {
7274 // Keyed store. 7274 // Keyed store.
7275 CHECK_ALIVE(VisitForValue(prop->key())); 7275 CHECK_ALIVE(VisitForValue(prop->key()));
7276 CHECK_ALIVE(VisitForValue(expr->value())); 7276 CHECK_ALIVE(VisitForValue(expr->value()));
7277 HValue* value = Pop(); 7277 HValue* value = environment()->ExpressionStackAt(0);
7278 HValue* key = Pop(); 7278 HValue* key = environment()->ExpressionStackAt(1);
7279 HValue* object = Pop(); 7279 HValue* object = environment()->ExpressionStackAt(2);
7280 bool has_side_effects = false; 7280 bool has_side_effects = false;
7281 HandleKeyedElementAccess(object, key, value, expr, expr->AssignmentId(), 7281 HandleKeyedElementAccess(object, key, value, expr, expr->AssignmentId(),
7282 expr->position(), 7282 expr->position(),
7283 true, // is_store 7283 true, // is_store
7284 &has_side_effects); 7284 &has_side_effects);
7285 Drop(3);
7285 Push(value); 7286 Push(value);
7286 AddSimulate(expr->AssignmentId(), REMOVABLE_SIMULATE); 7287 AddSimulate(expr->AssignmentId(), REMOVABLE_SIMULATE);
7287 return ast_context()->ReturnValue(Pop()); 7288 return ast_context()->ReturnValue(Pop());
7288 } 7289 }
7289 } 7290 }
7290 7291
7291 7292
7292 // Because not every expression has a position and there is not common 7293 // Because not every expression has a position and there is not common
7293 // superclass of Assignment and CountOperation, we cannot just pass the 7294 // superclass of Assignment and CountOperation, we cannot just pass the
7294 // owning expression instead of position and ast_id separately. 7295 // owning expression instead of position and ast_id separately.
(...skipping 2711 matching lines...) Expand 10 before | Expand all | Expand 10 after
10006 10007
10007 bool has_side_effects = false; 10008 bool has_side_effects = false;
10008 HValue* load = HandleKeyedElementAccess( 10009 HValue* load = HandleKeyedElementAccess(
10009 obj, key, NULL, prop, prop->LoadId(), RelocInfo::kNoPosition, 10010 obj, key, NULL, prop, prop->LoadId(), RelocInfo::kNoPosition,
10010 false, // is_store 10011 false, // is_store
10011 &has_side_effects); 10012 &has_side_effects);
10012 Push(load); 10013 Push(load);
10013 if (has_side_effects) AddSimulate(prop->LoadId(), REMOVABLE_SIMULATE); 10014 if (has_side_effects) AddSimulate(prop->LoadId(), REMOVABLE_SIMULATE);
10014 10015
10015 after = BuildIncrement(returns_original_input, expr); 10016 after = BuildIncrement(returns_original_input, expr);
10016 input = Pop(); 10017 input = environment()->ExpressionStackAt(0);
10017 10018
10018 expr->RecordTypeFeedback(oracle(), zone()); 10019 expr->RecordTypeFeedback(oracle(), zone());
10019 HandleKeyedElementAccess(obj, key, after, expr, expr->AssignmentId(), 10020 HandleKeyedElementAccess(obj, key, after, expr, expr->AssignmentId(),
10020 RelocInfo::kNoPosition, 10021 RelocInfo::kNoPosition,
10021 true, // is_store 10022 true, // is_store
10022 &has_side_effects); 10023 &has_side_effects);
10023 10024
10024 // Drop the key from the bailout environment. Overwrite the receiver 10025 // Drop the key and the original value from the bailout environment.
10025 // with the result of the operation, and the placeholder with the 10026 // Overwrite the receiver with the result of the operation, and the
10026 // original value if necessary. 10027 // placeholder with the original value if necessary.
10027 Drop(1); 10028 Drop(2);
10028 environment()->SetExpressionStackAt(0, after); 10029 environment()->SetExpressionStackAt(0, after);
10029 if (returns_original_input) environment()->SetExpressionStackAt(1, input); 10030 if (returns_original_input) environment()->SetExpressionStackAt(1, input);
10030 ASSERT(has_side_effects); // Stores always have side effects. 10031 ASSERT(has_side_effects); // Stores always have side effects.
10031 AddSimulate(expr->AssignmentId(), REMOVABLE_SIMULATE); 10032 AddSimulate(expr->AssignmentId(), REMOVABLE_SIMULATE);
10032 } 10033 }
10033 } 10034 }
10034 10035
10035 Drop(returns_original_input ? 2 : 1); 10036 Drop(returns_original_input ? 2 : 1);
10036 return ast_context()->ReturnValue(expr->is_postfix() ? input : after); 10037 return ast_context()->ReturnValue(expr->is_postfix() ? input : after);
10037 } 10038 }
(...skipping 2183 matching lines...) Expand 10 before | Expand all | Expand 10 after
12221 } 12222 }
12222 } 12223 }
12223 12224
12224 #ifdef DEBUG 12225 #ifdef DEBUG
12225 if (graph_ != NULL) graph_->Verify(false); // No full verify. 12226 if (graph_ != NULL) graph_->Verify(false); // No full verify.
12226 if (allocator_ != NULL) allocator_->Verify(); 12227 if (allocator_ != NULL) allocator_->Verify();
12227 #endif 12228 #endif
12228 } 12229 }
12229 12230
12230 } } // namespace v8::internal 12231 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/version.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698