OLD | NEW |
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 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 \ | 257 \ |
258 V(FunctionPrototypeApply, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 258 V(FunctionPrototypeApply, BUILTIN, UNINITIALIZED, kNoExtraICState) \ |
259 V(FunctionPrototypeCall, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 259 V(FunctionPrototypeCall, BUILTIN, UNINITIALIZED, kNoExtraICState) \ |
260 \ | 260 \ |
261 V(ReflectApply, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 261 V(ReflectApply, BUILTIN, UNINITIALIZED, kNoExtraICState) \ |
262 V(ReflectConstruct, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 262 V(ReflectConstruct, BUILTIN, UNINITIALIZED, kNoExtraICState) \ |
263 \ | 263 \ |
264 V(InternalArrayCode, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 264 V(InternalArrayCode, BUILTIN, UNINITIALIZED, kNoExtraICState) \ |
265 V(ArrayCode, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 265 V(ArrayCode, BUILTIN, UNINITIALIZED, kNoExtraICState) \ |
266 \ | 266 \ |
| 267 V(MathMax, BUILTIN, UNINITIALIZED, kNoExtraICState) \ |
| 268 V(MathMin, BUILTIN, UNINITIALIZED, kNoExtraICState) \ |
| 269 \ |
267 V(NumberConstructor, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 270 V(NumberConstructor, BUILTIN, UNINITIALIZED, kNoExtraICState) \ |
268 V(NumberConstructor_ConstructStub, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 271 V(NumberConstructor_ConstructStub, BUILTIN, UNINITIALIZED, kNoExtraICState) \ |
269 \ | 272 \ |
270 V(StringConstructor, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 273 V(StringConstructor, BUILTIN, UNINITIALIZED, kNoExtraICState) \ |
271 V(StringConstructor_ConstructStub, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 274 V(StringConstructor_ConstructStub, BUILTIN, UNINITIALIZED, kNoExtraICState) \ |
272 \ | 275 \ |
273 V(OnStackReplacement, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 276 V(OnStackReplacement, BUILTIN, UNINITIALIZED, kNoExtraICState) \ |
274 V(InterruptCheck, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 277 V(InterruptCheck, BUILTIN, UNINITIALIZED, kNoExtraICState) \ |
275 V(OsrAfterStackCheck, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 278 V(OsrAfterStackCheck, BUILTIN, UNINITIALIZED, kNoExtraICState) \ |
276 V(StackCheck, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 279 V(StackCheck, BUILTIN, UNINITIALIZED, kNoExtraICState) \ |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
539 | 542 |
540 static void Generate_FunctionPrototypeApply(MacroAssembler* masm); | 543 static void Generate_FunctionPrototypeApply(MacroAssembler* masm); |
541 static void Generate_FunctionPrototypeCall(MacroAssembler* masm); | 544 static void Generate_FunctionPrototypeCall(MacroAssembler* masm); |
542 | 545 |
543 static void Generate_ReflectApply(MacroAssembler* masm); | 546 static void Generate_ReflectApply(MacroAssembler* masm); |
544 static void Generate_ReflectConstruct(MacroAssembler* masm); | 547 static void Generate_ReflectConstruct(MacroAssembler* masm); |
545 | 548 |
546 static void Generate_InternalArrayCode(MacroAssembler* masm); | 549 static void Generate_InternalArrayCode(MacroAssembler* masm); |
547 static void Generate_ArrayCode(MacroAssembler* masm); | 550 static void Generate_ArrayCode(MacroAssembler* masm); |
548 | 551 |
| 552 enum class MathMaxMinKind { kMax, kMin }; |
| 553 static void Generate_MathMaxMin(MacroAssembler* masm, MathMaxMinKind kind); |
| 554 // ES6 section 20.2.2.24 Math.max ( value1, value2 , ...values ) |
| 555 static void Generate_MathMax(MacroAssembler* masm) { |
| 556 Generate_MathMaxMin(masm, MathMaxMinKind::kMax); |
| 557 } |
| 558 // ES6 section 20.2.2.25 Math.min ( value1, value2 , ...values ) |
| 559 static void Generate_MathMin(MacroAssembler* masm) { |
| 560 Generate_MathMaxMin(masm, MathMaxMinKind::kMin); |
| 561 } |
| 562 |
549 // ES6 section 20.1.1.1 Number ( [ value ] ) for the [[Call]] case. | 563 // ES6 section 20.1.1.1 Number ( [ value ] ) for the [[Call]] case. |
550 static void Generate_NumberConstructor(MacroAssembler* masm); | 564 static void Generate_NumberConstructor(MacroAssembler* masm); |
551 // ES6 section 20.1.1.1 Number ( [ value ] ) for the [[Construct]] case. | 565 // ES6 section 20.1.1.1 Number ( [ value ] ) for the [[Construct]] case. |
552 static void Generate_NumberConstructor_ConstructStub(MacroAssembler* masm); | 566 static void Generate_NumberConstructor_ConstructStub(MacroAssembler* masm); |
553 | 567 |
554 static void Generate_StringConstructor(MacroAssembler* masm); | 568 static void Generate_StringConstructor(MacroAssembler* masm); |
555 static void Generate_StringConstructor_ConstructStub(MacroAssembler* masm); | 569 static void Generate_StringConstructor_ConstructStub(MacroAssembler* masm); |
556 static void Generate_OnStackReplacement(MacroAssembler* masm); | 570 static void Generate_OnStackReplacement(MacroAssembler* masm); |
557 static void Generate_OsrAfterStackCheck(MacroAssembler* masm); | 571 static void Generate_OsrAfterStackCheck(MacroAssembler* masm); |
558 static void Generate_InterruptCheck(MacroAssembler* masm); | 572 static void Generate_InterruptCheck(MacroAssembler* masm); |
(...skipping 27 matching lines...) Expand all Loading... |
586 friend class BuiltinFunctionTable; | 600 friend class BuiltinFunctionTable; |
587 friend class Isolate; | 601 friend class Isolate; |
588 | 602 |
589 DISALLOW_COPY_AND_ASSIGN(Builtins); | 603 DISALLOW_COPY_AND_ASSIGN(Builtins); |
590 }; | 604 }; |
591 | 605 |
592 } // namespace internal | 606 } // namespace internal |
593 } // namespace v8 | 607 } // namespace v8 |
594 | 608 |
595 #endif // V8_BUILTINS_H_ | 609 #endif // V8_BUILTINS_H_ |
OLD | NEW |