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

Side by Side Diff: src/ic.cc

Issue 660174: Return length passed instead of receiver to allow chained assignments like (Closed)
Patch Set: Created 10 years, 10 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
« no previous file with comments | « no previous file | test/mjsunit/array-length.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 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 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 1347 matching lines...) Expand 10 before | Expand all | Expand 10 after
1358 } 1358 }
1359 1359
1360 1360
1361 Object* StoreIC_ArrayLength(Arguments args) { 1361 Object* StoreIC_ArrayLength(Arguments args) {
1362 NoHandleAllocation nha; 1362 NoHandleAllocation nha;
1363 1363
1364 ASSERT(args.length() == 2); 1364 ASSERT(args.length() == 2);
1365 JSObject* receiver = JSObject::cast(args[0]); 1365 JSObject* receiver = JSObject::cast(args[0]);
1366 Object* len = args[1]; 1366 Object* len = args[1];
1367 1367
1368 return receiver->SetElementsLength(len); 1368 Object* result = receiver->SetElementsLength(len);
1369 if (result->IsFailure()) return result;
1370 return len;
1369 } 1371 }
1370 1372
1371 1373
1372 // Extend storage is called in a store inline cache when 1374 // Extend storage is called in a store inline cache when
1373 // it is necessary to extend the properties array of a 1375 // it is necessary to extend the properties array of a
1374 // JSObject. 1376 // JSObject.
1375 Object* SharedStoreIC_ExtendStorage(Arguments args) { 1377 Object* SharedStoreIC_ExtendStorage(Arguments args) {
1376 NoHandleAllocation na; 1378 NoHandleAllocation na;
1377 ASSERT(args.length() == 3); 1379 ASSERT(args.length() == 3);
1378 1380
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
1421 #undef ADDR 1423 #undef ADDR
1422 }; 1424 };
1423 1425
1424 1426
1425 Address IC::AddressFromUtilityId(IC::UtilityId id) { 1427 Address IC::AddressFromUtilityId(IC::UtilityId id) {
1426 return IC_utilities[id]; 1428 return IC_utilities[id];
1427 } 1429 }
1428 1430
1429 1431
1430 } } // namespace v8::internal 1432 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/array-length.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698