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

Side by Side Diff: src/arm64/macro-assembler-arm64.cc

Issue 1760253003: [crankshaft] Support ES6 tail call elimination. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@tco-crank-2
Patch Set: Addressing comments Created 4 years, 9 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/arm64/macro-assembler-arm64.h ('k') | src/ast/ast-numbering.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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_ARM64 5 #if V8_TARGET_ARCH_ARM64
6 6
7 #include "src/base/bits.h" 7 #include "src/base/bits.h"
8 #include "src/base/division-by-constant.h" 8 #include "src/base/division-by-constant.h"
9 #include "src/bootstrapper.h" 9 #include "src/bootstrapper.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 2312 matching lines...) Expand 10 before | Expand all | Expand 10 after
2323 // if ((type is string && type is internalized) || type == SYMBOL_TYPE) { 2323 // if ((type is string && type is internalized) || type == SYMBOL_TYPE) {
2324 // continue 2324 // continue
2325 // } else { 2325 // } else {
2326 // goto not_unique_name 2326 // goto not_unique_name
2327 // } 2327 // }
2328 Tst(type, kIsNotStringMask | kIsNotInternalizedMask); 2328 Tst(type, kIsNotStringMask | kIsNotInternalizedMask);
2329 Ccmp(type, SYMBOL_TYPE, ZFlag, ne); 2329 Ccmp(type, SYMBOL_TYPE, ZFlag, ne);
2330 B(ne, not_unique_name); 2330 B(ne, not_unique_name);
2331 } 2331 }
2332 2332
2333 void MacroAssembler::PrepareForTailCall(const ParameterCount& callee_args_count,
2334 Register caller_args_count_reg,
2335 Register scratch0, Register scratch1) {
2336 #if DEBUG
2337 if (callee_args_count.is_reg()) {
2338 DCHECK(!AreAliased(callee_args_count.reg(), caller_args_count_reg, scratch0,
2339 scratch1));
2340 } else {
2341 DCHECK(!AreAliased(caller_args_count_reg, scratch0, scratch1));
2342 }
2343 #endif
2344
2345 // Calculate the end of destination area where we will put the arguments
2346 // after we drop current frame. We add kPointerSize to count the receiver
2347 // argument which is not included into formal parameters count.
2348 Register dst_reg = scratch0;
2349 __ add(dst_reg, fp, Operand(caller_args_count_reg, LSL, kPointerSizeLog2));
2350 __ add(dst_reg, dst_reg,
2351 Operand(StandardFrameConstants::kCallerSPOffset + kPointerSize));
2352
2353 Register src_reg = caller_args_count_reg;
2354 // Calculate the end of source area. +kPointerSize is for the receiver.
2355 if (callee_args_count.is_reg()) {
2356 add(src_reg, jssp, Operand(callee_args_count.reg(), LSL, kPointerSizeLog2));
2357 add(src_reg, src_reg, Operand(kPointerSize));
2358 } else {
2359 add(src_reg, jssp,
2360 Operand((callee_args_count.immediate() + 1) * kPointerSize));
2361 }
2362
2363 if (FLAG_debug_code) {
2364 __ Cmp(src_reg, dst_reg);
2365 __ Check(lo, kStackAccessBelowStackPointer);
2366 }
2367
2368 // Restore caller's frame pointer and return address now as they will be
2369 // overwritten by the copying loop.
2370 __ Ldr(lr, MemOperand(fp, StandardFrameConstants::kCallerPCOffset));
2371 __ Ldr(fp, MemOperand(fp, StandardFrameConstants::kCallerFPOffset));
2372
2373 // Now copy callee arguments to the caller frame going backwards to avoid
2374 // callee arguments corruption (source and destination areas could overlap).
2375
2376 // Both src_reg and dst_reg are pointing to the word after the one to copy,
2377 // so they must be pre-decremented in the loop.
2378 Register tmp_reg = scratch1;
2379 Label loop, entry;
2380 __ B(&entry);
2381 __ bind(&loop);
2382 __ Ldr(tmp_reg, MemOperand(src_reg, -kPointerSize, PreIndex));
2383 __ Str(tmp_reg, MemOperand(dst_reg, -kPointerSize, PreIndex));
2384 __ bind(&entry);
2385 __ Cmp(jssp, src_reg);
2386 __ B(ne, &loop);
2387
2388 // Leave current frame.
2389 __ Mov(jssp, dst_reg);
2390 __ SetStackPointer(jssp);
2391 __ AssertStackConsistency();
2392 }
2333 2393
2334 void MacroAssembler::InvokePrologue(const ParameterCount& expected, 2394 void MacroAssembler::InvokePrologue(const ParameterCount& expected,
2335 const ParameterCount& actual, 2395 const ParameterCount& actual,
2336 Label* done, 2396 Label* done,
2337 InvokeFlag flag, 2397 InvokeFlag flag,
2338 bool* definitely_mismatches, 2398 bool* definitely_mismatches,
2339 const CallWrapper& call_wrapper) { 2399 const CallWrapper& call_wrapper) {
2340 bool definitely_matches = false; 2400 bool definitely_matches = false;
2341 *definitely_mismatches = false; 2401 *definitely_mismatches = false;
2342 Label regular_invoke; 2402 Label regular_invoke;
(...skipping 2634 matching lines...) Expand 10 before | Expand all | Expand 10 after
4977 } 5037 }
4978 5038
4979 5039
4980 #undef __ 5040 #undef __
4981 5041
4982 5042
4983 } // namespace internal 5043 } // namespace internal
4984 } // namespace v8 5044 } // namespace v8
4985 5045
4986 #endif // V8_TARGET_ARCH_ARM64 5046 #endif // V8_TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « src/arm64/macro-assembler-arm64.h ('k') | src/ast/ast-numbering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698