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

Side by Side Diff: src/hydrogen.cc

Issue 22562004: Fix Object.freeze, Object.observe wrt CountOperation and CompoundAssignment. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add regression test Created 7 years, 4 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/typing.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 5021 matching lines...) Expand 10 before | Expand all | Expand 10 after
5032 CHECK_ALIVE(VisitForValue(expr->value())); 5032 CHECK_ALIVE(VisitForValue(expr->value()));
5033 HValue* right = Pop(); 5033 HValue* right = Pop();
5034 HValue* left = Pop(); 5034 HValue* left = Pop();
5035 5035
5036 HInstruction* instr = BuildBinaryOperation(operation, left, right); 5036 HInstruction* instr = BuildBinaryOperation(operation, left, right);
5037 PushAndAdd(instr); 5037 PushAndAdd(instr);
5038 if (instr->HasObservableSideEffects()) { 5038 if (instr->HasObservableSideEffects()) {
5039 Add<HSimulate>(operation->id(), REMOVABLE_SIMULATE); 5039 Add<HSimulate>(operation->id(), REMOVABLE_SIMULATE);
5040 } 5040 }
5041 5041
5042 return BuildStoreNamed(prop, expr->id(), expr->position(), 5042 return BuildStoreNamed(expr, expr->id(), expr->position(),
5043 expr->AssignmentId(), prop, object, instr, instr); 5043 expr->AssignmentId(), prop, object, instr, instr);
5044 } else { 5044 } else {
5045 // Keyed property. 5045 // Keyed property.
5046 CHECK_ALIVE(VisitForValue(prop->obj())); 5046 CHECK_ALIVE(VisitForValue(prop->obj()));
5047 CHECK_ALIVE(VisitForValue(prop->key())); 5047 CHECK_ALIVE(VisitForValue(prop->key()));
5048 HValue* obj = environment()->ExpressionStackAt(1); 5048 HValue* obj = environment()->ExpressionStackAt(1);
5049 HValue* key = environment()->ExpressionStackAt(0); 5049 HValue* key = environment()->ExpressionStackAt(0);
5050 5050
5051 bool has_side_effects = false; 5051 bool has_side_effects = false;
5052 HValue* load = HandleKeyedElementAccess( 5052 HValue* load = HandleKeyedElementAccess(
(...skipping 2414 matching lines...) Expand 10 before | Expand all | Expand 10 after
7467 } 7467 }
7468 if (load == NULL) load = BuildLoadNamedGeneric(object, name, prop); 7468 if (load == NULL) load = BuildLoadNamedGeneric(object, name, prop);
7469 PushAndAdd(load); 7469 PushAndAdd(load);
7470 if (load->HasObservableSideEffects()) { 7470 if (load->HasObservableSideEffects()) {
7471 Add<HSimulate>(prop->LoadId(), REMOVABLE_SIMULATE); 7471 Add<HSimulate>(prop->LoadId(), REMOVABLE_SIMULATE);
7472 } 7472 }
7473 7473
7474 after = BuildIncrement(returns_original_input, expr); 7474 after = BuildIncrement(returns_original_input, expr);
7475 HValue* result = returns_original_input ? Pop() : after; 7475 HValue* result = returns_original_input ? Pop() : after;
7476 7476
7477 return BuildStoreNamed(prop, expr->id(), expr->position(), 7477 return BuildStoreNamed(expr, expr->id(), expr->position(),
7478 expr->AssignmentId(), prop, object, after, result); 7478 expr->AssignmentId(), prop, object, after, result);
7479 } else { 7479 } else {
7480 // Keyed property. 7480 // Keyed property.
7481 if (returns_original_input) Push(graph()->GetConstantUndefined()); 7481 if (returns_original_input) Push(graph()->GetConstantUndefined());
7482 7482
7483 CHECK_ALIVE(VisitForValue(prop->obj())); 7483 CHECK_ALIVE(VisitForValue(prop->obj()));
7484 CHECK_ALIVE(VisitForValue(prop->key())); 7484 CHECK_ALIVE(VisitForValue(prop->key()));
7485 HValue* obj = environment()->ExpressionStackAt(1); 7485 HValue* obj = environment()->ExpressionStackAt(1);
7486 HValue* key = environment()->ExpressionStackAt(0); 7486 HValue* key = environment()->ExpressionStackAt(0);
7487 7487
(...skipping 2219 matching lines...) Expand 10 before | Expand all | Expand 10 after
9707 if (ShouldProduceTraceOutput()) { 9707 if (ShouldProduceTraceOutput()) {
9708 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); 9708 isolate()->GetHTracer()->TraceHydrogen(name(), graph_);
9709 } 9709 }
9710 9710
9711 #ifdef DEBUG 9711 #ifdef DEBUG
9712 graph_->Verify(false); // No full verify. 9712 graph_->Verify(false); // No full verify.
9713 #endif 9713 #endif
9714 } 9714 }
9715 9715
9716 } } // namespace v8::internal 9716 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/typing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698