Chromium Code Reviews| 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 | 1037 class FastNewClosureStub : public TurboFanCodeStub { |
| 1038 class FastNewClosureStub : public HydrogenCodeStub { | |
| 1039 public: | 1038 public: |
| 1040 FastNewClosureStub(Isolate* isolate, LanguageMode language_mode, | 1039 FastNewClosureStub(Isolate* isolate, LanguageMode language_mode, |
| 1041 FunctionKind kind) | 1040 FunctionKind kind) |
| 1042 : HydrogenCodeStub(isolate) { | 1041 : TurboFanCodeStub(isolate) { |
| 1043 DCHECK(IsValidFunctionKind(kind)); | 1042 DCHECK(IsValidFunctionKind(kind)); |
| 1044 set_sub_minor_key(LanguageModeBits::encode(language_mode) | | 1043 minor_key_ = (LanguageModeBits::encode(language_mode) | |
|
Benedikt Meurer
2016/06/27 18:33:55
So both the language_mode and the kind are deriv(e
rmcilroy
2016/06/29 21:11:48
Done. PTAL, thanks.
| |
| 1045 FunctionKindBits::encode(kind)); | 1044 FunctionKindBits::encode(kind)); |
| 1046 } | 1045 } |
| 1047 | 1046 |
| 1047 static compiler::Node* Generate(CodeStubAssembler* assembler, | |
| 1048 compiler::Node* shared_info, | |
| 1049 compiler::Node* map_index, | |
| 1050 compiler::Node* context); | |
| 1051 | |
| 1048 LanguageMode language_mode() const { | 1052 LanguageMode language_mode() const { |
| 1049 return LanguageModeBits::decode(sub_minor_key()); | 1053 return LanguageModeBits::decode(MinorKey()); |
| 1050 } | 1054 } |
| 1051 | 1055 |
| 1052 FunctionKind kind() const { | 1056 FunctionKind kind() const { return FunctionKindBits::decode(MinorKey()); } |
| 1053 return FunctionKindBits::decode(sub_minor_key()); | |
| 1054 } | |
| 1055 | 1057 |
| 1056 private: | 1058 private: |
| 1057 STATIC_ASSERT(LANGUAGE_END == 3); | 1059 STATIC_ASSERT(LANGUAGE_END == 3); |
| 1058 class LanguageModeBits : public BitField<LanguageMode, 0, 2> {}; | 1060 class LanguageModeBits : public BitField<LanguageMode, 0, 2> {}; |
| 1059 class FunctionKindBits : public BitField<FunctionKind, 2, 9> {}; | 1061 class FunctionKindBits : public BitField<FunctionKind, 2, 9> {}; |
| 1060 | 1062 |
| 1061 DEFINE_CALL_INTERFACE_DESCRIPTOR(FastNewClosure); | 1063 DEFINE_CALL_INTERFACE_DESCRIPTOR(FastNewClosure); |
| 1062 DEFINE_HYDROGEN_CODE_STUB(FastNewClosure, HydrogenCodeStub); | 1064 DEFINE_TURBOFAN_CODE_STUB(FastNewClosure, TurboFanCodeStub); |
| 1063 }; | 1065 }; |
| 1064 | 1066 |
| 1065 | 1067 |
| 1066 class FastNewContextStub final : public HydrogenCodeStub { | 1068 class FastNewContextStub final : public HydrogenCodeStub { |
| 1067 public: | 1069 public: |
| 1068 static const int kMaximumSlots = 64; | 1070 static const int kMaximumSlots = 64; |
| 1069 | 1071 |
| 1070 FastNewContextStub(Isolate* isolate, int slots) : HydrogenCodeStub(isolate) { | 1072 FastNewContextStub(Isolate* isolate, int slots) : HydrogenCodeStub(isolate) { |
| 1071 DCHECK(slots >= 0 && slots <= kMaximumSlots); | 1073 DCHECK(slots >= 0 && slots <= kMaximumSlots); |
| 1072 set_sub_minor_key(SlotsBits::encode(slots)); | 1074 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 | 3115 #undef DEFINE_HYDROGEN_CODE_STUB |
| 3114 #undef DEFINE_CODE_STUB | 3116 #undef DEFINE_CODE_STUB |
| 3115 #undef DEFINE_CODE_STUB_BASE | 3117 #undef DEFINE_CODE_STUB_BASE |
| 3116 | 3118 |
| 3117 extern Representation RepresentationFromType(Type* type); | 3119 extern Representation RepresentationFromType(Type* type); |
| 3118 | 3120 |
| 3119 } // namespace internal | 3121 } // namespace internal |
| 3120 } // namespace v8 | 3122 } // namespace v8 |
| 3121 | 3123 |
| 3122 #endif // V8_CODE_STUBS_H_ | 3124 #endif // V8_CODE_STUBS_H_ |
| OLD | NEW |