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

Side by Side Diff: src/builtins/mips64/builtins-mips64.cc

Issue 2229723002: [wasm] Support validation of asm.js modules with != 3 args. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: mips and more Created 4 years, 4 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/builtins/mips/builtins-mips.cc ('k') | src/builtins/ppc/builtins-ppc.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_MIPS64 5 #if V8_TARGET_ARCH_MIPS64
6 6
7 #include "src/codegen.h" 7 #include "src/codegen.h"
8 #include "src/debug/debug.h" 8 #include "src/debug/debug.h"
9 #include "src/deoptimizer.h" 9 #include "src/deoptimizer.h"
10 #include "src/full-codegen/full-codegen.h" 10 #include "src/full-codegen/full-codegen.h"
(...skipping 1420 matching lines...) Expand 10 before | Expand all | Expand 10 after
1431 // ----------- S t a t e ------------- 1431 // ----------- S t a t e -------------
1432 // -- a0 : argument count (preserved for callee) 1432 // -- a0 : argument count (preserved for callee)
1433 // -- a1 : new target (preserved for callee) 1433 // -- a1 : new target (preserved for callee)
1434 // -- a3 : target function (preserved for callee) 1434 // -- a3 : target function (preserved for callee)
1435 // ----------------------------------- 1435 // -----------------------------------
1436 Label failed; 1436 Label failed;
1437 { 1437 {
1438 FrameScope scope(masm, StackFrame::INTERNAL); 1438 FrameScope scope(masm, StackFrame::INTERNAL);
1439 // Push a copy of the target function and the new target. 1439 // Push a copy of the target function and the new target.
1440 // Push function as parameter to the runtime call. 1440 // Push function as parameter to the runtime call.
1441 __ Move(t2, a0);
1441 __ SmiTag(a0); 1442 __ SmiTag(a0);
1442 __ Push(a0, a1, a3, a1); 1443 __ Push(a0, a1, a3, a1);
1443 1444
1444 // Copy arguments from caller (stdlib, foreign, heap). 1445 // Copy arguments from caller (stdlib, foreign, heap).
1445 for (int i = 2; i >= 0; --i) { 1446 Label args_done;
1446 __ lw(a3, MemOperand(fp, StandardFrameConstants::kCallerSPOffset + 1447 for (int j = 0; j < 4; ++j) {
1447 i * kPointerSize)); 1448 Label over;
1448 __ push(a3); 1449 if (j < 3) {
1450 __ Branch(&over, ne, t2, Operand(j));
1451 }
1452 for (int i = j - 1; i >= 0; --i) {
1453 __ lw(t2, MemOperand(fp, StandardFrameConstants::kCallerSPOffset +
1454 i * kPointerSize));
1455 __ push(t2);
1456 }
1457 for (int i = 0; i < 3 - j; ++i) {
1458 __ PushRoot(Heap::kUndefinedValueRootIndex);
1459 }
1460 if (j < 3) {
1461 __ jmp(&args_done);
1462 __ bind(&over);
1463 }
1449 } 1464 }
1465 __ bind(&args_done);
1466
1450 // Call runtime, on success unwind frame, and parent frame. 1467 // Call runtime, on success unwind frame, and parent frame.
1451 __ CallRuntime(Runtime::kInstantiateAsmJs, 4); 1468 __ CallRuntime(Runtime::kInstantiateAsmJs, 4);
1452 // A smi 0 is returned on failure, an object on success. 1469 // A smi 0 is returned on failure, an object on success.
1453 __ JumpIfSmi(a0, &failed); 1470 __ JumpIfSmi(v0, &failed);
1471
1472 __ Drop(2);
1473 __ pop(t2);
1474 __ SmiUntag(t2);
1454 scope.GenerateLeaveFrame(); 1475 scope.GenerateLeaveFrame();
1455 __ Drop(4); 1476
1477 __ Addu(t2, t2, Operand(1));
1478 __ Lsa(sp, sp, t2, kPointerSizeLog2);
1456 __ Ret(); 1479 __ Ret();
1457 1480
1458 __ bind(&failed); 1481 __ bind(&failed);
1459 // Restore target function and new target. 1482 // Restore target function and new target.
1460 __ Pop(a0, a1, a3); 1483 __ Pop(a0, a1, a3);
1461 __ SmiUntag(a0); 1484 __ SmiUntag(a0);
1462 } 1485 }
1463 // On failure, tail call back to regular js. 1486 // On failure, tail call back to regular js.
1464 GenerateTailCallToReturnedCode(masm, Runtime::kCompileLazy); 1487 GenerateTailCallToReturnedCode(masm, Runtime::kCompileLazy);
1465 } 1488 }
(...skipping 1508 matching lines...) Expand 10 before | Expand all | Expand 10 after
2974 __ break_(0xCC); 2997 __ break_(0xCC);
2975 } 2998 }
2976 } 2999 }
2977 3000
2978 #undef __ 3001 #undef __
2979 3002
2980 } // namespace internal 3003 } // namespace internal
2981 } // namespace v8 3004 } // namespace v8
2982 3005
2983 #endif // V8_TARGET_ARCH_MIPS64 3006 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/builtins/mips/builtins-mips.cc ('k') | src/builtins/ppc/builtins-ppc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698