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

Side by Side Diff: src/ic.cc

Issue 190853007: Revert "Enable Object.observe by default" (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 9 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 | « src/flag-definitions.h ('k') | src/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 1187 matching lines...) Expand 10 before | Expand all | Expand 10 after
1198 // Check if the given name is an array index. 1198 // Check if the given name is an array index.
1199 uint32_t index; 1199 uint32_t index;
1200 if (name->AsArrayIndex(&index)) { 1200 if (name->AsArrayIndex(&index)) {
1201 Handle<Object> result = 1201 Handle<Object> result =
1202 JSObject::SetElement(receiver, index, value, NONE, strict_mode()); 1202 JSObject::SetElement(receiver, index, value, NONE, strict_mode());
1203 RETURN_IF_EMPTY_HANDLE(isolate(), result); 1203 RETURN_IF_EMPTY_HANDLE(isolate(), result);
1204 return *value; 1204 return *value;
1205 } 1205 }
1206 1206
1207 // Observed objects are always modified through the runtime. 1207 // Observed objects are always modified through the runtime.
1208 if (receiver->map()->is_observed()) { 1208 if (FLAG_harmony_observation && receiver->map()->is_observed()) {
1209 Handle<Object> result = JSReceiver::SetProperty( 1209 Handle<Object> result = JSReceiver::SetProperty(
1210 receiver, name, value, NONE, strict_mode(), store_mode); 1210 receiver, name, value, NONE, strict_mode(), store_mode);
1211 RETURN_IF_EMPTY_HANDLE(isolate(), result); 1211 RETURN_IF_EMPTY_HANDLE(isolate(), result);
1212 return *result; 1212 return *result;
1213 } 1213 }
1214 1214
1215 // Use specialized code for setting the length of arrays with fast 1215 // Use specialized code for setting the length of arrays with fast
1216 // properties. Slow properties might indicate redefinition of the length 1216 // properties. Slow properties might indicate redefinition of the length
1217 // property. Note that when redefined using Object.freeze, it's possible 1217 // property. Note that when redefined using Object.freeze, it's possible
1218 // to have fast properties but a read-only length. 1218 // to have fast properties but a read-only length.
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
1664 Handle<Code> stub = generic_stub(); 1664 Handle<Code> stub = generic_stub();
1665 1665
1666 if (key->IsInternalizedString()) { 1666 if (key->IsInternalizedString()) {
1667 maybe_object = StoreIC::Store(object, 1667 maybe_object = StoreIC::Store(object,
1668 Handle<String>::cast(key), 1668 Handle<String>::cast(key),
1669 value, 1669 value,
1670 JSReceiver::MAY_BE_STORE_FROM_KEYED); 1670 JSReceiver::MAY_BE_STORE_FROM_KEYED);
1671 if (maybe_object->IsFailure()) return maybe_object; 1671 if (maybe_object->IsFailure()) return maybe_object;
1672 } else { 1672 } else {
1673 bool use_ic = FLAG_use_ic && !object->IsAccessCheckNeeded() && 1673 bool use_ic = FLAG_use_ic && !object->IsAccessCheckNeeded() &&
1674 !(object->IsJSObject() && 1674 !(FLAG_harmony_observation && object->IsJSObject() &&
1675 JSObject::cast(*object)->map()->is_observed()); 1675 JSObject::cast(*object)->map()->is_observed());
1676 if (use_ic && !object->IsSmi()) { 1676 if (use_ic && !object->IsSmi()) {
1677 // Don't use ICs for maps of the objects in Array's prototype chain. We 1677 // Don't use ICs for maps of the objects in Array's prototype chain. We
1678 // expect to be able to trap element sets to objects with those maps in 1678 // expect to be able to trap element sets to objects with those maps in
1679 // the runtime to enable optimization of element hole access. 1679 // the runtime to enable optimization of element hole access.
1680 Handle<HeapObject> heap_object = Handle<HeapObject>::cast(object); 1680 Handle<HeapObject> heap_object = Handle<HeapObject>::cast(object);
1681 if (heap_object->map()->IsMapInArrayPrototypeChain()) use_ic = false; 1681 if (heap_object->map()->IsMapInArrayPrototypeChain()) use_ic = false;
1682 } 1682 }
1683 1683
1684 if (use_ic) { 1684 if (use_ic) {
(...skipping 1133 matching lines...) Expand 10 before | Expand all | Expand 10 after
2818 #undef ADDR 2818 #undef ADDR
2819 }; 2819 };
2820 2820
2821 2821
2822 Address IC::AddressFromUtilityId(IC::UtilityId id) { 2822 Address IC::AddressFromUtilityId(IC::UtilityId id) {
2823 return IC_utilities[id]; 2823 return IC_utilities[id];
2824 } 2824 }
2825 2825
2826 2826
2827 } } // namespace v8::internal 2827 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/flag-definitions.h ('k') | src/object-observe.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698