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

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

Issue 6879081: Added type recording for unary minus and unary bitwise negation. Note that the (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 8 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') | src/arm/code-stubs-arm.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 64
65 void Generate(MacroAssembler* masm); 65 void Generate(MacroAssembler* masm);
66 66
67 private: 67 private:
68 Register tos_; 68 Register tos_;
69 Major MajorKey() { return ToBoolean; } 69 Major MajorKey() { return ToBoolean; }
70 int MinorKey() { return tos_.code(); } 70 int MinorKey() { return tos_.code(); }
71 }; 71 };
72 72
73 73
74 class TypeRecordingUnaryOpStub: public CodeStub {
75 public:
76 TypeRecordingUnaryOpStub(Token::Value op, UnaryOverwriteMode mode)
77 : op_(op),
78 mode_(mode),
79 operand_type_(TRUnaryOpIC::UNINITIALIZED),
80 name_(NULL) {
81 }
82
83 TypeRecordingUnaryOpStub(
84 int key,
85 TRUnaryOpIC::TypeInfo operand_type)
86 : op_(OpBits::decode(key)),
87 mode_(ModeBits::decode(key)),
88 operand_type_(operand_type),
89 name_(NULL) {
90 }
91
92 private:
93 Token::Value op_;
94 UnaryOverwriteMode mode_;
95
96 // Operand type information determined at runtime.
97 TRUnaryOpIC::TypeInfo operand_type_;
98
99 char* name_;
100
101 const char* GetName();
102
103 #ifdef DEBUG
104 void Print() {
105 PrintF("TypeRecordingUnaryOpStub %d (op %s), "
106 "(mode %d, runtime_type_info %s)\n",
107 MinorKey(),
108 Token::String(op_),
109 static_cast<int>(mode_),
110 TRUnaryOpIC::GetName(operand_type_));
111 }
112 #endif
113
114 class ModeBits: public BitField<UnaryOverwriteMode, 0, 1> {};
115 class OpBits: public BitField<Token::Value, 1, 7> {};
116 class OperandTypeInfoBits: public BitField<TRUnaryOpIC::TypeInfo, 8, 3> {};
117
118 Major MajorKey() { return TypeRecordingUnaryOp; }
119 int MinorKey() {
120 return ModeBits::encode(mode_)
121 | OpBits::encode(op_)
122 | OperandTypeInfoBits::encode(operand_type_);
123 }
124
125 // Note: A lot of the helper functions below will vanish when we use virtual
126 // function instead of switch more often.
127 void Generate(MacroAssembler* masm);
128
129 void GenerateTypeTransition(MacroAssembler* masm);
130
131 void GenerateSmiStub(MacroAssembler* masm);
132 void GenerateSmiStubSub(MacroAssembler* masm);
133 void GenerateSmiStubBitNot(MacroAssembler* masm);
134 void GenerateSmiCodeSub(MacroAssembler* masm, Label* non_smi, Label* slow);
135 void GenerateSmiCodeBitNot(MacroAssembler* masm, Label* slow);
136
137 void GenerateHeapNumberStub(MacroAssembler* masm);
138 void GenerateHeapNumberStubSub(MacroAssembler* masm);
139 void GenerateHeapNumberStubBitNot(MacroAssembler* masm);
140 void GenerateHeapNumberCodeSub(MacroAssembler* masm, Label* slow);
141 void GenerateHeapNumberCodeBitNot(MacroAssembler* masm, Label* slow);
142
143 void GenerateGenericStub(MacroAssembler* masm);
144 void GenerateGenericStubSub(MacroAssembler* masm);
145 void GenerateGenericStubBitNot(MacroAssembler* masm);
146 void GenerateGenericCodeFallback(MacroAssembler* masm);
147
148 virtual int GetCodeKind() { return Code::TYPE_RECORDING_UNARY_OP_IC; }
149
150 virtual InlineCacheState GetICState() {
151 return TRUnaryOpIC::ToState(operand_type_);
152 }
153
154 virtual void FinishCode(Code* code) {
155 code->set_type_recording_unary_op_type(operand_type_);
156 }
157 };
158
159
74 class TypeRecordingBinaryOpStub: public CodeStub { 160 class TypeRecordingBinaryOpStub: public CodeStub {
75 public: 161 public:
76 TypeRecordingBinaryOpStub(Token::Value op, OverwriteMode mode) 162 TypeRecordingBinaryOpStub(Token::Value op, OverwriteMode mode)
77 : op_(op), 163 : op_(op),
78 mode_(mode), 164 mode_(mode),
79 operands_type_(TRBinaryOpIC::UNINITIALIZED), 165 operands_type_(TRBinaryOpIC::UNINITIALIZED),
80 result_type_(TRBinaryOpIC::UNINITIALIZED), 166 result_type_(TRBinaryOpIC::UNINITIALIZED),
81 name_(NULL) { 167 name_(NULL) {
82 use_vfp3_ = CpuFeatures::IsSupported(VFP3); 168 use_vfp3_ = CpuFeatures::IsSupported(VFP3);
83 ASSERT(OpBits::is_valid(Token::NUM_TOKENS)); 169 ASSERT(OpBits::is_valid(Token::NUM_TOKENS));
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 450
365 bool NeedsImmovableCode() { return true; } 451 bool NeedsImmovableCode() { return true; }
366 452
367 const char* GetName() { return "DirectCEntryStub"; } 453 const char* GetName() { return "DirectCEntryStub"; }
368 }; 454 };
369 455
370 456
371 } } // namespace v8::internal 457 } } // namespace v8::internal
372 458
373 #endif // V8_ARM_CODE_STUBS_ARM_H_ 459 #endif // V8_ARM_CODE_STUBS_ARM_H_
OLDNEW
« no previous file with comments | « no previous file | src/arm/code-stubs-arm.cc » ('j') | src/arm/code-stubs-arm.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698