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/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 1933 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1944 // Parameters accessed via CodeStubGraphBuilder::GetParameter() | 1944 // Parameters accessed via CodeStubGraphBuilder::GetParameter() |
1945 static const int kLength = 0; | 1945 static const int kLength = 0; |
1946 static const int kIndex = 1; | 1946 static const int kIndex = 1; |
1947 static const int kInput = 2; | 1947 static const int kInput = 2; |
1948 | 1948 |
1949 DEFINE_CALL_INTERFACE_DESCRIPTOR(RegExpConstructResult); | 1949 DEFINE_CALL_INTERFACE_DESCRIPTOR(RegExpConstructResult); |
1950 DEFINE_HYDROGEN_CODE_STUB(RegExpConstructResult, HydrogenCodeStub); | 1950 DEFINE_HYDROGEN_CODE_STUB(RegExpConstructResult, HydrogenCodeStub); |
1951 }; | 1951 }; |
1952 | 1952 |
1953 | 1953 |
1954 class CallConstructStub: public PlatformCodeStub { | 1954 // TODO(bmeurer/mvstanton): Turn CallConstructStub into ConstructICStub. |
| 1955 class CallConstructStub final : public PlatformCodeStub { |
1955 public: | 1956 public: |
1956 CallConstructStub(Isolate* isolate, CallConstructorFlags flags) | 1957 explicit CallConstructStub(Isolate* isolate) : PlatformCodeStub(isolate) {} |
1957 : PlatformCodeStub(isolate) { | |
1958 minor_key_ = FlagBits::encode(flags); | |
1959 } | |
1960 | |
1961 void FinishCode(Handle<Code> code) override { | |
1962 code->set_has_function_cache(RecordCallTarget()); | |
1963 } | |
1964 | |
1965 private: | |
1966 CallConstructorFlags flags() const { return FlagBits::decode(minor_key_); } | |
1967 | |
1968 bool RecordCallTarget() const { | |
1969 return (flags() & RECORD_CONSTRUCTOR_TARGET) != 0; | |
1970 } | |
1971 | |
1972 bool IsSuperConstructorCall() const { | |
1973 return (flags() & SUPER_CONSTRUCTOR_CALL) != 0; | |
1974 } | |
1975 | |
1976 void PrintName(std::ostream& os) const override; // NOLINT | |
1977 | |
1978 class FlagBits : public BitField<CallConstructorFlags, 0, 2> {}; | |
1979 | 1958 |
1980 DEFINE_CALL_INTERFACE_DESCRIPTOR(CallConstruct); | 1959 DEFINE_CALL_INTERFACE_DESCRIPTOR(CallConstruct); |
1981 DEFINE_PLATFORM_CODE_STUB(CallConstruct, PlatformCodeStub); | 1960 DEFINE_PLATFORM_CODE_STUB(CallConstruct, PlatformCodeStub); |
1982 }; | 1961 }; |
1983 | 1962 |
1984 | 1963 |
1985 enum StringIndexFlags { | 1964 enum StringIndexFlags { |
1986 // Accepts smis or heap numbers. | 1965 // Accepts smis or heap numbers. |
1987 STRING_INDEX_IS_NUMBER, | 1966 STRING_INDEX_IS_NUMBER, |
1988 | 1967 |
(...skipping 1082 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3071 #undef DEFINE_HYDROGEN_CODE_STUB | 3050 #undef DEFINE_HYDROGEN_CODE_STUB |
3072 #undef DEFINE_CODE_STUB | 3051 #undef DEFINE_CODE_STUB |
3073 #undef DEFINE_CODE_STUB_BASE | 3052 #undef DEFINE_CODE_STUB_BASE |
3074 | 3053 |
3075 extern Representation RepresentationFromType(Type* type); | 3054 extern Representation RepresentationFromType(Type* type); |
3076 | 3055 |
3077 } // namespace internal | 3056 } // namespace internal |
3078 } // namespace v8 | 3057 } // namespace v8 |
3079 | 3058 |
3080 #endif // V8_CODE_STUBS_H_ | 3059 #endif // V8_CODE_STUBS_H_ |
OLD | NEW |