Revision: 23992
Author:   [email protected]
Date:     Wed Sep 17 05:21:36 2014 UTC
Log:      X87: Removing ic.h from code-stubs.h

port r23977.

original commit message:

  Removing ic.h from code-stubs.h

CodeStubs use state types defined in ic.h, but this has the unfortunate effect of spreading ic.h all over the place. Instead, define these shared state types in ic-public.h and allow ic.h to concern itself with internal state change of the ICs.

  More work could/should be done here, but this is a first step.

BUG=
[email protected]

Review URL: https://codereview.chromium.org/573123003

Patch from Jing Bao <[email protected]>.
https://code.google.com/p/v8/source/detail?r=23992

Modified:
 /branches/bleeding_edge/src/ic/x87/handler-compiler-x87.cc
 /branches/bleeding_edge/src/ic/x87/ic-compiler-x87.cc
 /branches/bleeding_edge/src/x87/code-stubs-x87.cc
 /branches/bleeding_edge/src/x87/full-codegen-x87.cc
 /branches/bleeding_edge/src/x87/lithium-codegen-x87.cc

=======================================
--- /branches/bleeding_edge/src/ic/x87/handler-compiler-x87.cc Fri Sep 12 07:51:39 2014 UTC +++ /branches/bleeding_edge/src/ic/x87/handler-compiler-x87.cc Wed Sep 17 05:21:36 2014 UTC
@@ -8,6 +8,7 @@

 #include "src/ic/call-optimization.h"
 #include "src/ic/handler-compiler.h"
