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

Side by Side Diff: src/ic.cc

Issue 9008012: Move handlified functions from handles.cc to objects.cc (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: More formatting fixes. Created 8 years, 11 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/handles.cc ('k') | src/isolate.h » ('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 1249 matching lines...) Expand 10 before | Expand all | Expand 10 after
1260 // Ignore other stores where the receiver is not a JSObject. 1260 // Ignore other stores where the receiver is not a JSObject.
1261 // TODO(1475): Must check prototype chains of object wrappers. 1261 // TODO(1475): Must check prototype chains of object wrappers.
1262 return *value; 1262 return *value;
1263 } 1263 }
1264 1264
1265 Handle<JSObject> receiver = Handle<JSObject>::cast(object); 1265 Handle<JSObject> receiver = Handle<JSObject>::cast(object);
1266 1266
1267 // Check if the given name is an array index. 1267 // Check if the given name is an array index.
1268 uint32_t index; 1268 uint32_t index;
1269 if (name->AsArrayIndex(&index)) { 1269 if (name->AsArrayIndex(&index)) {
1270 Handle<Object> result = SetElement(receiver, index, value, strict_mode); 1270 Handle<Object> result =
1271 JSObject::SetElement(receiver, index, value, strict_mode);
1271 RETURN_IF_EMPTY_HANDLE(isolate(), result); 1272 RETURN_IF_EMPTY_HANDLE(isolate(), result);
1272 return *value; 1273 return *value;
1273 } 1274 }
1274 1275
1275 // Use specialized code for setting the length of arrays with fast 1276 // Use specialized code for setting the length of arrays with fast
1276 // properties. Slow properties might indicate redefinition of the 1277 // properties. Slow properties might indicate redefinition of the
1277 // length property. 1278 // length property.
1278 if (receiver->IsJSArray() && 1279 if (receiver->IsJSArray() &&
1279 name->Equals(isolate()->heap()->length_symbol()) && 1280 name->Equals(isolate()->heap()->length_symbol()) &&
1280 Handle<JSArray>::cast(receiver)->AllowsSetElementsLength() && 1281 Handle<JSArray>::cast(receiver)->AllowsSetElementsLength() &&
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
1637 return TypeError("non_object_property_store", object, name); 1638 return TypeError("non_object_property_store", object, name);
1638 } 1639 }
1639 1640
1640 // Ignore stores where the receiver is not a JSObject. 1641 // Ignore stores where the receiver is not a JSObject.
1641 if (!object->IsJSObject()) return *value; 1642 if (!object->IsJSObject()) return *value;
1642 Handle<JSObject> receiver = Handle<JSObject>::cast(object); 1643 Handle<JSObject> receiver = Handle<JSObject>::cast(object);
1643 1644
1644 // Check if the given name is an array index. 1645 // Check if the given name is an array index.
1645 uint32_t index; 1646 uint32_t index;
1646 if (name->AsArrayIndex(&index)) { 1647 if (name->AsArrayIndex(&index)) {
1647 Handle<Object> result = SetElement(receiver, index, value, strict_mode); 1648 Handle<Object> result =
1649 JSObject::SetElement(receiver, index, value, strict_mode);
1648 RETURN_IF_EMPTY_HANDLE(isolate(), result); 1650 RETURN_IF_EMPTY_HANDLE(isolate(), result);
1649 return *value; 1651 return *value;
1650 } 1652 }
1651 1653
1652 // Update inline cache and stub cache. 1654 // Update inline cache and stub cache.
1653 if (FLAG_use_ic && !receiver->IsJSGlobalProxy()) { 1655 if (FLAG_use_ic && !receiver->IsJSGlobalProxy()) {
1654 LookupResult lookup(isolate()); 1656 LookupResult lookup(isolate());
1655 if (LookupForWrite(receiver, name, &lookup)) { 1657 if (LookupForWrite(receiver, name, &lookup)) {
1656 UpdateCaches(&lookup, state, strict_mode, receiver, name, value); 1658 UpdateCaches(&lookup, state, strict_mode, receiver, name, value);
1657 } 1659 }
(...skipping 765 matching lines...) Expand 10 before | Expand all | Expand 10 after
2423 #undef ADDR 2425 #undef ADDR
2424 }; 2426 };
2425 2427
2426 2428
2427 Address IC::AddressFromUtilityId(IC::UtilityId id) { 2429 Address IC::AddressFromUtilityId(IC::UtilityId id) {
2428 return IC_utilities[id]; 2430 return IC_utilities[id];
2429 } 2431 }
2430 2432
2431 2433
2432 } } // namespace v8::internal 2434 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/handles.cc ('k') | src/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698