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 1040 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1051 static compiler::Node* Generate(CodeStubAssembler* assembler, | 1051 static compiler::Node* Generate(CodeStubAssembler* assembler, |
1052 compiler::Node* shared_info, | 1052 compiler::Node* shared_info, |
1053 compiler::Node* context); | 1053 compiler::Node* context); |
1054 | 1054 |
1055 DEFINE_CALL_INTERFACE_DESCRIPTOR(FastNewClosure); | 1055 DEFINE_CALL_INTERFACE_DESCRIPTOR(FastNewClosure); |
1056 DEFINE_TURBOFAN_CODE_STUB(FastNewClosure, TurboFanCodeStub); | 1056 DEFINE_TURBOFAN_CODE_STUB(FastNewClosure, TurboFanCodeStub); |
1057 }; | 1057 }; |
1058 | 1058 |
1059 class FastNewFunctionContextStub final : public TurboFanCodeStub { | 1059 class FastNewFunctionContextStub final : public TurboFanCodeStub { |
1060 public: | 1060 public: |
1061 static const int kMaximumSlots = 64; | 1061 static const int kMaximumSlots = 64; |
klaasb
2016/07/26 17:04:52
I'm unsure whether/why we need to still limit this
rmcilroy
2016/07/27 11:11:39
Sounds reasonable to me, any reason why not to do
Benedikt Meurer
2016/08/01 17:35:08
Makes sense. Please do that.
| |
1062 | 1062 |
1063 FastNewFunctionContextStub(Isolate* isolate, int slots) | 1063 explicit FastNewFunctionContextStub(Isolate* isolate) |
1064 : TurboFanCodeStub(isolate) { | 1064 : TurboFanCodeStub(isolate) {} |
1065 DCHECK(slots >= 0 && slots <= kMaximumSlots); | |
1066 minor_key_ = SlotsBits::encode(slots); | |
1067 } | |
1068 | |
1069 int slots() const { return SlotsBits::decode(minor_key_); } | |
1070 | 1065 |
1071 private: | 1066 private: |
1072 class SlotsBits : public BitField<int, 0, 8> {}; | 1067 class SlotsBits : public BitField<int, 0, 8> {}; |
rmcilroy
2016/07/27 11:11:38
You can delete the SlotBits class now too.
klaasb
2016/07/27 17:06:31
Done.
| |
1073 | 1068 |
1074 DEFINE_CALL_INTERFACE_DESCRIPTOR(FastNewFunctionContext); | 1069 DEFINE_CALL_INTERFACE_DESCRIPTOR(FastNewFunctionContext); |
1075 DEFINE_TURBOFAN_CODE_STUB(FastNewFunctionContext, TurboFanCodeStub); | 1070 DEFINE_TURBOFAN_CODE_STUB(FastNewFunctionContext, TurboFanCodeStub); |
1076 }; | 1071 }; |
1077 | 1072 |
1078 | 1073 |
1079 class FastNewObjectStub final : public PlatformCodeStub { | 1074 class FastNewObjectStub final : public PlatformCodeStub { |
1080 public: | 1075 public: |
1081 explicit FastNewObjectStub(Isolate* isolate) : PlatformCodeStub(isolate) {} | 1076 explicit FastNewObjectStub(Isolate* isolate) : PlatformCodeStub(isolate) {} |
1082 | 1077 |
(...skipping 2028 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3111 #undef DEFINE_HYDROGEN_CODE_STUB | 3106 #undef DEFINE_HYDROGEN_CODE_STUB |
3112 #undef DEFINE_CODE_STUB | 3107 #undef DEFINE_CODE_STUB |
3113 #undef DEFINE_CODE_STUB_BASE | 3108 #undef DEFINE_CODE_STUB_BASE |
3114 | 3109 |
3115 extern Representation RepresentationFromType(Type* type); | 3110 extern Representation RepresentationFromType(Type* type); |
3116 | 3111 |
3117 } // namespace internal | 3112 } // namespace internal |
3118 } // namespace v8 | 3113 } // namespace v8 |
3119 | 3114 |
3120 #endif // V8_CODE_STUBS_H_ | 3115 #endif // V8_CODE_STUBS_H_ |
OLD | NEW |