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

Side by Side Diff: src/builtins.h

Issue 1841993002: [builtins] Make Math.ceil, Math.trunc and Math.round optimizable. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 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
« no previous file with comments | « src/bootstrapper.cc ('k') | src/builtins.cc » ('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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 #ifndef V8_BUILTINS_H_ 5 #ifndef V8_BUILTINS_H_
6 #define V8_BUILTINS_H_ 6 #define V8_BUILTINS_H_
7 7
8 #include "src/base/flags.h" 8 #include "src/base/flags.h"
9 #include "src/handles.h" 9 #include "src/handles.h"
10 10
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 V(InterruptCheck, BUILTIN, UNINITIALIZED, kNoExtraICState) \ 301 V(InterruptCheck, BUILTIN, UNINITIALIZED, kNoExtraICState) \
302 V(StackCheck, BUILTIN, UNINITIALIZED, kNoExtraICState) \ 302 V(StackCheck, BUILTIN, UNINITIALIZED, kNoExtraICState) \
303 \ 303 \
304 V(MarkCodeAsToBeExecutedOnce, BUILTIN, UNINITIALIZED, kNoExtraICState) \ 304 V(MarkCodeAsToBeExecutedOnce, BUILTIN, UNINITIALIZED, kNoExtraICState) \
305 V(MarkCodeAsExecutedOnce, BUILTIN, UNINITIALIZED, kNoExtraICState) \ 305 V(MarkCodeAsExecutedOnce, BUILTIN, UNINITIALIZED, kNoExtraICState) \
306 V(MarkCodeAsExecutedTwice, BUILTIN, UNINITIALIZED, kNoExtraICState) \ 306 V(MarkCodeAsExecutedTwice, BUILTIN, UNINITIALIZED, kNoExtraICState) \
307 CODE_AGE_LIST_WITH_ARG(DECLARE_CODE_AGE_BUILTIN, V) 307 CODE_AGE_LIST_WITH_ARG(DECLARE_CODE_AGE_BUILTIN, V)
308 308
309 // Define list of builtins implemented in TurboFan (with JS linkage). 309 // Define list of builtins implemented in TurboFan (with JS linkage).
310 #define BUILTIN_LIST_T(V) \ 310 #define BUILTIN_LIST_T(V) \
311 V(MathCeil, 2) \
311 V(MathFloor, 2) \ 312 V(MathFloor, 2) \
312 V(MathSqrt, 2) 313 V(MathRound, 2) \
314 V(MathSqrt, 2) \
315 V(MathTrunc, 2)
313 316
314 // Define list of builtin handlers implemented in assembly. 317 // Define list of builtin handlers implemented in assembly.
315 #define BUILTIN_LIST_H(V) \ 318 #define BUILTIN_LIST_H(V) \
316 V(LoadIC_Slow, LOAD_IC) \ 319 V(LoadIC_Slow, LOAD_IC) \
317 V(KeyedLoadIC_Slow, KEYED_LOAD_IC) \ 320 V(KeyedLoadIC_Slow, KEYED_LOAD_IC) \
318 V(StoreIC_Slow, STORE_IC) \ 321 V(StoreIC_Slow, STORE_IC) \
319 V(KeyedStoreIC_Slow, KEYED_STORE_IC) \ 322 V(KeyedStoreIC_Slow, KEYED_STORE_IC) \
320 V(LoadIC_Normal, LOAD_IC) \ 323 V(LoadIC_Normal, LOAD_IC) \
321 V(StoreIC_Normal, STORE_IC) 324 V(StoreIC_Normal, STORE_IC)
322 325
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
575 static void Generate_FunctionHasInstance(MacroAssembler* masm); 578 static void Generate_FunctionHasInstance(MacroAssembler* masm);
576 static void Generate_FunctionPrototypeApply(MacroAssembler* masm); 579 static void Generate_FunctionPrototypeApply(MacroAssembler* masm);
577 static void Generate_FunctionPrototypeCall(MacroAssembler* masm); 580 static void Generate_FunctionPrototypeCall(MacroAssembler* masm);
578 581
579 static void Generate_ReflectApply(MacroAssembler* masm); 582 static void Generate_ReflectApply(MacroAssembler* masm);
580 static void Generate_ReflectConstruct(MacroAssembler* masm); 583 static void Generate_ReflectConstruct(MacroAssembler* masm);
581 584
582 static void Generate_InternalArrayCode(MacroAssembler* masm); 585 static void Generate_InternalArrayCode(MacroAssembler* masm);
583 static void Generate_ArrayCode(MacroAssembler* masm); 586 static void Generate_ArrayCode(MacroAssembler* masm);
584 587
588 // ES6 section 20.2.2.10 Math.floor ( x )
589 static void Generate_MathCeil(compiler::CodeStubAssembler* assembler);
585 // ES6 section 20.2.2.16 Math.floor ( x ) 590 // ES6 section 20.2.2.16 Math.floor ( x )
586 static void Generate_MathFloor(compiler::CodeStubAssembler* assembler); 591 static void Generate_MathFloor(compiler::CodeStubAssembler* assembler);
587 enum class MathMaxMinKind { kMax, kMin }; 592 enum class MathMaxMinKind { kMax, kMin };
588 static void Generate_MathMaxMin(MacroAssembler* masm, MathMaxMinKind kind); 593 static void Generate_MathMaxMin(MacroAssembler* masm, MathMaxMinKind kind);
589 // ES6 section 20.2.2.24 Math.max ( value1, value2 , ...values ) 594 // ES6 section 20.2.2.24 Math.max ( value1, value2 , ...values )
590 static void Generate_MathMax(MacroAssembler* masm) { 595 static void Generate_MathMax(MacroAssembler* masm) {
591 Generate_MathMaxMin(masm, MathMaxMinKind::kMax); 596 Generate_MathMaxMin(masm, MathMaxMinKind::kMax);
592 } 597 }
593 // ES6 section 20.2.2.25 Math.min ( value1, value2 , ...values ) 598 // ES6 section 20.2.2.25 Math.min ( value1, value2 , ...values )
594 static void Generate_MathMin(MacroAssembler* masm) { 599 static void Generate_MathMin(MacroAssembler* masm) {
595 Generate_MathMaxMin(masm, MathMaxMinKind::kMin); 600 Generate_MathMaxMin(masm, MathMaxMinKind::kMin);
596 } 601 }
602 // ES6 section 20.2.2.28 Math.round ( x )
603 static void Generate_MathRound(compiler::CodeStubAssembler* assembler);
597 // ES6 section 20.2.2.32 Math.sqrt ( x ) 604 // ES6 section 20.2.2.32 Math.sqrt ( x )
598 static void Generate_MathSqrt(compiler::CodeStubAssembler* assembler); 605 static void Generate_MathSqrt(compiler::CodeStubAssembler* assembler);
606 // ES6 section 20.2.2.35 Math.trunc ( x )
607 static void Generate_MathTrunc(compiler::CodeStubAssembler* assembler);
599 608
600 // ES6 section 20.1.1.1 Number ( [ value ] ) for the [[Call]] case. 609 // ES6 section 20.1.1.1 Number ( [ value ] ) for the [[Call]] case.
601 static void Generate_NumberConstructor(MacroAssembler* masm); 610 static void Generate_NumberConstructor(MacroAssembler* masm);
602 // ES6 section 20.1.1.1 Number ( [ value ] ) for the [[Construct]] case. 611 // ES6 section 20.1.1.1 Number ( [ value ] ) for the [[Construct]] case.
603 static void Generate_NumberConstructor_ConstructStub(MacroAssembler* masm); 612 static void Generate_NumberConstructor_ConstructStub(MacroAssembler* masm);
604 613
605 static void Generate_StringConstructor(MacroAssembler* masm); 614 static void Generate_StringConstructor(MacroAssembler* masm);
606 static void Generate_StringConstructor_ConstructStub(MacroAssembler* masm); 615 static void Generate_StringConstructor_ConstructStub(MacroAssembler* masm);
607 static void Generate_OnStackReplacement(MacroAssembler* masm); 616 static void Generate_OnStackReplacement(MacroAssembler* masm);
608 static void Generate_InterruptCheck(MacroAssembler* masm); 617 static void Generate_InterruptCheck(MacroAssembler* masm);
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
644 friend class BuiltinFunctionTable; 653 friend class BuiltinFunctionTable;
645 friend class Isolate; 654 friend class Isolate;
646 655
647 DISALLOW_COPY_AND_ASSIGN(Builtins); 656 DISALLOW_COPY_AND_ASSIGN(Builtins);
648 }; 657 };
649 658
650 } // namespace internal 659 } // namespace internal
651 } // namespace v8 660 } // namespace v8
652 661
653 #endif // V8_BUILTINS_H_ 662 #endif // V8_BUILTINS_H_
OLDNEW
« no previous file with comments | « src/bootstrapper.cc ('k') | src/builtins.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698