| OLD | NEW | 
|     1 // Copyright 2012 the V8 project authors. All rights reserved. |     1 // Copyright 2012 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_CODE_STUBS_H_ |     5 #ifndef V8_CODE_STUBS_H_ | 
|     6 #define V8_CODE_STUBS_H_ |     6 #define V8_CODE_STUBS_H_ | 
|     7  |     7  | 
|     8 #include "src/allocation.h" |     8 #include "src/allocation.h" | 
|     9 #include "src/assembler.h" |     9 #include "src/assembler.h" | 
|    10 #include "src/code-stub-assembler.h" |    10 #include "src/code-stub-assembler.h" | 
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|    56   /* HydrogenCodeStubs */                   \ |    56   /* HydrogenCodeStubs */                   \ | 
|    57   V(BinaryOpIC)                             \ |    57   V(BinaryOpIC)                             \ | 
|    58   V(BinaryOpWithAllocationSite)             \ |    58   V(BinaryOpWithAllocationSite)             \ | 
|    59   V(CreateAllocationSite)                   \ |    59   V(CreateAllocationSite)                   \ | 
|    60   V(CreateWeakCell)                         \ |    60   V(CreateWeakCell)                         \ | 
|    61   V(ElementsTransitionAndStore)             \ |    61   V(ElementsTransitionAndStore)             \ | 
|    62   V(FastArrayPush)                          \ |    62   V(FastArrayPush)                          \ | 
|    63   V(FastCloneRegExp)                        \ |    63   V(FastCloneRegExp)                        \ | 
|    64   V(FastCloneShallowArray)                  \ |    64   V(FastCloneShallowArray)                  \ | 
|    65   V(FastFunctionBind)                       \ |    65   V(FastFunctionBind)                       \ | 
|    66   V(FastNewClosure)                         \ |  | 
|    67   V(FastNewContext)                         \ |    66   V(FastNewContext)                         \ | 
|    68   V(FastNewObject)                          \ |    67   V(FastNewObject)                          \ | 
|    69   V(FastNewRestParameter)                   \ |    68   V(FastNewRestParameter)                   \ | 
|    70   V(FastNewSloppyArguments)                 \ |    69   V(FastNewSloppyArguments)                 \ | 
|    71   V(FastNewStrictArguments)                 \ |    70   V(FastNewStrictArguments)                 \ | 
|    72   V(GrowArrayElements)                      \ |    71   V(GrowArrayElements)                      \ | 
|    73   V(KeyedLoadGeneric)                       \ |    72   V(KeyedLoadGeneric)                       \ | 
|    74   V(LoadScriptContextField)                 \ |    73   V(LoadScriptContextField)                 \ | 
|    75   V(LoadDictionaryElement)                  \ |    74   V(LoadDictionaryElement)                  \ | 
|    76   V(NameDictionaryLookup)                   \ |    75   V(NameDictionaryLookup)                   \ | 
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   111   V(ShiftRightLogical)                      \ |   110   V(ShiftRightLogical)                      \ | 
|   112   V(ShiftLeft)                              \ |   111   V(ShiftLeft)                              \ | 
|   113   V(BitwiseAnd)                             \ |   112   V(BitwiseAnd)                             \ | 
|   114   V(BitwiseOr)                              \ |   113   V(BitwiseOr)                              \ | 
|   115   V(BitwiseXor)                             \ |   114   V(BitwiseXor)                             \ | 
|   116   V(Inc)                                    \ |   115   V(Inc)                                    \ | 
|   117   V(InternalArrayNoArgumentConstructor)     \ |   116   V(InternalArrayNoArgumentConstructor)     \ | 
|   118   V(InternalArraySingleArgumentConstructor) \ |   117   V(InternalArraySingleArgumentConstructor) \ | 
|   119   V(Dec)                                    \ |   118   V(Dec)                                    \ | 
|   120   V(FastCloneShallowObject)                 \ |   119   V(FastCloneShallowObject)                 \ | 
 |   120   V(FastNewClosure)                         \ | 
