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

Unified Diff: src/ia32/macro-assembler-ia32.cc

Issue 3054047: IA32: Avoid going into stubs or runtime code for bitops even if the... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years, 4 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
« src/ia32/macro-assembler-ia32.h ('K') | « src/ia32/macro-assembler-ia32.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ia32/macro-assembler-ia32.cc
===================================================================
--- src/ia32/macro-assembler-ia32.cc (revision 5165)
+++ src/ia32/macro-assembler-ia32.cc (working copy)
@@ -377,6 +377,12 @@
}
+void MacroAssembler::AbortIfSmi(Register object) {
+ test(object, Immediate(kSmiTagMask));
+ Assert(not_equal, "Operand a smi");
+}
+
+
void MacroAssembler::EnterFrame(StackFrame::Type type) {
push(ebp);
mov(ebp, Operand(esp));
@@ -1497,6 +1503,45 @@
}
+void MacroAssembler::JumpIfNotNumber(Register reg,
+ TypeInfo info,
+ Label* on_not_number) {
+ if (FLAG_debug_code) AbortIfSmi(reg);
+ if (!info.IsNumber()) {
+ cmp(FieldOperand(reg, HeapObject::kMapOffset),
+ Factory::heap_number_map());
+ j(not_equal, on_not_number);
+ }
+}
+
+
+void MacroAssembler::JumpIfNotInt32(Register reg,
+ Register scratch,
+ TypeInfo info,
+ Label* on_not_int32) {
+ if (FLAG_debug_code) {
+ AbortIfSmi(reg);
+ AbortIfNotNumber(reg);
+ }
+ const uint32_t non_smi_exponent =
+ (HeapNumber::kExponentBias + 30) << HeapNumber::kExponentShift;
+ if (!info.IsInteger32()) {
+ bool push_pop = scratch.is(no_reg);
+ if (push_pop) {
+ push(reg);
+ scratch = reg;
+ }
+ mov(scratch, FieldOperand(reg, HeapNumber::kExponentOffset));
+ and_(scratch, HeapNumber::kExponentMask);
+ cmp(scratch, non_smi_exponent);
+ if (push_pop) {
+ pop(reg);
+ }
+ j(greater, on_not_int32);
Lasse Reichstein 2010/08/06 08:20:12 Is this faster than using SSE2 cvttsd2si and check
Erik Corry 2010/08/09 13:13:49 Done.
+ }
+}
+
+
void MacroAssembler::JumpIfInstanceTypeIsNotSequentialAscii(
Register instance_type,
Register scratch,
« src/ia32/macro-assembler-ia32.h ('K') | « src/ia32/macro-assembler-ia32.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698