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

Side by Side Diff: src/ic.cc

Issue 8391005: Handle proxies in KeyedStoreIC::Store, instead of just ignoring them. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 1 month 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/proxies.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 1594 matching lines...) Expand 10 before | Expand all | Expand 10 after
1605 1605
1606 MaybeObject* KeyedStoreIC::Store(State state, 1606 MaybeObject* KeyedStoreIC::Store(State state,
1607 StrictModeFlag strict_mode, 1607 StrictModeFlag strict_mode,
1608 Handle<Object> object, 1608 Handle<Object> object,
1609 Handle<Object> key, 1609 Handle<Object> key,
1610 Handle<Object> value, 1610 Handle<Object> value,
1611 bool force_generic) { 1611 bool force_generic) {
1612 if (key->IsSymbol()) { 1612 if (key->IsSymbol()) {
1613 Handle<String> name = Handle<String>::cast(key); 1613 Handle<String> name = Handle<String>::cast(key);
1614 1614
1615 // Handle proxies.
1616 if (object->IsJSProxy()) {
1617 return JSProxy::cast(*object)->SetProperty(
1618 *name, *value, NONE, strict_mode);
1619 }
1620
1615 // If the object is undefined or null it's illegal to try to set any 1621 // If the object is undefined or null it's illegal to try to set any
1616 // properties on it; throw a TypeError in that case. 1622 // properties on it; throw a TypeError in that case.
1617 if (object->IsUndefined() || object->IsNull()) { 1623 if (object->IsUndefined() || object->IsNull()) {
1618 return TypeError("non_object_property_store", object, name); 1624 return TypeError("non_object_property_store", object, name);
1619 } 1625 }
1620 1626
1621 // Ignore stores where the receiver is not a JSObject. 1627 // Ignore stores where the receiver is not a JSObject.
1622 if (!object->IsJSObject()) return *value; 1628 if (!object->IsJSObject()) return *value;
1623 Handle<JSObject> receiver = Handle<JSObject>::cast(object); 1629 Handle<JSObject> receiver = Handle<JSObject>::cast(object);
1624 1630
(...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after
2371 #undef ADDR 2377 #undef ADDR
2372 }; 2378 };
2373 2379
2374 2380
2375 Address IC::AddressFromUtilityId(IC::UtilityId id) { 2381 Address IC::AddressFromUtilityId(IC::UtilityId id) {
2376 return IC_utilities[id]; 2382 return IC_utilities[id];
2377 } 2383 }
2378 2384
2379 2385
2380 } } // namespace v8::internal 2386 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/harmony/proxies.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698