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

Side by Side Diff: src/full-codegen/x64/full-codegen-x64.cc

Issue 1888013002: Revert of Correctly annotate eval origin. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « src/full-codegen/s390/full-codegen-s390.cc ('k') | src/full-codegen/x87/full-codegen-x87.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #if V8_TARGET_ARCH_X64 5 #if V8_TARGET_ARCH_X64
6 6
7 #include "src/ast/scopes.h" 7 #include "src/ast/scopes.h"
8 #include "src/code-factory.h" 8 #include "src/code-factory.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 2431 matching lines...) Expand 10 before | Expand all | Expand 10 after
2442 OperandStackDepthDecrement(arg_count + 1); 2442 OperandStackDepthDecrement(arg_count + 1);
2443 2443
2444 RecordJSReturnSite(expr); 2444 RecordJSReturnSite(expr);
2445 2445
2446 // Restore context register. 2446 // Restore context register.
2447 __ movp(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); 2447 __ movp(rsi, Operand(rbp, StandardFrameConstants::kContextOffset));
2448 // Discard the function left on TOS. 2448 // Discard the function left on TOS.
2449 context()->DropAndPlug(1, rax); 2449 context()->DropAndPlug(1, rax);
2450 } 2450 }
2451 2451
2452 void FullCodeGenerator::EmitResolvePossiblyDirectEval(Call* expr) { 2452
2453 int arg_count = expr->arguments()->length(); 2453 void FullCodeGenerator::EmitResolvePossiblyDirectEval(int arg_count) {
2454 // Push copy of the first argument or undefined if it doesn't exist. 2454 // Push copy of the first argument or undefined if it doesn't exist.
2455 if (arg_count > 0) { 2455 if (arg_count > 0) {
2456 __ Push(Operand(rsp, arg_count * kPointerSize)); 2456 __ Push(Operand(rsp, arg_count * kPointerSize));
2457 } else { 2457 } else {
2458 __ PushRoot(Heap::kUndefinedValueRootIndex); 2458 __ PushRoot(Heap::kUndefinedValueRootIndex);
2459 } 2459 }
2460 2460
2461 // Push the enclosing function. 2461 // Push the enclosing function.
2462 __ Push(Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); 2462 __ Push(Operand(rbp, JavaScriptFrameConstants::kFunctionOffset));
2463 2463
2464 // Push the language mode. 2464 // Push the language mode.
2465 __ Push(Smi::FromInt(language_mode())); 2465 __ Push(Smi::FromInt(language_mode()));
2466 2466
2467 // Push the source position of the eval call. 2467 // Push the start position of the scope the calls resides in.
2468 __ Push(Smi::FromInt(expr->position())); 2468 __ Push(Smi::FromInt(scope()->start_position()));
2469 2469
2470 // Do the runtime call. 2470 // Do the runtime call.
2471 __ CallRuntime(Runtime::kResolvePossiblyDirectEval); 2471 __ CallRuntime(Runtime::kResolvePossiblyDirectEval);
2472 } 2472 }
2473 2473
2474 2474
2475 // See http://www.ecma-international.org/ecma-262/6.0/#sec-function-calls. 2475 // See http://www.ecma-international.org/ecma-262/6.0/#sec-function-calls.
2476 void FullCodeGenerator::PushCalleeAndWithBaseObject(Call* expr) { 2476 void FullCodeGenerator::PushCalleeAndWithBaseObject(Call* expr) {
2477 VariableProxy* callee = expr->expression()->AsVariableProxy(); 2477 VariableProxy* callee = expr->expression()->AsVariableProxy();
2478 if (callee->var()->IsLookupSlot()) { 2478 if (callee->var()->IsLookupSlot()) {
(...skipping 28 matching lines...) Expand all
2507 } else { 2507 } else {
2508 VisitForStackValue(callee); 2508 VisitForStackValue(callee);
2509 // refEnv.WithBaseObject() 2509 // refEnv.WithBaseObject()
2510 OperandStackDepthIncrement(1); 2510 OperandStackDepthIncrement(1);
2511 __ PushRoot(Heap::kUndefinedValueRootIndex); 2511 __ PushRoot(Heap::kUndefinedValueRootIndex);
2512 } 2512 }
2513 } 2513 }
2514 2514
2515 2515
2516 void FullCodeGenerator::EmitPossiblyEvalCall(Call* expr) { 2516 void FullCodeGenerator::EmitPossiblyEvalCall(Call* expr) {
2517 // In a call to eval, we first call Runtime_ResolvePossiblyDirectEval 2517 // In a call to eval, we first call RuntimeHidden_ResolvePossiblyDirectEval
2518 // to resolve the function we need to call. Then we call the resolved 2518 // to resolve the function we need to call. Then we call the resolved
2519 // function using the given arguments. 2519 // function using the given arguments.
2520 ZoneList<Expression*>* args = expr->arguments(); 2520 ZoneList<Expression*>* args = expr->arguments();
2521 int arg_count = args->length(); 2521 int arg_count = args->length();
2522 PushCalleeAndWithBaseObject(expr); 2522 PushCalleeAndWithBaseObject(expr);
2523 2523
2524 // Push the arguments. 2524 // Push the arguments.
2525 for (int i = 0; i < arg_count; i++) { 2525 for (int i = 0; i < arg_count; i++) {
2526 VisitForStackValue(args->at(i)); 2526 VisitForStackValue(args->at(i));
2527 } 2527 }
2528 2528
2529 // Push a copy of the function (found below the arguments) and resolve 2529 // Push a copy of the function (found below the arguments) and resolve
2530 // eval. 2530 // eval.
2531 __ Push(Operand(rsp, (arg_count + 1) * kPointerSize)); 2531 __ Push(Operand(rsp, (arg_count + 1) * kPointerSize));
2532 EmitResolvePossiblyDirectEval(expr); 2532 EmitResolvePossiblyDirectEval(arg_count);
2533 2533
2534 // Touch up the callee. 2534 // Touch up the callee.
2535 __ movp(Operand(rsp, (arg_count + 1) * kPointerSize), rax); 2535 __ movp(Operand(rsp, (arg_count + 1) * kPointerSize), rax);
2536 2536
2537 PrepareForBailoutForId(expr->EvalId(), NO_REGISTERS); 2537 PrepareForBailoutForId(expr->EvalId(), NO_REGISTERS);
2538 2538
2539 SetCallPosition(expr); 2539 SetCallPosition(expr);
2540 __ movp(rdi, Operand(rsp, (arg_count + 1) * kPointerSize)); 2540 __ movp(rdi, Operand(rsp, (arg_count + 1) * kPointerSize));
2541 __ Set(rax, arg_count); 2541 __ Set(rax, arg_count);
2542 __ Call(isolate()->builtins()->Call(ConvertReceiverMode::kAny, 2542 __ Call(isolate()->builtins()->Call(ConvertReceiverMode::kAny,
(...skipping 1336 matching lines...) Expand 10 before | Expand all | Expand 10 after
3879 DCHECK_EQ( 3879 DCHECK_EQ(
3880 isolate->builtins()->OnStackReplacement()->entry(), 3880 isolate->builtins()->OnStackReplacement()->entry(),
3881 Assembler::target_address_at(call_target_address, unoptimized_code)); 3881 Assembler::target_address_at(call_target_address, unoptimized_code));
3882 return ON_STACK_REPLACEMENT; 3882 return ON_STACK_REPLACEMENT;
3883 } 3883 }
3884 3884
3885 } // namespace internal 3885 } // namespace internal
3886 } // namespace v8 3886 } // namespace v8
3887 3887
3888 #endif // V8_TARGET_ARCH_X64 3888 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/full-codegen/s390/full-codegen-s390.cc ('k') | src/full-codegen/x87/full-codegen-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698