|   121   V(InstanceOf)                             \ |   121   V(InstanceOf)                             \ | 
|   122   V(LessThan)                               \ |   122   V(LessThan)                               \ | 
|   123   V(LessThanOrEqual)                        \ |   123   V(LessThanOrEqual)                        \ | 
|   124   V(GreaterThan)                            \ |   124   V(GreaterThan)                            \ | 
|   125   V(GreaterThanOrEqual)                     \ |   125   V(GreaterThanOrEqual)                     \ | 
|   126   V(Equal)                                  \ |   126   V(Equal)                                  \ | 
|   127   V(NotEqual)                               \ |   127   V(NotEqual)                               \ | 
|   128   V(StrictEqual)                            \ |   128   V(StrictEqual)                            \ | 
|   129   V(StrictNotEqual)                         \ |   129   V(StrictNotEqual)                         \ | 
|   130   V(StringEqual)                            \ |   130   V(StringEqual)                            \ | 
| (...skipping 896 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  1027  |  1027  | 
|  1028   // Parameters accessed via CodeStubGraphBuilder::GetParameter() |  1028   // Parameters accessed via CodeStubGraphBuilder::GetParameter() | 
|  1029   static const int kObject = 0; |  1029   static const int kObject = 0; | 
|  1030  |  1030  | 
|  1031   static void GenerateAheadOfTime(Isolate* isolate); |  1031   static void GenerateAheadOfTime(Isolate* isolate); | 
|  1032  |  1032  | 
|  1033   DEFINE_CALL_INTERFACE_DESCRIPTOR(Typeof); |  1033   DEFINE_CALL_INTERFACE_DESCRIPTOR(Typeof); | 
|  1034   DEFINE_HYDROGEN_CODE_STUB(Typeof, HydrogenCodeStub); |  1034   DEFINE_HYDROGEN_CODE_STUB(Typeof, HydrogenCodeStub); | 
|  1035 }; |  1035 }; | 
|  1036  |  1036  | 
 |  1037 class FastNewClosureStub : public TurboFanCodeStub { | 
 |  1038  public: | 
 |  1039   explicit FastNewClosureStub(Isolate* isolate) : TurboFanCodeStub(isolate) {} | 
|  1037  |  1040  | 
|  1038 class FastNewClosureStub : public HydrogenCodeStub { |  1041   static compiler::Node* Generate(CodeStubAssembler* assembler, | 
|  1039  public: |  1042                                   compiler::Node* shared_info, | 
|  1040   FastNewClosureStub(Isolate* isolate, LanguageMode language_mode, |  1043                                   compiler::Node* context); | 
|  1041                      FunctionKind kind) |  | 
|  1042       : HydrogenCodeStub(isolate) { |  | 
|  1043     DCHECK(IsValidFunctionKind(kind)); |  | 
|  1044     set_sub_minor_key(LanguageModeBits::encode(language_mode) | |  | 
|  1045                       FunctionKindBits::encode(kind)); |  | 
|  1046   } |  | 
|  1047  |  | 
|  1048   LanguageMode language_mode() const { |  | 
|  1049     return LanguageModeBits::decode(sub_minor_key()); |  | 
|  1050   } |  | 
|  1051  |  | 
|  1052   FunctionKind kind() const { |  | 
|  1053     return FunctionKindBits::decode(sub_minor_key()); |  | 
|  1054   } |  | 
|  1055  |  | 
|  1056  private: |  | 
|  1057   STATIC_ASSERT(LANGUAGE_END == 3); |  | 
|  1058   class LanguageModeBits : public BitField<LanguageMode, 0, 2> {}; |  | 
|  1059   class FunctionKindBits : public BitField<FunctionKind, 2, 9> {}; |  | 
|  1060  |  1044  | 
|  1061   DEFINE_CALL_INTERFACE_DESCRIPTOR(FastNewClosure); |  1045   DEFINE_CALL_INTERFACE_DESCRIPTOR(FastNewClosure); | 
|  1062   DEFINE_HYDROGEN_CODE_STUB(FastNewClosure, HydrogenCodeStub); |  1046   DEFINE_TURBOFAN_CODE_STUB(FastNewClosure, TurboFanCodeStub); | 
|  1063 }; |  1047 }; | 
|  1064  |  1048  | 
|  1065  |  1049  | 
|  1066 class FastNewContextStub final : public HydrogenCodeStub { |  1050 class FastNewContextStub final : public HydrogenCodeStub { | 
|  1067  public: |  1051  public: | 
|  1068   static const int kMaximumSlots = 64; |  1052   static const int kMaximumSlots = 64; | 
|  1069  |  1053  | 
|  1070   FastNewContextStub(Isolate* isolate, int slots) : HydrogenCodeStub(isolate) { |  1054   FastNewContextStub(Isolate* isolate, int slots) : HydrogenCodeStub(isolate) { | 
|  1071     DCHECK(slots >= 0 && slots <= kMaximumSlots); |  1055     DCHECK(slots >= 0 && slots <= kMaximumSlots); | 
|  1072     set_sub_minor_key(SlotsBits::encode(slots)); |  1056     set_sub_minor_key(SlotsBits::encode(slots)); | 
| (...skipping 2040 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  3113 #undef DEFINE_HYDROGEN_CODE_STUB |  3097 #undef DEFINE_HYDROGEN_CODE_STUB | 
|  3114 #undef DEFINE_CODE_STUB |  3098 #undef DEFINE_CODE_STUB | 
|  3115 #undef DEFINE_CODE_STUB_BASE |  3099 #undef DEFINE_CODE_STUB_BASE | 
|  3116  |  3100  | 
|  3117 extern Representation RepresentationFromType(Type* type); |  3101 extern Representation RepresentationFromType(Type* type); | 
|  3118  |  3102  | 
|  3119 }  // namespace internal |  3103 }  // namespace internal | 
|  3120 }  // namespace v8 |  3104 }  // namespace v8 | 
|  3121  |  3105  | 
|  3122 #endif  // V8_CODE_STUBS_H_ |  3106 #endif  // V8_CODE_STUBS_H_ | 
| OLD | NEW |