Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Side by Side Diff: src/code-stubs.h

Issue 2250513005: [interpreter] Record type feedback in the handlers for Inc and Dec. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Added tests. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/code-stubs.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
455 public: \ 455 public: \
456 static compiler::Node* Generate(CodeStubAssembler* assembler, \ 456 static compiler::Node* Generate(CodeStubAssembler* assembler, \
457 compiler::Node* value, \ 457 compiler::Node* value, \
458 compiler::Node* context); \ 458 compiler::Node* context); \
459 void GenerateAssembly(CodeStubAssembler* assembler) const override { \ 459 void GenerateAssembly(CodeStubAssembler* assembler) const override { \
460 assembler->Return(Generate(assembler, assembler->Parameter(0), \ 460 assembler->Return(Generate(assembler, assembler->Parameter(0), \
461 assembler->Parameter(1))); \ 461 assembler->Parameter(1))); \
462 } \ 462 } \
463 DEFINE_CODE_STUB(NAME, SUPER) 463 DEFINE_CODE_STUB(NAME, SUPER)
464 464
465 #define DEFINE_TURBOFAN_UNARY_OP_CODE_STUB_WITH_FEEDBACK(NAME, SUPER) \
466 public: \
467 static compiler::Node* Generate( \
468 CodeStubAssembler* assembler, compiler::Node* value, \
469 compiler::Node* context, compiler::Node* type_feedback_vector, \
470 compiler::Node* slot_id); \
471 void GenerateAssembly(CodeStubAssembler* assembler) const override { \
472 assembler->Return( \
473 Generate(assembler, assembler->Parameter(0), assembler->Parameter(1), \
474 assembler->Parameter(2), assembler->Parameter(3))); \
475 } \
476 DEFINE_CODE_STUB(NAME, SUPER)
477
465 #define DEFINE_HANDLER_CODE_STUB(NAME, SUPER) \ 478 #define DEFINE_HANDLER_CODE_STUB(NAME, SUPER) \
466 public: \ 479 public: \
467 Handle<Code> GenerateCode() override; \ 480 Handle<Code> GenerateCode() override; \
468 DEFINE_CODE_STUB(NAME, SUPER) 481 DEFINE_CODE_STUB(NAME, SUPER)
469 482
470 #define DEFINE_CALL_INTERFACE_DESCRIPTOR(NAME) \ 483 #define DEFINE_CALL_INTERFACE_DESCRIPTOR(NAME) \
471 public: \ 484 public: \
472 typedef NAME##Descriptor Descriptor; \ 485 typedef NAME##Descriptor Descriptor; \
473 CallInterfaceDescriptor GetCallInterfaceDescriptor() const override { \ 486 CallInterfaceDescriptor GetCallInterfaceDescriptor() const override { \
474 return Descriptor(isolate()); \ 487 return Descriptor(isolate()); \
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
888 901
889 DEFINE_CALL_INTERFACE_DESCRIPTOR(BinaryOp); 902 DEFINE_CALL_INTERFACE_DESCRIPTOR(BinaryOp);
890 DEFINE_TURBOFAN_BINARY_OP_CODE_STUB(BitwiseXor, TurboFanCodeStub); 903 DEFINE_TURBOFAN_BINARY_OP_CODE_STUB(BitwiseXor, TurboFanCodeStub);
891 }; 904 };
892 905
893 class IncStub final : public TurboFanCodeStub { 906 class IncStub final : public TurboFanCodeStub {
894 public: 907 public:
895 explicit IncStub(Isolate* isolate) : TurboFanCodeStub(isolate) {} 908 explicit IncStub(Isolate* isolate) : TurboFanCodeStub(isolate) {}
896 909
897 DEFINE_CALL_INTERFACE_DESCRIPTOR(CountOp); 910 DEFINE_CALL_INTERFACE_DESCRIPTOR(CountOp);
898 DEFINE_TURBOFAN_UNARY_OP_CODE_STUB(Inc, TurboFanCodeStub); 911 DEFINE_TURBOFAN_UNARY_OP_CODE_STUB_WITH_FEEDBACK(Inc, TurboFanCodeStub);
899 }; 912 };
900 913
901 class DecStub final : public TurboFanCodeStub { 914 class DecStub final : public TurboFanCodeStub {
902 public: 915 public:
903 explicit DecStub(Isolate* isolate) : TurboFanCodeStub(isolate) {} 916 explicit DecStub(Isolate* isolate) : TurboFanCodeStub(isolate) {}
904 917
905 DEFINE_CALL_INTERFACE_DESCRIPTOR(CountOp); 918 DEFINE_CALL_INTERFACE_DESCRIPTOR(CountOp);
906 DEFINE_TURBOFAN_UNARY_OP_CODE_STUB(Dec, TurboFanCodeStub); 919 DEFINE_TURBOFAN_UNARY_OP_CODE_STUB_WITH_FEEDBACK(Dec, TurboFanCodeStub);
907 }; 920 };
908 921
909 class InstanceOfStub final : public TurboFanCodeStub { 922 class InstanceOfStub final : public TurboFanCodeStub {
910 public: 923 public:
911 explicit InstanceOfStub(Isolate* isolate) : TurboFanCodeStub(isolate) {} 924 explicit InstanceOfStub(Isolate* isolate) : TurboFanCodeStub(isolate) {}
912 925
913 private: 926 private:
914 DEFINE_CALL_INTERFACE_DESCRIPTOR(Compare); 927 DEFINE_CALL_INTERFACE_DESCRIPTOR(Compare);
915 DEFINE_TURBOFAN_BINARY_OP_CODE_STUB(InstanceOf, TurboFanCodeStub); 928 DEFINE_TURBOFAN_BINARY_OP_CODE_STUB(InstanceOf, TurboFanCodeStub);
916 }; 929 };
(...skipping 2293 matching lines...) Expand 10 before | Expand all | Expand 10 after
3210 #undef DEFINE_HYDROGEN_CODE_STUB 3223 #undef DEFINE_HYDROGEN_CODE_STUB
3211 #undef DEFINE_CODE_STUB 3224 #undef DEFINE_CODE_STUB
3212 #undef DEFINE_CODE_STUB_BASE 3225 #undef DEFINE_CODE_STUB_BASE
3213 3226
3214 extern Representation RepresentationFromType(Type* type); 3227 extern Representation RepresentationFromType(Type* type);
3215 3228
3216 } // namespace internal 3229 } // namespace internal
3217 } // namespace v8 3230 } // namespace v8
3218 3231
3219 #endif // V8_CODE_STUBS_H_ 3232 #endif // V8_CODE_STUBS_H_
OLDNEW
« no previous file with comments | « no previous file | src/code-stubs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698