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_BUILTINS_H_ | 5 #ifndef V8_BUILTINS_BUILTINS_H_ |
6 #define V8_BUILTINS_BUILTINS_H_ | 6 #define V8_BUILTINS_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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 // Args: name | 45 // Args: name |
46 // ASH: Handlers implemented in platform-dependent assembly. | 46 // ASH: Handlers implemented in platform-dependent assembly. |
47 // Args: name, code kind, extra IC state | 47 // Args: name, code kind, extra IC state |
48 // DBG: Builtin in platform-dependent assembly, used by the debugger. | 48 // DBG: Builtin in platform-dependent assembly, used by the debugger. |
49 // Args: name | 49 // Args: name |
50 #define BUILTIN_LIST(CPP, API, TFJ, TFS, ASM, ASH, DBG) \ | 50 #define BUILTIN_LIST(CPP, API, TFJ, TFS, ASM, ASH, DBG) \ |
51 ASM(Abort) \ | 51 ASM(Abort) \ |
52 /* Code aging */ \ | 52 /* Code aging */ \ |
53 CODE_AGE_LIST_WITH_ARG(DECLARE_CODE_AGE_BUILTIN, ASM) \ | 53 CODE_AGE_LIST_WITH_ARG(DECLARE_CODE_AGE_BUILTIN, ASM) \ |
54 \ | 54 \ |
| 55 TFS(ToObject, BUILTIN, kNoExtraICState, TypeConversion) \ |
| 56 \ |
55 /* Calls */ \ | 57 /* Calls */ \ |
56 ASM(ArgumentsAdaptorTrampoline) \ | 58 ASM(ArgumentsAdaptorTrampoline) \ |
57 /* ES6 section 9.2.1 [[Call]] ( thisArgument, argumentsList) */ \ | 59 /* ES6 section 9.2.1 [[Call]] ( thisArgument, argumentsList) */ \ |
58 ASM(CallFunction_ReceiverIsNullOrUndefined) \ | 60 ASM(CallFunction_ReceiverIsNullOrUndefined) \ |
59 ASM(CallFunction_ReceiverIsNotNullOrUndefined) \ | 61 ASM(CallFunction_ReceiverIsNotNullOrUndefined) \ |
60 ASM(CallFunction_ReceiverIsAny) \ | 62 ASM(CallFunction_ReceiverIsAny) \ |
61 ASM(TailCallFunction_ReceiverIsNullOrUndefined) \ | 63 ASM(TailCallFunction_ReceiverIsNullOrUndefined) \ |
62 ASM(TailCallFunction_ReceiverIsNotNullOrUndefined) \ | 64 ASM(TailCallFunction_ReceiverIsNotNullOrUndefined) \ |
63 ASM(TailCallFunction_ReceiverIsAny) \ | 65 ASM(TailCallFunction_ReceiverIsAny) \ |
64 /* ES6 section 9.4.1.1 [[Call]] ( thisArgument, argumentsList) */ \ | 66 /* ES6 section 9.4.1.1 [[Call]] ( thisArgument, argumentsList) */ \ |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 TypeConversion) \ | 167 TypeConversion) \ |
166 TFS(NonPrimitiveToPrimitive_Number, BUILTIN, kNoExtraICState, \ | 168 TFS(NonPrimitiveToPrimitive_Number, BUILTIN, kNoExtraICState, \ |
167 TypeConversion) \ | 169 TypeConversion) \ |
168 TFS(NonPrimitiveToPrimitive_String, BUILTIN, kNoExtraICState, \ | 170 TFS(NonPrimitiveToPrimitive_String, BUILTIN, kNoExtraICState, \ |
169 TypeConversion) \ | 171 TypeConversion) \ |
170 TFS(StringToNumber, BUILTIN, kNoExtraICState, TypeConversion) \ | 172 TFS(StringToNumber, BUILTIN, kNoExtraICState, TypeConversion) \ |
171 TFS(ToName, BUILTIN, kNoExtraICState, TypeConversion) \ | 173 TFS(ToName, BUILTIN, kNoExtraICState, TypeConversion) \ |
172 TFS(NonNumberToNumber, BUILTIN, kNoExtraICState, TypeConversion) \ | 174 TFS(NonNumberToNumber, BUILTIN, kNoExtraICState, TypeConversion) \ |
173 TFS(ToNumber, BUILTIN, kNoExtraICState, TypeConversion) \ | 175 TFS(ToNumber, BUILTIN, kNoExtraICState, TypeConversion) \ |
174 TFS(ToString, BUILTIN, kNoExtraICState, TypeConversion) \ | 176 TFS(ToString, BUILTIN, kNoExtraICState, TypeConversion) \ |
| 177 TFS(ToInteger, BUILTIN, kNoExtraICState, TypeConversion) \ |
| 178 TFS(ToLength, BUILTIN, kNoExtraICState, TypeConversion) \ |
| 179 TFS(Typeof, BUILTIN, kNoExtraICState, Typeof) \ |
175 \ | 180 \ |
176 /* Handlers */ \ | 181 /* Handlers */ \ |
177 ASH(KeyedLoadIC_Megamorphic, KEYED_LOAD_IC, kNoExtraICState) \ | 182 ASH(KeyedLoadIC_Megamorphic, KEYED_LOAD_IC, kNoExtraICState) \ |
178 TFS(KeyedLoadIC_Megamorphic_TF, KEYED_LOAD_IC, kNoExtraICState, \ | 183 TFS(KeyedLoadIC_Megamorphic_TF, KEYED_LOAD_IC, kNoExtraICState, \ |
179 LoadWithVector) \ | 184 LoadWithVector) \ |
180 ASM(KeyedLoadIC_Miss) \ | 185 ASM(KeyedLoadIC_Miss) \ |
181 ASH(KeyedLoadIC_Slow, HANDLER, Code::KEYED_LOAD_IC) \ | 186 ASH(KeyedLoadIC_Slow, HANDLER, Code::KEYED_LOAD_IC) \ |
182 ASH(KeyedStoreIC_Megamorphic, KEYED_STORE_IC, kNoExtraICState) \ | 187 ASH(KeyedStoreIC_Megamorphic, KEYED_STORE_IC, kNoExtraICState) \ |
183 ASH(KeyedStoreIC_Megamorphic_Strict, KEYED_STORE_IC, \ | 188 ASH(KeyedStoreIC_Megamorphic_Strict, KEYED_STORE_IC, \ |
184 StoreICState::kStrictModeState) \ | 189 StoreICState::kStrictModeState) \ |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
475 TFJ(NumberIsNaN, 2) \ | 480 TFJ(NumberIsNaN, 2) \ |
476 /* ES6 section 20.1.2.5 Number.isSafeInteger ( number ) */ \ | 481 /* ES6 section 20.1.2.5 Number.isSafeInteger ( number ) */ \ |
477 TFJ(NumberIsSafeInteger, 2) \ | 482 TFJ(NumberIsSafeInteger, 2) \ |
478 CPP(NumberPrototypeToExponential) \ | 483 CPP(NumberPrototypeToExponential) \ |
479 CPP(NumberPrototypeToFixed) \ | 484 CPP(NumberPrototypeToFixed) \ |
480 CPP(NumberPrototypeToLocaleString) \ | 485 CPP(NumberPrototypeToLocaleString) \ |
481 CPP(NumberPrototypeToPrecision) \ | 486 CPP(NumberPrototypeToPrecision) \ |
482 CPP(NumberPrototypeToString) \ | 487 CPP(NumberPrototypeToString) \ |
483 /* ES6 section 20.1.3.7 Number.prototype.valueOf ( ) */ \ | 488 /* ES6 section 20.1.3.7 Number.prototype.valueOf ( ) */ \ |
484 TFJ(NumberPrototypeValueOf, 1) \ | 489 TFJ(NumberPrototypeValueOf, 1) \ |
| 490 TFS(Add, BUILTIN, kNoExtraICState, BinaryOp) \ |
| 491 TFS(Subtract, BUILTIN, kNoExtraICState, BinaryOp) \ |
| 492 TFS(Multiply, BUILTIN, kNoExtraICState, BinaryOp) \ |
| 493 TFS(Divide, BUILTIN, kNoExtraICState, BinaryOp) \ |
| 494 TFS(Modulus, BUILTIN, kNoExtraICState, BinaryOp) \ |
| 495 TFS(BitwiseAnd, BUILTIN, kNoExtraICState, BinaryOp) \ |
| 496 TFS(BitwiseOr, BUILTIN, kNoExtraICState, BinaryOp) \ |
| 497 TFS(BitwiseXor, BUILTIN, kNoExtraICState, BinaryOp) \ |
| 498 TFS(ShiftLeft, BUILTIN, kNoExtraICState, BinaryOp) \ |
| 499 TFS(ShiftRight, BUILTIN, kNoExtraICState, BinaryOp) \ |
| 500 TFS(ShiftRightLogical, BUILTIN, kNoExtraICState, BinaryOp) \ |
| 501 TFS(LessThan, BUILTIN, kNoExtraICState, Compare) \ |
| 502 TFS(LessThanOrEqual, BUILTIN, kNoExtraICState, Compare) \ |
| 503 TFS(GreaterThan, BUILTIN, kNoExtraICState, Compare) \ |
| 504 TFS(GreaterThanOrEqual, BUILTIN, kNoExtraICState, Compare) \ |
| 505 TFS(Equal, BUILTIN, kNoExtraICState, Compare) \ |
| 506 TFS(NotEqual, BUILTIN, kNoExtraICState, Compare) \ |
| 507 TFS(StrictEqual, BUILTIN, kNoExtraICState, Compare) \ |
| 508 TFS(StrictNotEqual, BUILTIN, kNoExtraICState, Compare) \ |
485 \ | 509 \ |
486 /* Object */ \ | 510 /* Object */ \ |
487 CPP(ObjectAssign) \ | 511 CPP(ObjectAssign) \ |
488 CPP(ObjectCreate) \ | 512 CPP(ObjectCreate) \ |
489 CPP(ObjectDefineGetter) \ | 513 CPP(ObjectDefineGetter) \ |
490 CPP(ObjectDefineProperties) \ | 514 CPP(ObjectDefineProperties) \ |
491 CPP(ObjectDefineProperty) \ | 515 CPP(ObjectDefineProperty) \ |
492 CPP(ObjectDefineSetter) \ | 516 CPP(ObjectDefineSetter) \ |
493 CPP(ObjectEntries) \ | 517 CPP(ObjectEntries) \ |
494 CPP(ObjectFreeze) \ | 518 CPP(ObjectFreeze) \ |
(...skipping 11 matching lines...) Expand all Loading... |
506 CPP(ObjectKeys) \ | 530 CPP(ObjectKeys) \ |
507 CPP(ObjectLookupGetter) \ | 531 CPP(ObjectLookupGetter) \ |
508 CPP(ObjectLookupSetter) \ | 532 CPP(ObjectLookupSetter) \ |
509 CPP(ObjectPreventExtensions) \ | 533 CPP(ObjectPreventExtensions) \ |
510 /* ES6 section 19.1.3.6 Object.prototype.toString () */ \ | 534 /* ES6 section 19.1.3.6 Object.prototype.toString () */ \ |
511 TFJ(ObjectProtoToString, 1) \ | 535 TFJ(ObjectProtoToString, 1) \ |
512 CPP(ObjectPrototypePropertyIsEnumerable) \ | 536 CPP(ObjectPrototypePropertyIsEnumerable) \ |
513 CPP(ObjectSeal) \ | 537 CPP(ObjectSeal) \ |
514 CPP(ObjectValues) \ | 538 CPP(ObjectValues) \ |
515 \ | 539 \ |
| 540 TFS(HasProperty, BUILTIN, kNoExtraICState, HasProperty) \ |
| 541 TFS(InstanceOf, BUILTIN, kNoExtraICState, Compare) \ |
| 542 TFS(ForInFilter, BUILTIN, kNoExtraICState, ForInFilter) \ |
| 543 \ |
516 /* Proxy */ \ | 544 /* Proxy */ \ |
517 CPP(ProxyConstructor) \ | 545 CPP(ProxyConstructor) \ |
518 CPP(ProxyConstructor_ConstructStub) \ | 546 CPP(ProxyConstructor_ConstructStub) \ |
519 \ | 547 \ |
520 /* Reflect */ \ | 548 /* Reflect */ \ |
521 ASM(ReflectApply) \ | 549 ASM(ReflectApply) \ |
522 ASM(ReflectConstruct) \ | 550 ASM(ReflectConstruct) \ |
523 CPP(ReflectDefineProperty) \ | 551 CPP(ReflectDefineProperty) \ |
524 CPP(ReflectDeleteProperty) \ | 552 CPP(ReflectDeleteProperty) \ |
525 CPP(ReflectGet) \ | 553 CPP(ReflectGet) \ |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
735 | 763 |
736 friend class Isolate; | 764 friend class Isolate; |
737 | 765 |
738 DISALLOW_COPY_AND_ASSIGN(Builtins); | 766 DISALLOW_COPY_AND_ASSIGN(Builtins); |
739 }; | 767 }; |
740 | 768 |
741 } // namespace internal | 769 } // namespace internal |
742 } // namespace v8 | 770 } // namespace v8 |
743 | 771 |
744 #endif // V8_BUILTINS_BUILTINS_H_ | 772 #endif // V8_BUILTINS_BUILTINS_H_ |
OLD | NEW |