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

Unified Diff: bleeding_edge/src/ia32/builtins-ia32.cc

Issue 501113: Refactor smi tagging and untagging on IA-32. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years 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 | bleeding_edge/src/ia32/codegen-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bleeding_edge/src/ia32/builtins-ia32.cc
===================================================================
--- bleeding_edge/src/ia32/builtins-ia32.cc (revision 3492)
+++ bleeding_edge/src/ia32/builtins-ia32.cc (working copy)
@@ -86,7 +86,7 @@
__ EnterConstructFrame();
// Store a smi-tagged arguments count on the stack.
- __ shl(eax, kSmiTagSize);
+ __ SmiTag(eax);
__ push(eax);
// Push the function to invoke on the stack.
@@ -255,7 +255,7 @@
// Retrieve smi-tagged arguments count from the stack.
__ mov(eax, Operand(esp, 0));
- __ shr(eax, kSmiTagSize);
+ __ SmiUntag(eax);
// Push the allocated receiver to the stack. We need two copies
// because we may have to return the original one and the calling
@@ -440,8 +440,7 @@
__ EnterInternalFrame(); // preserves eax, ebx, edi
// Store the arguments count on the stack (smi tagged).
- ASSERT(kSmiTag == 0);
- __ shl(eax, kSmiTagSize);
+ __ SmiTag(eax);
__ push(eax);
__ push(edi); // save edi across the call
@@ -452,7 +451,7 @@
// Get the arguments count and untag it.
__ pop(eax);
- __ shr(eax, kSmiTagSize);
+ __ SmiUntag(eax);
__ LeaveInternalFrame();
__ jmp(&patch_receiver);
@@ -634,7 +633,7 @@
// Invoke the function.
ParameterCount actual(eax);
- __ shr(eax, kSmiTagSize);
+ __ SmiUntag(eax);
__ mov(edi, Operand(ebp, 4 * kPointerSize));
__ InvokeFunction(edi, actual, CALL_FUNCTION);
@@ -831,7 +830,7 @@
// elements_array_end: start of next object
// array_size: size of array (smi)
ASSERT(kSmiTag == 0);
- __ shr(array_size, kSmiTagSize); // Convert from smi to value.
+ __ SmiUntag(array_size); // Convert from smi to value.
__ mov(FieldOperand(elements_array, JSObject::kMapOffset),
Factory::fixed_array_map());
Label not_empty_2, fill_array;
@@ -960,7 +959,7 @@
// Handle construction of an array from a list of arguments.
__ bind(&argc_two_or_more);
ASSERT(kSmiTag == 0);
- __ shl(eax, kSmiTagSize); // Convet argc to a smi.
+ __ SmiTag(eax); // Convet argc to a smi.
// eax: array_size (smi)
// edi: constructor
// esp[0] : argc
« no previous file with comments | « no previous file | bleeding_edge/src/ia32/codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698