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

Unified Diff: src/ia32/code-stubs-ia32.cc

Issue 6744006: Add binary-op stub variant to handle oddball objects more efficiently. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ia32/code-stubs-ia32.h ('k') | src/ic.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ia32/code-stubs-ia32.cc
===================================================================
--- src/ia32/code-stubs-ia32.cc (revision 7395)
+++ src/ia32/code-stubs-ia32.cc (working copy)
@@ -1359,6 +1359,9 @@
case TRBinaryOpIC::HEAP_NUMBER:
GenerateHeapNumberStub(masm);
break;
+ case TRBinaryOpIC::ODDBALL:
+ GenerateOddballStub(masm);
+ break;
case TRBinaryOpIC::STRING:
GenerateStringStub(masm);
break;
@@ -2024,9 +2027,41 @@
}
+void TypeRecordingBinaryOpStub::GenerateOddballStub(MacroAssembler* masm) {
+ Label call_runtime;
+
+ if (op_ == Token::ADD) {
+ // Handle string addition here, because it is the only operation
+ // that does not do a ToNumber conversion on the operands.
+ GenerateAddStrings(masm);
+ }
+
+ // Convert odd ball arguments to numbers.
+ NearLabel check, done;
+ __ cmp(edx, FACTORY->undefined_value());
+ __ j(not_equal, &check);
+ if (Token::IsBitOp(op_)) {
+ __ xor_(edx, Operand(edx));
+ } else {
+ __ mov(edx, Immediate(FACTORY->nan_value()));
+ }
+ __ jmp(&done);
+ __ bind(&check);
+ __ cmp(eax, FACTORY->undefined_value());
+ __ j(not_equal, &done);
+ if (Token::IsBitOp(op_)) {
+ __ xor_(eax, Operand(eax));
+ } else {
+ __ mov(eax, Immediate(FACTORY->nan_value()));
+ }
+ __ bind(&done);
+
+ GenerateHeapNumberStub(masm);
+}
+
+
void TypeRecordingBinaryOpStub::GenerateHeapNumberStub(MacroAssembler* masm) {
Label call_runtime;
- ASSERT(operands_type_ == TRBinaryOpIC::HEAP_NUMBER);
// Floating point case.
switch (op_) {
« no previous file with comments | « src/ia32/code-stubs-ia32.h ('k') | src/ic.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698