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

Side by Side Diff: src/builtins.cc

Issue 890004: Remove now obsolete comment. (Closed)
Patch Set: Sending for review TBRed Created 10 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
« no previous file with comments | « no previous file | no next file » | 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-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
479 FixedArray* elms = NULL; 479 FixedArray* elms = NULL;
480 if (!IsJSArrayWithFastElements(receiver, &elms) 480 if (!IsJSArrayWithFastElements(receiver, &elms)
481 || !ArrayPrototypeHasNoElements()) { 481 || !ArrayPrototypeHasNoElements()) {
482 return CallJsBuiltin("ArrayUnshift", args); 482 return CallJsBuiltin("ArrayUnshift", args);
483 } 483 }
484 JSArray* array = JSArray::cast(receiver); 484 JSArray* array = JSArray::cast(receiver);
485 ASSERT(array->HasFastElements()); 485 ASSERT(array->HasFastElements());
486 486
487 int len = Smi::cast(array->length())->value(); 487 int len = Smi::cast(array->length())->value();
488 int to_add = args.length() - 1; 488 int to_add = args.length() - 1;
489 // Note that we cannot quit early if to_add == 0 as
490 // values should be lifted from prototype into
491 // the array.
492
493 int new_length = len + to_add; 489 int new_length = len + to_add;
494 // Currently fixed arrays cannot grow too big, so 490 // Currently fixed arrays cannot grow too big, so
495 // we should never hit this case. 491 // we should never hit this case.
496 ASSERT(to_add <= (Smi::kMaxValue - len)); 492 ASSERT(to_add <= (Smi::kMaxValue - len));
497 493
498 if (new_length > elms->length()) { 494 if (new_length > elms->length()) {
499 // New backing storage is needed. 495 // New backing storage is needed.
500 int capacity = new_length + (new_length >> 1) + 16; 496 int capacity = new_length + (new_length >> 1) + 16;
501 Object* obj = Heap::AllocateUninitializedFixedArray(capacity); 497 Object* obj = Heap::AllocateUninitializedFixedArray(capacity);
502 if (obj->IsFailure()) return obj; 498 if (obj->IsFailure()) return obj;
(...skipping 871 matching lines...) Expand 10 before | Expand all | Expand 10 after
1374 if (entry->contains(pc)) { 1370 if (entry->contains(pc)) {
1375 return names_[i]; 1371 return names_[i];
1376 } 1372 }
1377 } 1373 }
1378 } 1374 }
1379 return NULL; 1375 return NULL;
1380 } 1376 }
1381 1377
1382 1378
1383 } } // namespace v8::internal 1379 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698