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

Unified Diff: src/codegen-ia32.cc

Issue 4084: Remove ComparisonDeferred and inline the non-smi case. (Closed)
Patch Set: Typos Created 12 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codegen-ia32.cc
diff --git a/src/codegen-ia32.cc b/src/codegen-ia32.cc
index 1c6fc5b2c696007bd7426d562871a9cd896d1b28..f79be825e3dab2d64a334e3937c1baa448ca49cc 100644
--- a/src/codegen-ia32.cc
+++ b/src/codegen-ia32.cc
@@ -2484,29 +2484,6 @@ void StackCheckStub::Generate(MacroAssembler* masm) {
#define __ masm_->
-class ComparisonDeferred: public DeferredCode {
- public:
- ComparisonDeferred(CodeGenerator* generator, Condition cc, bool strict) :
- DeferredCode(generator), cc_(cc), strict_(strict) {
- set_comment("[ ComparisonDeferred");
- }
- virtual void Generate();
-
- private:
- Condition cc_;
- bool strict_;
-};
-
-
-void ComparisonDeferred::Generate() {
- CompareStub stub(cc_, strict_);
- // "parameters" setup by calling code in edx and eax
- __ CallStub(&stub);
- __ cmp(eax, 0);
- // "result" is returned in the flags
-}
-
-
void Ia32CodeGenerator::Comparison(Condition cc, bool strict) {
// Strict only makes sense for equality comparisons.
ASSERT(!strict || cc == equal);
@@ -2520,14 +2497,28 @@ void Ia32CodeGenerator::Comparison(Condition cc, bool strict) {
__ pop(eax);
__ pop(edx);
}
- ComparisonDeferred* deferred = new ComparisonDeferred(this, cc, strict);
+
+ Label is_smi, done;
+ CompareStub stub(cc, strict);
+
__ mov(ecx, Operand(eax));
__ or_(ecx, Operand(edx));
__ test(ecx, Immediate(kSmiTagMask));
- __ j(not_zero, deferred->enter(), not_taken);
+ __ j(zero, &is_smi, taken);
+
+ // When non-smi, call out to the compare stub
+ // "parameters" setup by calling code in edx and eax
+ // "result" is returned in the flags
+ __ CallStub(&stub);
+ __ cmp(eax, 0);
+ __ jmp(&done);
+
// Test smi equality by pointer comparison.
+ __ bind(&is_smi);
__ cmp(edx, Operand(eax));
- __ bind(deferred->exit());
+ // Fall through to |done|.
+
+ __ bind(&done);
cc_reg_ = cc;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698