| 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 2855 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2866 // only has room for two bytes to hold a set of these types. :-P | 2866 // only has room for two bytes to hold a set of these types. :-P |
| 2867 STATIC_ASSERT(NUMBER_OF_TYPES <= 16); | 2867 STATIC_ASSERT(NUMBER_OF_TYPES <= 16); |
| 2868 | 2868 |
| 2869 class Types : public EnumSet<Type, uint16_t> { | 2869 class Types : public EnumSet<Type, uint16_t> { |
| 2870 public: | 2870 public: |
| 2871 Types() : EnumSet<Type, uint16_t>(0) {} | 2871 Types() : EnumSet<Type, uint16_t>(0) {} |
| 2872 explicit Types(uint16_t bits) : EnumSet<Type, uint16_t>(bits) {} | 2872 explicit Types(uint16_t bits) : EnumSet<Type, uint16_t>(bits) {} |
| 2873 | 2873 |
| 2874 bool UpdateStatus(Handle<Object> object); | 2874 bool UpdateStatus(Handle<Object> object); |
| 2875 bool NeedsMap() const; | 2875 bool NeedsMap() const; |
| 2876 bool CanBeUndetectable() const; | 2876 bool CanBeUndetectable() const { |
| 2877 return Contains(ToBooleanStub::SPEC_OBJECT); |
| 2878 } |
| 2877 bool IsGeneric() const { return ToIntegral() == Generic().ToIntegral(); } | 2879 bool IsGeneric() const { return ToIntegral() == Generic().ToIntegral(); } |
| 2878 | 2880 |
| 2879 static Types Generic() { return Types((1 << NUMBER_OF_TYPES) - 1); } | 2881 static Types Generic() { return Types((1 << NUMBER_OF_TYPES) - 1); } |
| 2880 }; | 2882 }; |
| 2881 | 2883 |
| 2882 ToBooleanStub(Isolate* isolate, ResultMode mode, Types types = Types()) | 2884 ToBooleanStub(Isolate* isolate, ResultMode mode, Types types = Types()) |
| 2883 : HydrogenCodeStub(isolate) { | 2885 : HydrogenCodeStub(isolate) { |
| 2884 set_sub_minor_key(TypesBits::encode(types.ToIntegral()) | | 2886 set_sub_minor_key(TypesBits::encode(types.ToIntegral()) | |
| 2885 ResultModeBits::encode(mode)); | 2887 ResultModeBits::encode(mode)); |
| 2886 } | 2888 } |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3073 #undef DEFINE_PLATFORM_CODE_STUB | 3075 #undef DEFINE_PLATFORM_CODE_STUB |
| 3074 #undef DEFINE_HANDLER_CODE_STUB | 3076 #undef DEFINE_HANDLER_CODE_STUB |
| 3075 #undef DEFINE_HYDROGEN_CODE_STUB | 3077 #undef DEFINE_HYDROGEN_CODE_STUB |
| 3076 #undef DEFINE_CODE_STUB | 3078 #undef DEFINE_CODE_STUB |
| 3077 #undef DEFINE_CODE_STUB_BASE | 3079 #undef DEFINE_CODE_STUB_BASE |
| 3078 | 3080 |
| 3079 extern Representation RepresentationFromType(Type* type); | 3081 extern Representation RepresentationFromType(Type* type); |
| 3080 } } // namespace v8::internal | 3082 } } // namespace v8::internal |
| 3081 | 3083 |
| 3082 #endif // V8_CODE_STUBS_H_ | 3084 #endif // V8_CODE_STUBS_H_ |
| OLD | NEW |