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

Side by Side Diff: src/arm/lithium-arm.h

Issue 9638018: [v8-dev] Optimise Math.floor(x/y) to use integer division for specific divisor.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 years, 9 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/lithium-arm.cc » ('j') | src/arm/lithium-codegen-arm.cc » ('J')
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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 V(LoadFunctionPrototype) \ 125 V(LoadFunctionPrototype) \
126 V(LoadGlobalCell) \ 126 V(LoadGlobalCell) \
127 V(LoadGlobalGeneric) \ 127 V(LoadGlobalGeneric) \
128 V(LoadKeyedFastDoubleElement) \ 128 V(LoadKeyedFastDoubleElement) \
129 V(LoadKeyedFastElement) \ 129 V(LoadKeyedFastElement) \
130 V(LoadKeyedGeneric) \ 130 V(LoadKeyedGeneric) \
131 V(LoadKeyedSpecializedArrayElement) \ 131 V(LoadKeyedSpecializedArrayElement) \
132 V(LoadNamedField) \ 132 V(LoadNamedField) \
133 V(LoadNamedFieldPolymorphic) \ 133 V(LoadNamedFieldPolymorphic) \
134 V(LoadNamedGeneric) \ 134 V(LoadNamedGeneric) \
135 V(MathFloorOfDiv) \
135 V(ModI) \ 136 V(ModI) \
136 V(MulI) \ 137 V(MulI) \
137 V(NumberTagD) \ 138 V(NumberTagD) \
138 V(NumberTagI) \ 139 V(NumberTagI) \
139 V(NumberUntagD) \ 140 V(NumberUntagD) \
140 V(ObjectLiteral) \ 141 V(ObjectLiteral) \
141 V(OsrEntry) \ 142 V(OsrEntry) \
142 V(OuterContext) \ 143 V(OuterContext) \
143 V(Parameter) \ 144 V(Parameter) \
144 V(Power) \ 145 V(Power) \
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
560 LDivI(LOperand* left, LOperand* right) { 561 LDivI(LOperand* left, LOperand* right) {
561 inputs_[0] = left; 562 inputs_[0] = left;
562 inputs_[1] = right; 563 inputs_[1] = right;
563 } 564 }
564 565
565 DECLARE_CONCRETE_INSTRUCTION(DivI, "div-i") 566 DECLARE_CONCRETE_INSTRUCTION(DivI, "div-i")
566 DECLARE_HYDROGEN_ACCESSOR(Div) 567 DECLARE_HYDROGEN_ACCESSOR(Div)
567 }; 568 };
568 569
569 570
571 class LMathFloorOfDiv: public LTemplateInstruction<1, 2, 1> {
572 public:
573 LMathFloorOfDiv(LOperand* left,
574 LOperand* right,
575 LOperand* temp = NULL) {
576 inputs_[0] = left;
577 inputs_[1] = right;
578 temps_[0] = temp;
579 }
580
581 DECLARE_CONCRETE_INSTRUCTION(MathFloorOfDiv, "math-floor-of-div")
582 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv)
583 };
584
585
570 class LMulI: public LTemplateInstruction<1, 2, 1> { 586 class LMulI: public LTemplateInstruction<1, 2, 1> {
571 public: 587 public:
572 LMulI(LOperand* left, LOperand* right, LOperand* temp) { 588 LMulI(LOperand* left, LOperand* right, LOperand* temp) {
573 inputs_[0] = left; 589 inputs_[0] = left;
574 inputs_[1] = right; 590 inputs_[1] = right;
575 temps_[0] = temp; 591 temps_[0] = temp;
576 } 592 }
577 593
578 DECLARE_CONCRETE_INSTRUCTION(MulI, "mul-i") 594 DECLARE_CONCRETE_INSTRUCTION(MulI, "mul-i")
579 DECLARE_HYDROGEN_ACCESSOR(Mul) 595 DECLARE_HYDROGEN_ACCESSOR(Mul)
(...skipping 1637 matching lines...) Expand 10 before | Expand all | Expand 10 after
2217 pending_deoptimization_ast_id_(AstNode::kNoNumber) { } 2233 pending_deoptimization_ast_id_(AstNode::kNoNumber) { }
2218 2234
2219 // Build the sequence for the graph. 2235 // Build the sequence for the graph.
2220 LChunk* Build(); 2236 LChunk* Build();
2221 2237
2222 // Declare methods that deal with the individual node types. 2238 // Declare methods that deal with the individual node types.
2223 #define DECLARE_DO(type) LInstruction* Do##type(H##type* node); 2239 #define DECLARE_DO(type) LInstruction* Do##type(H##type* node);
2224 HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO) 2240 HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO)
2225 #undef DECLARE_DO 2241 #undef DECLARE_DO
2226 2242
2243 static bool SupportsMathFloorOfDiv() { return true; }
2244 static bool HasMagicNumberForDivisor(int32_t divisor);
2245 static HValue* SimplifiedDividendForMathFloorOfDiv(HValue* val);
2246 static HValue* SimplifiedDivisorForMathFloorOfDiv(HValue* val);
2247
2227 private: 2248 private:
2228 enum Status { 2249 enum Status {
2229 UNUSED, 2250 UNUSED,
2230 BUILDING, 2251 BUILDING,
2231 DONE, 2252 DONE,
2232 ABORTED 2253 ABORTED
2233 }; 2254 };
2234 2255
2235 LChunk* chunk() const { return chunk_; } 2256 LChunk* chunk() const { return chunk_; }
2236 CompilationInfo* info() const { return info_; } 2257 CompilationInfo* info() const { return info_; }
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
2353 2374
2354 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); 2375 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder);
2355 }; 2376 };
2356 2377
2357 #undef DECLARE_HYDROGEN_ACCESSOR 2378 #undef DECLARE_HYDROGEN_ACCESSOR
2358 #undef DECLARE_CONCRETE_INSTRUCTION 2379 #undef DECLARE_CONCRETE_INSTRUCTION
2359 2380
2360 } } // namespace v8::internal 2381 } } // namespace v8::internal
2361 2382
2362 #endif // V8_ARM_LITHIUM_ARM_H_ 2383 #endif // V8_ARM_LITHIUM_ARM_H_
OLDNEW
« no previous file with comments | « no previous file | src/arm/lithium-arm.cc » ('j') | src/arm/lithium-codegen-arm.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698