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

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: Comment response. Created 3 years, 8 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
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 1750 matching lines...) Expand 10 before | Expand all | Expand 10 after
1761 JSObject::SetElement(isolate, array, 0, 1761 JSObject::SetElement(isolate, array, 0,
1762 Handle<Smi>(Smi::FromInt(1), isolate), SLOPPY) 1762 Handle<Smi>(Smi::FromInt(1), isolate), SLOPPY)
1763 .Check(); 1763 .Check();
1764 JSObject::SetElement(isolate, array, 1, 1764 JSObject::SetElement(isolate, array, 1,
1765 Handle<Smi>(Smi::FromInt(2), isolate), SLOPPY) 1765 Handle<Smi>(Smi::FromInt(2), isolate), SLOPPY)
1766 .Check(); 1766 .Check();
1767 CodeStubArguments args(this, IntPtrConstant(kNumParams)); 1767 CodeStubArguments args(this, IntPtrConstant(kNumParams));
1768 Variable arg_index(this, MachineType::PointerRepresentation()); 1768 Variable arg_index(this, MachineType::PointerRepresentation());
1769 Label bailout(this); 1769 Label bailout(this);
1770 arg_index.Bind(IntPtrConstant(0)); 1770 arg_index.Bind(IntPtrConstant(0));
1771 Node* length = BuildAppendJSArray( 1771 Node* length = BuildAppendJSArray(kind_, HeapConstant(array), args,
1772 kind_, HeapConstant(Handle<HeapObject>(isolate->context(), isolate)), 1772 arg_index, &bailout);
1773 HeapConstant(array), args, arg_index, &bailout);
1774 Return(length); 1773 Return(length);
1775 1774
1776 Bind(&bailout); 1775 Bind(&bailout);
1777 Return(SmiTag(IntPtrAdd(arg_index.value(), IntPtrConstant(2)))); 1776 Return(SmiTag(IntPtrAdd(arg_index.value(), IntPtrConstant(2))));
1778 1777
1779 Handle<Code> code = tester->GenerateCode(); 1778 Handle<Code> code = tester->GenerateCode();
1780 CHECK(!code.is_null()); 1779 CHECK(!code.is_null());
1781 1780
1782 FunctionTester ft(code, kNumParams); 1781 FunctionTester ft(code, kNumParams);
1783 1782
(...skipping 817 matching lines...) Expand 10 before | Expand all | Expand 10 after
2601 m.Return(m.SmiConstant(0)); 2600 m.Return(m.SmiConstant(0));
2602 2601
2603 Handle<Code> code = data.GenerateCode(); 2602 Handle<Code> code = data.GenerateCode();
2604 CHECK(!code.is_null()); 2603 CHECK(!code.is_null());
2605 FunctionTester ft(code, kNumParams); 2604 FunctionTester ft(code, kNumParams);
2606 CHECK_EQ(1, Handle<Smi>::cast(ft.Call().ToHandleChecked())->value()); 2605 CHECK_EQ(1, Handle<Smi>::cast(ft.Call().ToHandleChecked())->value());
2607 } 2606 }
2608 2607
2609 } // namespace internal 2608 } // namespace internal
2610 } // namespace v8 2609 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698