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

Side by Side Diff: test/cctest/test-code-stub-assembler.cc

Issue 2775503006: [builtins] Improve performance of array.prototype.filter and map (Closed)
Patch Set: Code comments Created 3 years, 7 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 | « src/js/typedarray.js ('k') | test/mjsunit/stack-traces.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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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 #include <cmath> 5 #include <cmath>
6 6
7 #include "src/api.h" 7 #include "src/api.h"
8 #include "src/base/utils/random-number-generator.h" 8 #include "src/base/utils/random-number-generator.h"
9 #include "src/builtins/builtins-promise-gen.h" 9 #include "src/builtins/builtins-promise-gen.h"
10 #include "src/code-factory.h" 10 #include "src/code-factory.h"
(...skipping 1789 matching lines...) Expand 10 before | Expand all | Expand 10 after
1800 JSObject::SetElement(isolate, array, 0, 1800 JSObject::SetElement(isolate, array, 0,
1801 Handle<Smi>(Smi::FromInt(1), isolate), SLOPPY) 1801 Handle<Smi>(Smi::FromInt(1), isolate), SLOPPY)
1802 .Check(); 1802 .Check();
1803 JSObject::SetElement(isolate, array, 1, 1803 JSObject::SetElement(isolate, array, 1,
1804 Handle<Smi>(Smi::FromInt(2), isolate), SLOPPY) 1804 Handle<Smi>(Smi::FromInt(2), isolate), SLOPPY)
1805 .Check(); 1805 .Check();
1806 CodeStubArguments args(this, IntPtrConstant(kNumParams)); 1806 CodeStubArguments args(this, IntPtrConstant(kNumParams));
1807 Variable arg_index(this, MachineType::PointerRepresentation()); 1807 Variable arg_index(this, MachineType::PointerRepresentation());
1808 Label bailout(this); 1808 Label bailout(this);
1809 arg_index.Bind(IntPtrConstant(0)); 1809 arg_index.Bind(IntPtrConstant(0));
1810 Node* length = BuildAppendJSArray( 1810 Node* length = BuildAppendJSArray(kind_, HeapConstant(array), args,
1811 kind_, HeapConstant(Handle<HeapObject>(isolate->context(), isolate)), 1811 arg_index, &bailout);
1812 HeapConstant(array), args, arg_index, &bailout);
1813 Return(length); 1812 Return(length);
1814 1813
1815 Bind(&bailout); 1814 Bind(&bailout);
1816 Return(SmiTag(IntPtrAdd(arg_index.value(), IntPtrConstant(2)))); 1815 Return(SmiTag(IntPtrAdd(arg_index.value(), IntPtrConstant(2))));
1817 1816
1818 Handle<Code> code = tester->GenerateCode(); 1817 Handle<Code> code = tester->GenerateCode();
1819 CHECK(!code.is_null()); 1818 CHECK(!code.is_null());
1820 1819
1821 FunctionTester ft(code, kNumParams); 1820 FunctionTester ft(code, kNumParams);
1822 1821
(...skipping 817 matching lines...) Expand 10 before | Expand all | Expand 10 after
2640 m.Return(m.SmiConstant(0)); 2639 m.Return(m.SmiConstant(0));
2641 2640
2642 Handle<Code> code = data.GenerateCode(); 2641 Handle<Code> code = data.GenerateCode();
2643 CHECK(!code.is_null()); 2642 CHECK(!code.is_null());
2644 FunctionTester ft(code, kNumParams); 2643 FunctionTester ft(code, kNumParams);
2645 CHECK_EQ(1, Handle<Smi>::cast(ft.Call().ToHandleChecked())->value()); 2644 CHECK_EQ(1, Handle<Smi>::cast(ft.Call().ToHandleChecked())->value());
2646 } 2645 }
2647 2646
2648 } // namespace internal 2647 } // namespace internal
2649 } // namespace v8 2648 } // namespace v8
OLDNEW
« no previous file with comments | « src/js/typedarray.js ('k') | test/mjsunit/stack-traces.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698