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

Side by Side Diff: src/hydrogen.cc

Issue 11642042: Object.observe: fix observation for optimised in/decrement and compound assignment. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years 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 | test/mjsunit/harmony/object-observe.js » ('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 5892 matching lines...) Expand 10 before | Expand all | Expand 10 after
5903 HValue* right = Pop(); 5903 HValue* right = Pop();
5904 HValue* left = Pop(); 5904 HValue* left = Pop();
5905 5905
5906 HInstruction* instr = BuildBinaryOperation(operation, left, right); 5906 HInstruction* instr = BuildBinaryOperation(operation, left, right);
5907 PushAndAdd(instr); 5907 PushAndAdd(instr);
5908 if (instr->HasObservableSideEffects()) { 5908 if (instr->HasObservableSideEffects()) {
5909 AddSimulate(operation->id(), REMOVABLE_SIMULATE); 5909 AddSimulate(operation->id(), REMOVABLE_SIMULATE);
5910 } 5910 }
5911 5911
5912 HInstruction* store; 5912 HInstruction* store;
5913 if (!monomorphic) { 5913 if (!monomorphic || map->is_observed()) {
5914 // If we don't know the monomorphic type, do a generic store. 5914 // If we don't know the monomorphic type, do a generic store.
5915 CHECK_ALIVE(store = BuildStoreNamedGeneric(object, name, instr)); 5915 CHECK_ALIVE(store = BuildStoreNamedGeneric(object, name, instr));
5916 } else { 5916 } else {
5917 Handle<JSFunction> setter; 5917 Handle<JSFunction> setter;
5918 Handle<JSObject> holder; 5918 Handle<JSObject> holder;
5919 if (LookupSetter(map, name, &setter, &holder)) { 5919 if (LookupSetter(map, name, &setter, &holder)) {
5920 store = BuildCallSetter(object, instr, map, setter, holder); 5920 store = BuildCallSetter(object, instr, map, setter, holder);
5921 } else { 5921 } else {
5922 CHECK_ALIVE(store = BuildStoreNamedMonomorphic(object, 5922 CHECK_ALIVE(store = BuildStoreNamedMonomorphic(object,
5923 name, 5923 name,
(...skipping 2334 matching lines...) Expand 10 before | Expand all | Expand 10 after
8258 } 8258 }
8259 PushAndAdd(load); 8259 PushAndAdd(load);
8260 if (load->HasObservableSideEffects()) { 8260 if (load->HasObservableSideEffects()) {
8261 AddSimulate(prop->LoadId(), REMOVABLE_SIMULATE); 8261 AddSimulate(prop->LoadId(), REMOVABLE_SIMULATE);
8262 } 8262 }
8263 8263
8264 after = BuildIncrement(returns_original_input, expr); 8264 after = BuildIncrement(returns_original_input, expr);
8265 input = Pop(); 8265 input = Pop();
8266 8266
8267 HInstruction* store; 8267 HInstruction* store;
8268 if (!monomorphic) { 8268 if (!monomorphic || map->is_observed()) {
8269 // If we don't know the monomorphic type, do a generic store. 8269 // If we don't know the monomorphic type, do a generic store.
8270 CHECK_ALIVE(store = BuildStoreNamedGeneric(object, name, after)); 8270 CHECK_ALIVE(store = BuildStoreNamedGeneric(object, name, after));
8271 } else { 8271 } else {
8272 Handle<JSFunction> setter; 8272 Handle<JSFunction> setter;
8273 Handle<JSObject> holder; 8273 Handle<JSObject> holder;
8274 if (LookupSetter(map, name, &setter, &holder)) { 8274 if (LookupSetter(map, name, &setter, &holder)) {
8275 store = BuildCallSetter(object, after, map, setter, holder); 8275 store = BuildCallSetter(object, after, map, setter, holder);
8276 } else { 8276 } else {
8277 CHECK_ALIVE(store = BuildStoreNamedMonomorphic(object, 8277 CHECK_ALIVE(store = BuildStoreNamedMonomorphic(object,
8278 name, 8278 name,
(...skipping 1915 matching lines...) Expand 10 before | Expand all | Expand 10 after
10194 } 10194 }
10195 } 10195 }
10196 10196
10197 #ifdef DEBUG 10197 #ifdef DEBUG
10198 if (graph_ != NULL) graph_->Verify(false); // No full verify. 10198 if (graph_ != NULL) graph_->Verify(false); // No full verify.
10199 if (allocator_ != NULL) allocator_->Verify(); 10199 if (allocator_ != NULL) allocator_->Verify();
10200 #endif 10200 #endif
10201 } 10201 }
10202 10202
10203 } } // namespace v8::internal 10203 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/harmony/object-observe.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698