MIPS: Classes: Add super support in methods and accessors.
authorbalazs.kilvady@imgtec.com <balazs.kilvady@imgtec.com>
Wed, 29 Oct 2014 13:16:23 +0000 (13:16 +0000)
committerbalazs.kilvady@imgtec.com <balazs.kilvady@imgtec.com>
Wed, 29 Oct 2014 13:16:44 +0000 (13:16 +0000)
Port r24976 (5cb743f)

Original commit message:
This is done by installing the [[HomeObject]] on the method and the
accessor functions.

BUG=v8:3330
LOG=Y
R=dusan.milosavljevic@imgtec.com

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

Cr-Commit-Position: refs/heads/master@{#24979}
git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24979 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/mips/full-codegen-mips.cc
src/mips64/full-codegen-mips64.cc

index e2064da..f459b87 100644 (file)
@@ -2507,34 +2507,22 @@ void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit) {
     }
     __ push(scratch);
     VisitForStackValue(key);
+    VisitForStackValue(value);
 
     switch (property->kind()) {
       case ObjectLiteral::Property::CONSTANT:
       case ObjectLiteral::Property::MATERIALIZED_LITERAL:
       case ObjectLiteral::Property::COMPUTED:
       case ObjectLiteral::Property::PROTOTYPE:
-        VisitForStackValue(value);
-        __ li(scratch, Operand(Smi::FromInt(NONE)));
-        __ push(scratch);
-        __ CallRuntime(Runtime::kDefineDataPropertyUnchecked, 4);
+        __ CallRuntime(Runtime::kDefineClassMethod, 3);
         break;
 
       case ObjectLiteral::Property::GETTER:
-        VisitForStackValue(value);
-        __ LoadRoot(scratch, Heap::kNullValueRootIndex);
-        __ push(scratch);
-        __ li(scratch, Operand(Smi::FromInt(NONE)));
-        __ push(scratch);
-        __ CallRuntime(Runtime::kDefineAccessorPropertyUnchecked, 5);
+        __ CallRuntime(Runtime::kDefineClassGetter, 3);
         break;
 
       case ObjectLiteral::Property::SETTER:
-        __ LoadRoot(scratch, Heap::kNullValueRootIndex);
-        __ push(scratch);
-        VisitForStackValue(value);
-        __ li(scratch, Operand(Smi::FromInt(NONE)));
-        __ push(scratch);
-        __ CallRuntime(Runtime::kDefineAccessorPropertyUnchecked, 5);
+        __ CallRuntime(Runtime::kDefineClassSetter, 3);
         break;
 
       default:
index e653326..746119d 100644 (file)
@@ -2504,34 +2504,22 @@ void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit) {
     }
     __ push(scratch);
     VisitForStackValue(key);
+    VisitForStackValue(value);
 
     switch (property->kind()) {
       case ObjectLiteral::Property::CONSTANT:
       case ObjectLiteral::Property::MATERIALIZED_LITERAL:
       case ObjectLiteral::Property::COMPUTED:
       case ObjectLiteral::Property::PROTOTYPE:
-        VisitForStackValue(value);
-        __ li(scratch, Operand(Smi::FromInt(NONE)));
-        __ push(scratch);
-        __ CallRuntime(Runtime::kDefineDataPropertyUnchecked, 4);
+        __ CallRuntime(Runtime::kDefineClassMethod, 3);
         break;
 
       case ObjectLiteral::Property::GETTER:
-        VisitForStackValue(value);
-        __ LoadRoot(scratch, Heap::kNullValueRootIndex);
-        __ push(scratch);
-        __ li(scratch, Operand(Smi::FromInt(NONE)));
-        __ push(scratch);
-        __ CallRuntime(Runtime::kDefineAccessorPropertyUnchecked, 5);
+        __ CallRuntime(Runtime::kDefineClassGetter, 3);
         break;
 
       case ObjectLiteral::Property::SETTER:
-        __ LoadRoot(scratch, Heap::kNullValueRootIndex);
-        __ push(scratch);
-        VisitForStackValue(value);
-        __ li(scratch, Operand(Smi::FromInt(NONE)));
-        __ push(scratch);
-        __ CallRuntime(Runtime::kDefineAccessorPropertyUnchecked, 5);
+        __ CallRuntime(Runtime::kDefineClassSetter, 3);
         break;
 
       default: