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

Side by Side Diff: src/js/array.js

Issue 1401243003: Add methods to extras' InternalPackedArray (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix test typo Created 5 years, 2 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/cctest/test-extra.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 (function(global, utils) { 5 (function(global, utils, extrasUtils) {
6 6
7 "use strict"; 7 "use strict";
8 8
9 %CheckIsBootstrapping(); 9 %CheckIsBootstrapping();
10 10
11 // ------------------------------------------------------------------- 11 // -------------------------------------------------------------------
12 // Imports 12 // Imports
13 13
14 var Delete; 14 var Delete;
15 var GlobalArray = global.Array; 15 var GlobalArray = global.Array;
(...skipping 1601 matching lines...) Expand 10 before | Expand all | Expand 10 after
1617 "splice", getFunction("splice", ArraySplice) 1617 "splice", getFunction("splice", ArraySplice)
1618 ]); 1618 ]);
1619 1619
1620 utils.SetUpLockedPrototype(InternalPackedArray, GlobalArray(), [ 1620 utils.SetUpLockedPrototype(InternalPackedArray, GlobalArray(), [
1621 "join", getFunction("join", ArrayJoin), 1621 "join", getFunction("join", ArrayJoin),
1622 "pop", getFunction("pop", ArrayPop), 1622 "pop", getFunction("pop", ArrayPop),
1623 "push", getFunction("push", ArrayPush), 1623 "push", getFunction("push", ArrayPush),
1624 "shift", getFunction("shift", ArrayShift) 1624 "shift", getFunction("shift", ArrayShift)
1625 ]); 1625 ]);
1626 1626
1627 // V8 extras get a separate copy of InternalPackedArray. We give them the basic
1628 // manipulation methods.
1629 utils.SetUpLockedPrototype(extrasUtils.InternalPackedArray, GlobalArray(), [
1630 "push", getFunction("push", ArrayPush),
1631 "pop", getFunction("pop", ArrayPop),
1632 "shift", getFunction("shift", ArrayShift),
1633 "unshift", getFunction("unshift", ArrayUnshift),
1634 "splice", getFunction("splice", ArraySplice),
1635 "slice", getFunction("slice", ArraySlice)
1636 ]);
1637
1627 // ------------------------------------------------------------------- 1638 // -------------------------------------------------------------------
1628 // Exports 1639 // Exports
1629 1640
1630 utils.Export(function(to) { 1641 utils.Export(function(to) {
1631 to.ArrayIndexOf = ArrayIndexOf; 1642 to.ArrayIndexOf = ArrayIndexOf;
1632 to.ArrayJoin = ArrayJoin; 1643 to.ArrayJoin = ArrayJoin;
1633 to.ArrayPush = ArrayPush; 1644 to.ArrayPush = ArrayPush;
1634 to.ArrayToString = ArrayToString; 1645 to.ArrayToString = ArrayToString;
1635 to.InnerArrayEvery = InnerArrayEvery; 1646 to.InnerArrayEvery = InnerArrayEvery;
1636 to.InnerArrayFilter = InnerArrayFilter; 1647 to.InnerArrayFilter = InnerArrayFilter;
(...skipping 13 matching lines...) Expand all
1650 %InstallToContext([ 1661 %InstallToContext([
1651 "array_pop", ArrayPop, 1662 "array_pop", ArrayPop,
1652 "array_push", ArrayPush, 1663 "array_push", ArrayPush,
1653 "array_shift", ArrayShift, 1664 "array_shift", ArrayShift,
1654 "array_splice", ArraySplice, 1665 "array_splice", ArraySplice,
1655 "array_slice", ArraySlice, 1666 "array_slice", ArraySlice,
1656 "array_unshift", ArrayUnshift, 1667 "array_unshift", ArrayUnshift,
1657 ]); 1668 ]);
1658 1669
1659 }); 1670 });
OLDNEW
« no previous file with comments | « no previous file | test/cctest/test-extra.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698