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

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

Issue 18712002: Convert UnaryOpStub to a HydrogenCodeStub (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: address review Created 7 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/arm/code-stubs-arm.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 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 virtual bool SometimesSetsUpAFrame() { return false; } 73 virtual bool SometimesSetsUpAFrame() { return false; }
74 74
75 private: 75 private:
76 SaveFPRegsMode save_doubles_; 76 SaveFPRegsMode save_doubles_;
77 77
78 Major MajorKey() { return StoreBufferOverflow; } 78 Major MajorKey() { return StoreBufferOverflow; }
79 int MinorKey() { return (save_doubles_ == kSaveFPRegs) ? 1 : 0; } 79 int MinorKey() { return (save_doubles_ == kSaveFPRegs) ? 1 : 0; }
80 }; 80 };
81 81
82 82
83 class UnaryOpStub: public PlatformCodeStub {
84 public:
85 UnaryOpStub(Token::Value op,
86 UnaryOverwriteMode mode,
87 UnaryOpIC::TypeInfo operand_type = UnaryOpIC::UNINITIALIZED)
88 : op_(op),
89 mode_(mode),
90 operand_type_(operand_type) {
91 }
92
93 private:
94 Token::Value op_;
95 UnaryOverwriteMode mode_;
96
97 // Operand type information determined at runtime.
98 UnaryOpIC::TypeInfo operand_type_;
99
100 virtual void PrintName(StringStream* stream);
101
102 class ModeBits: public BitField<UnaryOverwriteMode, 0, 1> {};
103 class OpBits: public BitField<Token::Value, 1, 7> {};
104 class OperandTypeInfoBits: public BitField<UnaryOpIC::TypeInfo, 8, 3> {};
105
106 Major MajorKey() { return UnaryOp; }
107 int MinorKey() {
108 return ModeBits::encode(mode_)
109 | OpBits::encode(op_)
110 | OperandTypeInfoBits::encode(operand_type_);
111 }
112
113 // Note: A lot of the helper functions below will vanish when we use virtual
114 // function instead of switch more often.
115 void Generate(MacroAssembler* masm);
116
117 void GenerateTypeTransition(MacroAssembler* masm);
118
119 void GenerateSmiStub(MacroAssembler* masm);
120 void GenerateSmiStubSub(MacroAssembler* masm);
121 void GenerateSmiStubBitNot(MacroAssembler* masm);
122 void GenerateSmiCodeSub(MacroAssembler* masm, Label* non_smi, Label* slow);
123 void GenerateSmiCodeBitNot(MacroAssembler* masm, Label* slow);
124
125 void GenerateNumberStub(MacroAssembler* masm);
126 void GenerateNumberStubSub(MacroAssembler* masm);
127 void GenerateNumberStubBitNot(MacroAssembler* masm);
128 void GenerateHeapNumberCodeSub(MacroAssembler* masm, Label* slow);
129 void GenerateHeapNumberCodeBitNot(MacroAssembler* masm, Label* slow);
130
131 void GenerateGenericStub(MacroAssembler* masm);
132 void GenerateGenericStubSub(MacroAssembler* masm);
133 void GenerateGenericStubBitNot(MacroAssembler* masm);
134 void GenerateGenericCodeFallback(MacroAssembler* masm);
135
136 virtual Code::Kind GetCodeKind() const { return Code::UNARY_OP_IC; }
137
138 virtual InlineCacheState GetICState() {
139 return UnaryOpIC::ToState(operand_type_);
140 }
141
142 virtual void FinishCode(Handle<Code> code) {
143 code->set_unary_op_type(operand_type_);
144 }
145 };
146
147
148 class StringHelper : public AllStatic { 83 class StringHelper : public AllStatic {
149 public: 84 public:
150 // Generate code for copying characters using a simple loop. This should only 85 // Generate code for copying characters using a simple loop. This should only
151 // be used in places where the number of characters is small and the 86 // be used in places where the number of characters is small and the
152 // additional setup and checking in GenerateCopyCharactersLong adds too much 87 // additional setup and checking in GenerateCopyCharactersLong adds too much
153 // overhead. Copying of overlapping regions is not supported. 88 // overhead. Copying of overlapping regions is not supported.
154 // Dest register ends at the position after the last character written. 89 // Dest register ends at the position after the last character written.
155 static void GenerateCopyCharacters(MacroAssembler* masm, 90 static void GenerateCopyCharacters(MacroAssembler* masm,
156 Register dest, 91 Register dest,
157 Register src, 92 Register src,
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after
641 576
642 class LookupModeBits: public BitField<LookupMode, 0, 1> {}; 577 class LookupModeBits: public BitField<LookupMode, 0, 1> {};
643 578
644 LookupMode mode_; 579 LookupMode mode_;
645 }; 580 };
646 581
647 582
648 } } // namespace v8::internal 583 } } // namespace v8::internal
649 584
650 #endif // V8_ARM_CODE_STUBS_ARM_H_ 585 #endif // V8_ARM_CODE_STUBS_ARM_H_
OLDNEW
« no previous file with comments | « no previous file | src/arm/code-stubs-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698