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

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

Issue 10382033: x86/x64 port of 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, 6 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 | « src/x64/lithium-codegen-x64.cc ('k') | src/x64/lithium-x64.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 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 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 inputs_[0] = left; 548 inputs_[0] = left;
548 inputs_[1] = right; 549 inputs_[1] = right;
549 temps_[0] = temp; 550 temps_[0] = temp;
550 } 551 }
551 552
552 DECLARE_CONCRETE_INSTRUCTION(DivI, "div-i") 553 DECLARE_CONCRETE_INSTRUCTION(DivI, "div-i")
553 DECLARE_HYDROGEN_ACCESSOR(Div) 554 DECLARE_HYDROGEN_ACCESSOR(Div)
554 }; 555 };
555 556
556 557
558 class LMathFloorOfDiv: public LTemplateInstruction<1, 2, 1> {
559 public:
560 LMathFloorOfDiv(LOperand* left,
561 LOperand* right,
562 LOperand* temp = NULL) {
563 inputs_[0] = left;
564 inputs_[1] = right;
565 temps_[0] = temp;
566 }
567
568 DECLARE_CONCRETE_INSTRUCTION(MathFloorOfDiv, "math-floor-of-div")
569 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv)
570 };
571
572
557 class LMulI: public LTemplateInstruction<1, 2, 0> { 573 class LMulI: public LTemplateInstruction<1, 2, 0> {
558 public: 574 public:
559 LMulI(LOperand* left, LOperand* right) { 575 LMulI(LOperand* left, LOperand* right) {
560 inputs_[0] = left; 576 inputs_[0] = left;
561 inputs_[1] = right; 577 inputs_[1] = right;
562 } 578 }
563 579
564 DECLARE_CONCRETE_INSTRUCTION(MulI, "mul-i") 580 DECLARE_CONCRETE_INSTRUCTION(MulI, "mul-i")
565 DECLARE_HYDROGEN_ACCESSOR(Mul) 581 DECLARE_HYDROGEN_ACCESSOR(Mul)
566 }; 582 };
(...skipping 1681 matching lines...) Expand 10 before | Expand all | Expand 10 after
2248 pending_deoptimization_ast_id_(AstNode::kNoNumber) { } 2264 pending_deoptimization_ast_id_(AstNode::kNoNumber) { }
2249 2265
2250 // Build the sequence for the graph. 2266 // Build the sequence for the graph.
2251 LChunk* Build(); 2267 LChunk* Build();
2252 2268
2253 // Declare methods that deal with the individual node types. 2269 // Declare methods that deal with the individual node types.
2254 #define DECLARE_DO(type) LInstruction* Do##type(H##type* node); 2270 #define DECLARE_DO(type) LInstruction* Do##type(H##type* node);
2255 HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO) 2271 HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO)
2256 #undef DECLARE_DO 2272 #undef DECLARE_DO
2257 2273
2274 static HValue* SimplifiedDividendForMathFloorOfDiv(HValue* val);
2275 static HValue* SimplifiedDivisorForMathFloorOfDiv(HValue* val);
2276
2258 private: 2277 private:
2259 enum Status { 2278 enum Status {
2260 UNUSED, 2279 UNUSED,
2261 BUILDING, 2280 BUILDING,
2262 DONE, 2281 DONE,
2263 ABORTED 2282 ABORTED
2264 }; 2283 };
2265 2284
2266 LChunk* chunk() const { return chunk_; } 2285 LChunk* chunk() const { return chunk_; }
2267 CompilationInfo* info() const { return info_; } 2286 CompilationInfo* info() const { return info_; }
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
2383 2402
2384 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); 2403 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder);
2385 }; 2404 };
2386 2405
2387 #undef DECLARE_HYDROGEN_ACCESSOR 2406 #undef DECLARE_HYDROGEN_ACCESSOR
2388 #undef DECLARE_CONCRETE_INSTRUCTION 2407 #undef DECLARE_CONCRETE_INSTRUCTION
2389 2408
2390 } } // namespace v8::int 2409 } } // namespace v8::int
2391 2410
2392 #endif // V8_X64_LITHIUM_X64_H_ 2411 #endif // V8_X64_LITHIUM_X64_H_
OLDNEW
« no previous file with comments | « src/x64/lithium-codegen-x64.cc ('k') | src/x64/lithium-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698