Revision: 24841
Author: [email protected]
Date: Thu Oct 23 12:05:46 2014 UTC
Log: MIPS: Classes: implement 'new super'.
Port r24825 (b26f0181)
BUG=
[email protected], [email protected]
Review URL: https://codereview.chromium.org/676703002
https://code.google.com/p/v8/source/detail?r=24841
Modified:
/branches/bleeding_edge/src/mips/full-codegen-mips.cc
/branches/bleeding_edge/src/mips64/full-codegen-mips64.cc
=======================================
--- /branches/bleeding_edge/src/mips/full-codegen-mips.cc Wed Oct 22
18:16:35 2014 UTC
+++ /branches/bleeding_edge/src/mips/full-codegen-mips.cc Thu Oct 23
12:05:46 2014 UTC
@@ -2937,6 +2937,14 @@
__ Push(t2, t1, t0, a1);
__ CallRuntime(Runtime::kResolvePossiblyDirectEval, 5);
}
+
+
+void FullCodeGenerator::EmitLoadSuperConstructor(SuperReference*
super_ref) {
+ DCHECK(super_ref != NULL);
+ __ lw(a0, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
+ __ Push(a0);
+ __ CallRuntime(Runtime::kGetPrototype, 1);
+}
void FullCodeGenerator::VisitCall(Call* expr) {
@@ -3054,10 +3062,7 @@
}
} else if (call_type == Call::SUPER_CALL) {
SuperReference* super_ref = callee->AsSuperReference();
- DCHECK(super_ref != NULL);
- __ lw(a0, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
- __ Push(a0);
- __ CallRuntime(Runtime::kGetPrototype, 1);
+ EmitLoadSuperConstructor(super_ref);
__ Push(result_register());
VisitForStackValue(super_ref->this_var());
EmitCall(expr, CallICState::METHOD);
@@ -3089,7 +3094,12 @@
// Push constructor on the stack. If it's not a function it's used as
// receiver for CALL_NON_FUNCTION, otherwise the value on the stack is
// ignored.
- VisitForStackValue(expr->expression());
+ if (expr->expression()->IsSuperReference()) {
+ EmitLoadSuperConstructor(expr->expression()->AsSuperReference());
+ __ Push(result_register());
+ } else {
+ VisitForStackValue(expr->expression());
+ }
// Push the arguments ("left-to-right") on the stack.
ZoneList<Expression*>* args = expr->arguments();
=======================================
--- /branches/bleeding_edge/src/mips64/full-codegen-mips64.cc Wed Oct 22
18:16:35 2014 UTC
+++ /branches/bleeding_edge/src/mips64/full-codegen-mips64.cc Thu Oct 23
12:05:46 2014 UTC
@@ -2936,6 +2936,14 @@
__ Push(a6, a5, a4, a1);
__ CallRuntime(Runtime::kResolvePossiblyDirectEval, 5);
}
+
+
+void FullCodeGenerator::EmitLoadSuperConstructor(SuperReference*
super_ref) {
+ DCHECK(super_ref != NULL);
+ __ ld(a0, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
+ __ Push(a0);
+ __ CallRuntime(Runtime::kGetPrototype, 1);
+}
void FullCodeGenerator::VisitCall(Call* expr) {
@@ -3053,10 +3061,7 @@
}
} else if (call_type == Call::SUPER_CALL) {
SuperReference* super_ref = callee->AsSuperReference();
- DCHECK(super_ref != NULL);
- __ ld(a0, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
- __ Push(a0);
- __ CallRuntime(Runtime::kGetPrototype, 1);
+ EmitLoadSuperConstructor(super_ref);
__ Push(result_register());
VisitForStackValue(super_ref->this_var());
EmitCall(expr, CallICState::METHOD);
@@ -3088,7 +3093,12 @@
// Push constructor on the stack. If it's not a function it's used as
// receiver for CALL_NON_FUNCTION, otherwise the value on the stack is
// ignored.
- VisitForStackValue(expr->expression());
+ if (expr->expression()->IsSuperReference()) {
+ EmitLoadSuperConstructor(expr->expression()->AsSuperReference());
+ __ Push(result_register());
+ } else {
+ VisitForStackValue(expr->expression());
+ }
// Push the arguments ("left-to-right") on the stack.
ZoneList<Expression*>* args = expr->arguments();
--
--
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.