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

Side by Side Diff: src/bootstrapper.cc

Issue 600124: Introduce builtin for Array.unshift function. (Closed)
Patch Set: Adding a test and fixing a bug with no args unshift. Plus Mads' comments 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 | src/builtins.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 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 1476 matching lines...) Expand 10 before | Expand all | Expand 10 after
1487 special_prototype = Handle<JSObject>::cast(superproto); 1487 special_prototype = Handle<JSObject>::cast(superproto);
1488 } else { 1488 } else {
1489 special_prototype = visible_prototype; 1489 special_prototype = visible_prototype;
1490 } 1490 }
1491 AddSpecialFunction(special_prototype, "pop", 1491 AddSpecialFunction(special_prototype, "pop",
1492 Handle<Code>(Builtins::builtin(Builtins::ArrayPop))); 1492 Handle<Code>(Builtins::builtin(Builtins::ArrayPop)));
1493 AddSpecialFunction(special_prototype, "push", 1493 AddSpecialFunction(special_prototype, "push",
1494 Handle<Code>(Builtins::builtin(Builtins::ArrayPush))); 1494 Handle<Code>(Builtins::builtin(Builtins::ArrayPush)));
1495 AddSpecialFunction(special_prototype, "shift", 1495 AddSpecialFunction(special_prototype, "shift",
1496 Handle<Code>(Builtins::builtin(Builtins::ArrayShift))); 1496 Handle<Code>(Builtins::builtin(Builtins::ArrayShift)));
1497 AddSpecialFunction(special_prototype, "unshift",
1498 Handle<Code>(Builtins::builtin(Builtins::ArrayUnshift)));
1497 } 1499 }
1498 1500
1499 1501
1500 Genesis::Genesis(Handle<Object> global_object, 1502 Genesis::Genesis(Handle<Object> global_object,
1501 v8::Handle<v8::ObjectTemplate> global_template, 1503 v8::Handle<v8::ObjectTemplate> global_template,
1502 v8::ExtensionConfiguration* extensions) { 1504 v8::ExtensionConfiguration* extensions) {
1503 // Link this genesis object into the stacked genesis chain. This 1505 // Link this genesis object into the stacked genesis chain. This
1504 // must be done before any early exits because the destructor 1506 // must be done before any early exits because the destructor
1505 // will always do unlinking. 1507 // will always do unlinking.
1506 previous_ = current_; 1508 previous_ = current_;
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
1572 } 1574 }
1573 1575
1574 1576
1575 // Restore statics that are thread local. 1577 // Restore statics that are thread local.
1576 char* Genesis::RestoreState(char* from) { 1578 char* Genesis::RestoreState(char* from) {
1577 current_ = *reinterpret_cast<Genesis**>(from); 1579 current_ = *reinterpret_cast<Genesis**>(from);
1578 return from + sizeof(current_); 1580 return from + sizeof(current_);
1579 } 1581 }
1580 1582
1581 } } // namespace v8::internal 1583 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/builtins.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698