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

Unified Diff: src/ia32/ic-ia32.cc

Issue 356713003: Use IC register definitions in platform files. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Ports and comments. Created 6 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
Index: src/ia32/ic-ia32.cc
diff --git a/src/ia32/ic-ia32.cc b/src/ia32/ic-ia32.cc
index 0b3d110d1148948a7c5a4f0cc8234d2cfd4a3c5d..0850a9797ffa903ea049d819d1472f6d944ef677 100644
--- a/src/ia32/ic-ia32.cc
+++ b/src/ia32/ic-ia32.cc
@@ -388,6 +388,8 @@ void KeyedLoadIC::GenerateGeneric(MacroAssembler* masm) {
// -- edx : receiver
// -- esp[0] : return address
// -----------------------------------
+ ASSERT(edx.is(ReceiverRegister()));
+ ASSERT(ecx.is(NameRegister()));
Label slow, check_name, index_smi, index_name, property_array_property;
Label probe_dictionary, check_number_dictionary;
@@ -566,6 +568,8 @@ void KeyedLoadIC::GenerateString(MacroAssembler* masm) {
// -- edx : receiver
// -- esp[0] : return address
// -----------------------------------
+ ASSERT(edx.is(ReceiverRegister()));
+ ASSERT(ecx.is(NameRegister()));
Label miss;
Register receiver = edx;
Jakob Kummerow 2014/06/25 16:17:40 awww... come on!
mvstanton 2014/06/26 09:18:11 Haha! Okay I will try and do a little better :).
@@ -598,6 +602,8 @@ void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) {
// -- edx : receiver
// -- esp[0] : return address
// -----------------------------------
+ ASSERT(edx.is(ReceiverRegister()));
+ ASSERT(ecx.is(NameRegister()));
Label slow;
// Check that the receiver isn't a smi.
@@ -640,6 +646,8 @@ void KeyedLoadIC::GenerateSloppyArguments(MacroAssembler* masm) {
// -- edx : receiver
// -- esp[0] : return address
// -----------------------------------
+ ASSERT(edx.is(ReceiverRegister()));
+ ASSERT(ecx.is(NameRegister()));
Label slow, notin;
Factory* factory = masm->isolate()->factory();
Operand mapped_location =
@@ -930,6 +938,8 @@ void LoadIC::GenerateMegamorphic(MacroAssembler* masm) {
// -- edx : receiver
// -- esp[0] : return address
// -----------------------------------
+ ASSERT(edx.is(ReceiverRegister()));
+ ASSERT(ecx.is(NameRegister()));
// Probe the stub cache.
Code::Flags flags = Code::ComputeHandlerFlags(Code::LOAD_IC);
@@ -947,6 +957,9 @@ void LoadIC::GenerateNormal(MacroAssembler* masm) {
// -- edx : receiver
// -- esp[0] : return address
// -----------------------------------
+ ASSERT(edx.is(ReceiverRegister()));
+ ASSERT(ecx.is(NameRegister()));
+
Label miss, slow;
GenerateNameDictionaryReceiverCheck(masm, edx, eax, ebx, &miss);
@@ -966,19 +979,20 @@ void LoadIC::GenerateNormal(MacroAssembler* masm) {
}
-void LoadIC::GenerateMiss(MacroAssembler* masm) {
- // ----------- S t a t e -------------
- // -- ecx : name
- // -- edx : receiver
- // -- esp[0] : return address
- // -----------------------------------
+// A register that isn't one of the parameters to the load ic.
+static const Register LoadIC_TempRegister() { return ebx; }
+
+void LoadIC::GenerateMiss(MacroAssembler* masm) {
+ // ----------- S t a t e ------------------
+ // -- esp[0] : return address
+ // ----------------------------------------
__ IncrementCounter(masm->isolate()->counters()->load_miss(), 1);
- __ pop(ebx);
- __ push(edx); // receiver
- __ push(ecx); // name
- __ push(ebx); // return address
+ __ pop(LoadIC_TempRegister());
+ __ push(ReceiverRegister()); // receiver
+ __ push(NameRegister()); // name
+ __ push(LoadIC_TempRegister()); // return address
// Perform tail call to the entry.
ExternalReference ref =
@@ -988,35 +1002,35 @@ void LoadIC::GenerateMiss(MacroAssembler* masm) {
void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) {
- // ----------- S t a t e -------------
- // -- ecx : key
- // -- edx : receiver
- // -- esp[0] : return address
- // -----------------------------------
-
- __ pop(ebx);
- __ push(edx); // receiver
- __ push(ecx); // name
- __ push(ebx); // return address
+ // ----------- S t a t e ------------------
+ // -- esp[0] : return address
+ // ----------------------------------------
+ __ pop(LoadIC_TempRegister());
+ __ push(ReceiverRegister()); // receiver
+ __ push(NameRegister()); // name
+ __ push(LoadIC_TempRegister()); // return address
// Perform tail call to the entry.
__ TailCallRuntime(Runtime::kGetProperty, 2, 1);
}
-void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) {
- // ----------- S t a t e -------------
- // -- ecx : key
- // -- edx : receiver
- // -- esp[0] : return address
- // -----------------------------------
+// A register that isn't one of the parameters to the load ic.
+static const Register KeyedLoadIC_TempRegister() {
+ return LoadIC_TempRegister();
+}
+
+void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) {
+ // ----------- S t a t e ------------------
+ // -- esp[0] : return address
+ // ----------------------------------------
__ IncrementCounter(masm->isolate()->counters()->keyed_load_miss(), 1);
- __ pop(ebx);
- __ push(edx); // receiver
- __ push(ecx); // name
- __ push(ebx); // return address
+ __ pop(KeyedLoadIC_TempRegister());
+ __ push(ReceiverRegister()); // receiver
+ __ push(NameRegister()); // name
+ __ push(KeyedLoadIC_TempRegister()); // return address
// Perform tail call to the entry.
ExternalReference ref =
@@ -1039,16 +1053,13 @@ const Register KeyedLoadIC::NameRegister() { return LoadIC::NameRegister(); }
void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) {
- // ----------- S t a t e -------------
- // -- ecx : key
- // -- edx : receiver
- // -- esp[0] : return address
- // -----------------------------------
-
- __ pop(ebx);
- __ push(edx); // receiver
- __ push(ecx); // name
- __ push(ebx); // return address
+ // ----------- S t a t e ------------------
+ // -- esp[0] : return address
+ // ----------------------------------------
+ __ pop(KeyedLoadIC_TempRegister());
+ __ push(ReceiverRegister()); // receiver
+ __ push(NameRegister()); // name
+ __ push(KeyedLoadIC_TempRegister()); // return address
// Perform tail call to the entry.
__ TailCallRuntime(Runtime::kKeyedGetProperty, 2, 1);

Powered by Google App Engine
This is Rietveld 408576698