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 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
419 public: \ | 419 public: \ |
420 void InitializeDescriptor(CodeStubDescriptor* descriptor) override; \ | 420 void InitializeDescriptor(CodeStubDescriptor* descriptor) override; \ |
421 Handle<Code> GenerateCode() override; \ | 421 Handle<Code> GenerateCode() override; \ |
422 DEFINE_CODE_STUB(NAME, SUPER) | 422 DEFINE_CODE_STUB(NAME, SUPER) |
423 | 423 |
424 #define DEFINE_TURBOFAN_CODE_STUB(NAME, SUPER) \ | 424 #define DEFINE_TURBOFAN_CODE_STUB(NAME, SUPER) \ |
425 public: \ | 425 public: \ |
426 void GenerateAssembly(CodeStubAssembler* assembler) const override; \ | 426 void GenerateAssembly(CodeStubAssembler* assembler) const override; \ |
427 DEFINE_CODE_STUB(NAME, SUPER) | 427 DEFINE_CODE_STUB(NAME, SUPER) |
428 | 428 |
429 #define DEFINE_TURBOFAN_TERNARY_OP_CODE_STUB(NAME, SUPER) \ | |
430 public: \ | |
431 static compiler::Node* Generate( \ | |
432 CodeStubAssembler* assembler, compiler::Node* first, \ | |
433 compiler::Node* second, compiler::Node* third, compiler::Node* context); \ | |
434 void GenerateAssembly(CodeStubAssembler* assembler) const override { \ | |
435 assembler->Return( \ | |
436 Generate(assembler, assembler->Parameter(0), assembler->Parameter(1), \ | |
437 assembler->Parameter(2), assembler->Parameter(3))); \ | |
438 } \ | |
439 DEFINE_CODE_STUB(NAME, SUPER) | |
440 | |
429 #define DEFINE_TURBOFAN_BINARY_OP_CODE_STUB(NAME, SUPER) \ | 441 #define DEFINE_TURBOFAN_BINARY_OP_CODE_STUB(NAME, SUPER) \ |
430 public: \ | 442 public: \ |
431 static compiler::Node* Generate(CodeStubAssembler* assembler, \ | 443 static compiler::Node* Generate(CodeStubAssembler* assembler, \ |
432 compiler::Node* left, compiler::Node* right, \ | 444 compiler::Node* left, compiler::Node* right, \ |
433 compiler::Node* context); \ | 445 compiler::Node* context); \ |
434 void GenerateAssembly(CodeStubAssembler* assembler) const override { \ | 446 void GenerateAssembly(CodeStubAssembler* assembler) const override { \ |
435 assembler->Return(Generate(assembler, assembler->Parameter(0), \ | 447 assembler->Return(Generate(assembler, assembler->Parameter(0), \ |
436 assembler->Parameter(1), \ | 448 assembler->Parameter(1), \ |
437 assembler->Parameter(2))); \ | 449 assembler->Parameter(2))); \ |
438 } \ | 450 } \ |
(...skipping 2675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3114 | 3126 |
3115 private: | 3127 private: |
3116 bool save_doubles() const { return SaveDoublesBits::decode(minor_key_); } | 3128 bool save_doubles() const { return SaveDoublesBits::decode(minor_key_); } |
3117 | 3129 |
3118 class SaveDoublesBits : public BitField<bool, 0, 1> {}; | 3130 class SaveDoublesBits : public BitField<bool, 0, 1> {}; |
3119 | 3131 |
3120 DEFINE_NULL_CALL_INTERFACE_DESCRIPTOR(); | 3132 DEFINE_NULL_CALL_INTERFACE_DESCRIPTOR(); |
3121 DEFINE_PLATFORM_CODE_STUB(StoreBufferOverflow, PlatformCodeStub); | 3133 DEFINE_PLATFORM_CODE_STUB(StoreBufferOverflow, PlatformCodeStub); |
3122 }; | 3134 }; |
3123 | 3135 |
3124 | 3136 class SubStringStub : public TurboFanCodeStub { |
3125 class SubStringStub : public PlatformCodeStub { | |
3126 public: | 3137 public: |
3127 explicit SubStringStub(Isolate* isolate) : PlatformCodeStub(isolate) {} | 3138 explicit SubStringStub(Isolate* isolate) : TurboFanCodeStub(isolate) {} |
3128 | 3139 |
3129 DEFINE_ON_STACK_CALL_INTERFACE_DESCRIPTOR(3); | 3140 DEFINE_ON_STACK_CALL_INTERFACE_DESCRIPTOR(3); |
3130 DEFINE_PLATFORM_CODE_STUB(SubString, PlatformCodeStub); | 3141 DEFINE_TURBOFAN_TERNARY_OP_CODE_STUB(SubString, TurboFanCodeStub); |
Igor Sheludko
2016/09/22 12:23:37
I don't think it's a ternary operation. It's just
jgruber
2016/09/22 13:22:41
Done.
| |
3131 }; | 3142 }; |
3132 | 3143 |
3133 class ToStringStub final : public PlatformCodeStub { | 3144 class ToStringStub final : public PlatformCodeStub { |
3134 public: | 3145 public: |
3135 explicit ToStringStub(Isolate* isolate) : PlatformCodeStub(isolate) {} | 3146 explicit ToStringStub(Isolate* isolate) : PlatformCodeStub(isolate) {} |
3136 | 3147 |
3137 DEFINE_CALL_INTERFACE_DESCRIPTOR(TypeConversion); | 3148 DEFINE_CALL_INTERFACE_DESCRIPTOR(TypeConversion); |
3138 DEFINE_PLATFORM_CODE_STUB(ToString, PlatformCodeStub); | 3149 DEFINE_PLATFORM_CODE_STUB(ToString, PlatformCodeStub); |
3139 }; | 3150 }; |
3140 | 3151 |
(...skipping 11 matching lines...) Expand all Loading... | |
3152 #undef DEFINE_HYDROGEN_CODE_STUB | 3163 #undef DEFINE_HYDROGEN_CODE_STUB |
3153 #undef DEFINE_CODE_STUB | 3164 #undef DEFINE_CODE_STUB |
3154 #undef DEFINE_CODE_STUB_BASE | 3165 #undef DEFINE_CODE_STUB_BASE |
3155 | 3166 |
3156 extern Representation RepresentationFromMachineType(MachineType type); | 3167 extern Representation RepresentationFromMachineType(MachineType type); |
3157 | 3168 |
3158 } // namespace internal | 3169 } // namespace internal |
3159 } // namespace v8 | 3170 } // namespace v8 |
3160 | 3171 |
3161 #endif // V8_CODE_STUBS_H_ | 3172 #endif // V8_CODE_STUBS_H_ |
OLD | NEW |