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

Unified Diff: src/full-codegen/mips/full-codegen-mips.cc

Issue 1854713002: Correctly annotate eval origin. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase Created 4 years, 8 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
« no previous file with comments | « src/full-codegen/ia32/full-codegen-ia32.cc ('k') | src/full-codegen/mips64/full-codegen-mips64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/full-codegen/mips/full-codegen-mips.cc
diff --git a/src/full-codegen/mips/full-codegen-mips.cc b/src/full-codegen/mips/full-codegen-mips.cc
index 3a065329d59bad14167949505f10918e3de470ca..58e71f6c6c9d9fde0974cbef08df02a3d02abd85 100644
--- a/src/full-codegen/mips/full-codegen-mips.cc
+++ b/src/full-codegen/mips/full-codegen-mips.cc
@@ -2568,26 +2568,29 @@ void FullCodeGenerator::EmitCall(Call* expr, ConvertReceiverMode mode) {
context()->DropAndPlug(1, v0);
}
-
-void FullCodeGenerator::EmitResolvePossiblyDirectEval(int arg_count) {
- // t3: copy of the first argument or undefined if it doesn't exist.
+void FullCodeGenerator::EmitResolvePossiblyDirectEval(Call* expr) {
+ int arg_count = expr->arguments()->length();
+ // t4: copy of the first argument or undefined if it doesn't exist.
if (arg_count > 0) {
- __ lw(t3, MemOperand(sp, arg_count * kPointerSize));
+ __ lw(t4, MemOperand(sp, arg_count * kPointerSize));
} else {
- __ LoadRoot(t3, Heap::kUndefinedValueRootIndex);
+ __ LoadRoot(t4, Heap::kUndefinedValueRootIndex);
}
- // t2: the receiver of the enclosing function.
- __ lw(t2, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
+ // t3: the receiver of the enclosing function.
+ __ lw(t3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
+
+ // t2: the language mode.
+ __ li(t2, Operand(Smi::FromInt(language_mode())));
- // t1: the language mode.
- __ li(t1, Operand(Smi::FromInt(language_mode())));
+ // t1: the start position of the scope the calls resides in.
+ __ li(t1, Operand(Smi::FromInt(scope()->start_position())));
- // t0: the start position of the scope the calls resides in.
- __ li(t0, Operand(Smi::FromInt(scope()->start_position())));
+ // t0: the source position of the eval call.
+ __ li(t0, Operand(Smi::FromInt(expr->position())));
// Do the runtime call.
- __ Push(t3, t2, t1, t0);
+ __ Push(t4, t3, t2, t1, t0);
__ CallRuntime(Runtime::kResolvePossiblyDirectEval);
}
@@ -2636,7 +2639,7 @@ void FullCodeGenerator::PushCalleeAndWithBaseObject(Call* expr) {
void FullCodeGenerator::EmitPossiblyEvalCall(Call* expr) {
- // In a call to eval, we first call RuntimeHidden_ResolvePossiblyDirectEval
+ // In a call to eval, we first call Runtime_ResolvePossiblyDirectEval
// to resolve the function we need to call. Then we call the resolved
// function using the given arguments.
ZoneList<Expression*>* args = expr->arguments();
@@ -2652,7 +2655,7 @@ void FullCodeGenerator::EmitPossiblyEvalCall(Call* expr) {
// resolve eval.
__ lw(a1, MemOperand(sp, (arg_count + 1) * kPointerSize));
__ push(a1);
- EmitResolvePossiblyDirectEval(arg_count);
+ EmitResolvePossiblyDirectEval(expr);
// Touch up the stack with the resolved function.
__ sw(v0, MemOperand(sp, (arg_count + 1) * kPointerSize));
« no previous file with comments | « src/full-codegen/ia32/full-codegen-ia32.cc ('k') | src/full-codegen/mips64/full-codegen-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698