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

Unified Diff: runtime/vm/stub_code_x64.cc

Issue 18130004: Split IdenticalWithNumberCheck in two versions: once called from unoptimized code the other called… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/stub_code_mips.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/stub_code_x64.cc
===================================================================
--- runtime/vm/stub_code_x64.cc (revision 24547)
+++ runtime/vm/stub_code_x64.cc (working copy)
@@ -2038,19 +2038,11 @@
// Return ZF set.
// Note: A Mint cannot contain a value that would fit in Smi, a Bigint
// cannot contain a value that fits in Mint or Smi.
-void StubCode::GenerateIdenticalWithNumberCheckStub(Assembler* assembler) {
- const Register left = RAX;
- const Register right = RDX;
- // Preserve left, right and temp.
- __ pushq(left);
- __ pushq(right);
- // TOS + 0: saved right
- // TOS + 1: saved left
- // TOS + 2: return address
- // TOS + 3: right argument.
- // TOS + 4: left argument.
- __ movq(left, Address(RSP, 4 * kWordSize));
- __ movq(right, Address(RSP, 3 * kWordSize));
+void StubCode::GenerateIdenticalWithNumberCheckStub(Assembler* assembler,
+ const Register left,
+ const Register right,
+ const Register unused1,
+ const Register unused2) {
Label reference_compare, done, check_mint, check_bigint;
// If any of the arguments is Smi do reference compare.
__ testq(left, Immediate(kSmiTagMask));
@@ -2096,6 +2088,42 @@
__ Bind(&reference_compare);
__ cmpq(left, right);
__ Bind(&done);
+}
+
+
+// Called only from unoptimized code. All relevant registers have been saved.
+// TOS + 0: return address
+// TOS + 1: right argument.
+// TOS + 2: left argument.
+// Returns ZF set.
+void StubCode::GenerateUnoptimizedIdenticalWithNumberCheckStub(
+ Assembler* assembler) {
+ const Register left = RAX;
+ const Register right = RDX;
+
+ __ movq(left, Address(RSP, 2 * kWordSize));
+ __ movq(right, Address(RSP, 1 * kWordSize));
+ GenerateIdenticalWithNumberCheckStub(assembler, left, right);
+ __ ret();
+}
+
+
+// Called from otpimzied code only. Must preserve any registers that are
+// destroyed.
+// TOS + 0: return address
+// TOS + 1: right argument.
+// TOS + 2: left argument.
+// Returns ZF set.
+void StubCode::GenerateOptimizedIdenticalWithNumberCheckStub(
+ Assembler* assembler) {
+ const Register left = RAX;
+ const Register right = RDX;
+ // Preserve left and right.
+ __ pushq(left);
+ __ pushq(right);
+ __ movq(left, Address(RSP, 4 * kWordSize));
+ __ movq(right, Address(RSP, 3 * kWordSize));
+ GenerateIdenticalWithNumberCheckStub(assembler, left, right);
__ popq(right);
__ popq(left);
__ ret();
« no previous file with comments | « runtime/vm/stub_code_mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698