Revision: 15864
Author:   [email protected]
Date:     Wed Jul 24 08:41:00 2013
Log:      MIPS: Convert CONSTANT_FUNCTION to CONSTANT

Port r15858 (e3a6d2a)

BUG=

Review URL: https://codereview.chromium.org/19847003
Patch from Balazs Kilvady <[email protected]>.
http://code.google.com/p/v8/source/detail?r=15864

Modified:
 /branches/bleeding_edge/src/mips/lithium-codegen-mips.cc
 /branches/bleeding_edge/src/mips/stub-cache-mips.cc

=======================================
--- /branches/bleeding_edge/src/mips/lithium-codegen-mips.cc Wed Jul 24 03:48:16 2013 +++ /branches/bleeding_edge/src/mips/lithium-codegen-mips.cc Wed Jul 24 08:41:00 2013
@@ -411,11 +411,7 @@
       Abort("EmitLoadRegister: Unsupported double immediate.");
     } else {
       ASSERT(r.IsTagged());
-      if (literal->IsSmi()) {
-        __ li(scratch, Operand(literal));
-      } else {
-       __ LoadHeapObject(scratch, Handle<HeapObject>::cast(literal));
-      }
+      __ LoadObject(scratch, literal);
     }
     return scratch;
   } else if (op->IsStackSlot() || op->IsArgument()) {
@@ -1628,12 +1624,7 @@
 void LCodeGen::DoConstantT(LConstantT* instr) {
   Handle<Object> value = instr->value();
   AllowDeferredHandleDereference smi_check;
-  if (value->IsSmi()) {
-    __ li(ToRegister(instr->result()), Operand(value));
-  } else {
-    __ LoadHeapObject(ToRegister(instr->result()),
-                      Handle<HeapObject>::cast(value));
-  }
+  __ LoadObject(ToRegister(instr->result()), value);
 }


@@ -2886,9 +2877,9 @@
       __ lw(result, FieldMemOperand(object, JSObject::kPropertiesOffset));
__ lw(result, FieldMemOperand(result, offset + FixedArray::kHeaderSize));
     }
-  } else if (lookup.IsConstantFunction()) {
-    Handle<JSFunction> function(lookup.GetConstantFunctionFromMap(*type));
-    __ LoadHeapObject(result, function);
+  } else if (lookup.IsConstant()) {
+    Handle<Object> constant(lookup.GetConstantFromMap(*type), isolate());
+    __ LoadObject(result, constant);
   } else {
     // Negative lookup.
     // Check prototypes.
=======================================
--- /branches/bleeding_edge/src/mips/stub-cache-mips.cc Thu Jul 18 02:12:44 2013 +++ /branches/bleeding_edge/src/mips/stub-cache-mips.cc Wed Jul 24 08:41:00 2013
@@ -470,10 +470,9 @@
   Representation representation = details.representation();
   ASSERT(!representation.IsNone());

-  if (details.type() == CONSTANT_FUNCTION) {
-    Handle<HeapObject> constant(
-        HeapObject::cast(descriptors->GetValue(descriptor)));
-    __ LoadHeapObject(scratch1, constant);
+  if (details.type() == CONSTANT) {
+ Handle<Object> constant(descriptors->GetValue(descriptor), masm->isolate());
+    __ LoadObject(scratch1, constant);
     __ Branch(miss_label, ne, value_reg, Operand(scratch1));
   } else if (FLAG_track_fields && representation.IsSmi()) {
     __ JumpIfNotSmi(value_reg, miss_label);
@@ -532,7 +531,7 @@
                       OMIT_REMEMBERED_SET,
                       OMIT_SMI_CHECK);

-  if (details.type() == CONSTANT_FUNCTION) {
+  if (details.type() == CONSTANT) {
     ASSERT(value_reg.is(a0));
     __ Ret(USE_DELAY_SLOT);
     __ mov(v0, a0);
@@ -1404,9 +1403,9 @@
 }


-void BaseLoadStubCompiler::GenerateLoadConstant(Handle<JSFunction> value) {
+void BaseLoadStubCompiler::GenerateLoadConstant(Handle<Object> value) {
   // Return the constant value.
-  __ LoadHeapObject(v0, value);
+  __ LoadObject(v0, value);
   __ Ret();
 }

@@ -2709,7 +2708,7 @@
     Handle<Code> code = CompileCustomCall(object, holder,
                                           Handle<Cell>::null(),
function, Handle<String>::cast(name),
-                                          Code::CONSTANT_FUNCTION);
+                                          Code::CONSTANT);
     // A null handle means bail out to the regular compiler code below.
     if (!code.is_null()) return code;
   }

--
--
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/groups/opt_out.


Reply via email to