+#include "src/ic/ic.h"

 namespace v8 {
 namespace internal {
=======================================
--- /branches/bleeding_edge/src/ic/x87/ic-compiler-x87.cc Fri Sep 5 02:11:31 2014 UTC +++ /branches/bleeding_edge/src/ic/x87/ic-compiler-x87.cc Wed Sep 17 05:21:36 2014 UTC
@@ -6,6 +6,7 @@

 #if V8_TARGET_ARCH_X87

+#include "src/ic/ic.h"
 #include "src/ic/ic-compiler.h"

 namespace v8 {
=======================================
--- /branches/bleeding_edge/src/x87/code-stubs-x87.cc Fri Sep 12 07:51:39 2014 UTC +++ /branches/bleeding_edge/src/x87/code-stubs-x87.cc Wed Sep 17 05:21:36 2014 UTC
@@ -11,6 +11,7 @@
 #include "src/code-stubs.h"
 #include "src/codegen.h"
 #include "src/ic/handler-compiler.h"
+#include "src/ic/ic.h"
 #include "src/isolate.h"
 #include "src/jsregexp.h"
 #include "src/regexp-macro-assembler.h"
@@ -1195,14 +1196,12 @@
 }


-static void CheckInputType(MacroAssembler* masm,
-                           Register input,
-                           CompareIC::State expected,
-                           Label* fail) {
+static void CheckInputType(MacroAssembler* masm, Register input,
+                           CompareICState::State expected, Label* fail) {
   Label ok;
-  if (expected == CompareIC::SMI) {
+  if (expected == CompareICState::SMI) {
     __ JumpIfNotSmi(input, fail);
-  } else if (expected == CompareIC::NUMBER) {
+  } else if (expected == CompareICState::NUMBER) {
     __ JumpIfSmi(input, &ok);
     __ cmp(FieldOperand(input, HeapObject::kMapOffset),
            Immediate(masm->isolate()->factory()->heap_number_map()));
@@ -1818,7 +1817,7 @@
   __ TailCallStub(&stub);

   __ bind(&miss);
-  GenerateMiss(masm, IC::kCallIC_Customization_Miss);
+  GenerateMiss(masm);

// The slow case, we need this no matter what to complete a call after a miss.
   CallFunctionNoFeedback(masm,
@@ -1897,7 +1896,7 @@

   // We are here because tracing is on or we are going monomorphic.
   __ bind(&miss);
-  GenerateMiss(masm, IC::kCallIC_Miss);
+  GenerateMiss(masm);

   // the slow case
   __ bind(&slow_start);
@@ -1915,7 +1914,7 @@
 }


-void CallICStub::GenerateMiss(MacroAssembler* masm, IC::UtilityId id) {
+void CallICStub::GenerateMiss(MacroAssembler* masm) {
   // Get the receiver of the function from the stack; 1 ~ return address.
   __ mov(ecx, Operand(esp, (arg_count() + 1) * kPointerSize));

@@ -1929,6 +1928,9 @@
     __ push(edx);

     // Call the entry.
+    IC::UtilityId id = GetICState() == DEFAULT ? IC::kCallIC_Miss
+ : IC::kCallIC_Customization_Miss;
+
     ExternalReference miss = ExternalReference(IC_Utility(id),
                                                masm->isolate());
     __ CallExternalReference(miss, 4);
@@ -2973,7 +2975,7 @@


 void CompareICStub::GenerateSmis(MacroAssembler* masm) {
-  DCHECK(state() == CompareIC::SMI);
+  DCHECK(state() == CompareICState::SMI);
   Label miss;
   __ mov(ecx, edx);
   __ or_(ecx, eax);
@@ -2999,16 +3001,16 @@


 void CompareICStub::GenerateNumbers(MacroAssembler* masm) {
-  DCHECK(state() == CompareIC::NUMBER);
+  DCHECK(state() == CompareICState::NUMBER);

   Label generic_stub;
   Label unordered, maybe_undefined1, maybe_undefined2;
   Label miss;

-  if (left() == CompareIC::SMI) {
+  if (left() == CompareICState::SMI) {
     __ JumpIfNotSmi(edx, &miss);
   }
-  if (right() == CompareIC::SMI) {
+  if (right() == CompareICState::SMI) {
     __ JumpIfNotSmi(eax, &miss);
   }

@@ -3027,8 +3029,8 @@

   __ bind(&unordered);
   __ bind(&generic_stub);
- CompareICStub stub(isolate(), op(), CompareIC::GENERIC, CompareIC::GENERIC,
-                     CompareIC::GENERIC);
+  CompareICStub stub(isolate(), op(), CompareICState::GENERIC,
+                     CompareICState::GENERIC, CompareICState::GENERIC);
   __ jmp(stub.GetCode(), RelocInfo::CODE_TARGET);

   __ bind(&maybe_undefined1);
@@ -3053,7 +3055,7 @@


 void CompareICStub::GenerateInternalizedStrings(MacroAssembler* masm) {
-  DCHECK(state() == CompareIC::INTERNALIZED_STRING);
+  DCHECK(state() == CompareICState::INTERNALIZED_STRING);
   DCHECK(GetCondition() == equal);

   // Registers containing left and right operands respectively.
@@ -3098,7 +3100,7 @@


 void CompareICStub::GenerateUniqueNames(MacroAssembler* masm) {
-  DCHECK(state() == CompareIC::UNIQUE_NAME);
+  DCHECK(state() == CompareICState::UNIQUE_NAME);
   DCHECK(GetCondition() == equal);

   // Registers containing left and right operands respectively.
@@ -3143,7 +3145,7 @@


 void CompareICStub::GenerateStrings(MacroAssembler* masm) {
-  DCHECK(state() == CompareIC::STRING);
+  DCHECK(state() == CompareICState::STRING);
   Label miss;

   bool equality = Token::IsEqualityOp(op());
@@ -3233,7 +3235,7 @@


 void CompareICStub::GenerateObjects(MacroAssembler* masm) {
-  DCHECK(state() == CompareIC::OBJECT);
+  DCHECK(state() == CompareICState::OBJECT);
   Label miss;
   __ mov(ecx, edx);
   __ and_(ecx, eax);
=======================================
--- /branches/bleeding_edge/src/x87/full-codegen-x87.cc Fri Sep 12 10:58:43 2014 UTC +++ /branches/bleeding_edge/src/x87/full-codegen-x87.cc Wed Sep 17 05:21:36 2014 UTC
@@ -12,6 +12,7 @@
 #include "src/compiler.h"
 #include "src/debug.h"
 #include "src/full-codegen.h"
+#include "src/ic/ic.h"
 #include "src/isolate-inl.h"
 #include "src/parser.h"
 #include "src/scopes.h"
@@ -2540,11 +2541,10 @@
 void FullCodeGenerator::EmitCallWithLoadIC(Call* expr) {
   Expression* callee = expr->expression();

-  CallIC::CallType call_type = callee->IsVariableProxy()
-      ? CallIC::FUNCTION
-      : CallIC::METHOD;
+  CallICState::CallType call_type =
+ callee->IsVariableProxy() ? CallICState::FUNCTION : CallICState::METHOD;
   // Get the target function.
-  if (call_type == CallIC::FUNCTION) {
+  if (call_type == CallICState::FUNCTION) {
     { StackValueContext context(this);
       EmitVariableLoad(callee->AsVariableProxy());
       PrepareForBailout(callee, NO_REGISTERS);
@@ -2586,11 +2586,11 @@
   __ push(Operand(esp, 0));
   __ mov(Operand(esp, kPointerSize), eax);

-  EmitCall(expr, CallIC::METHOD);
+  EmitCall(expr, CallICState::METHOD);
 }


-void FullCodeGenerator::EmitCall(Call* expr, CallIC::CallType call_type) {
+void FullCodeGenerator::EmitCall(Call* expr, CallICState::CallType call_type) {
   // Load the arguments.
   ZoneList<Expression*>* args = expr->arguments();
   int arg_count = args->length();
=======================================
--- /branches/bleeding_edge/src/x87/lithium-codegen-x87.cc Fri Sep 12 08:43:27 2014 UTC +++ /branches/bleeding_edge/src/x87/lithium-codegen-x87.cc Wed Sep 17 05:21:36 2014 UTC
@@ -12,6 +12,7 @@
 #include "src/codegen.h"
 #include "src/deoptimizer.h"
 #include "src/hydrogen-osr.h"
+#include "src/ic/ic.h"
 #include "src/ic/stub-cache.h"
 #include "src/x87/lithium-codegen-x87.h"

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to