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

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

Issue 2258093002: MIPS64: Fix [wasm] Support validation of asm.js modules with != 3 args. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 | « no previous file | no next file » | 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 1435 matching lines...) Expand 10 before | Expand all | Expand 10 after
1446 __ Push(a0, a1, a3, a1); 1446 __ Push(a0, a1, a3, a1);
1447 1447
1448 // Copy arguments from caller (stdlib, foreign, heap). 1448 // Copy arguments from caller (stdlib, foreign, heap).
1449 Label args_done; 1449 Label args_done;
1450 for (int j = 0; j < 4; ++j) { 1450 for (int j = 0; j < 4; ++j) {
1451 Label over; 1451 Label over;
1452 if (j < 3) { 1452 if (j < 3) {
1453 __ Branch(&over, ne, t2, Operand(j)); 1453 __ Branch(&over, ne, t2, Operand(j));
1454 } 1454 }
1455 for (int i = j - 1; i >= 0; --i) { 1455 for (int i = j - 1; i >= 0; --i) {
1456 __ lw(t2, MemOperand(fp, StandardFrameConstants::kCallerSPOffset + 1456 __ ld(t2, MemOperand(fp, StandardFrameConstants::kCallerSPOffset +
1457 i * kPointerSize)); 1457 i * kPointerSize));
1458 __ push(t2); 1458 __ push(t2);
1459 } 1459 }
1460 for (int i = 0; i < 3 - j; ++i) { 1460 for (int i = 0; i < 3 - j; ++i) {
1461 __ PushRoot(Heap::kUndefinedValueRootIndex); 1461 __ PushRoot(Heap::kUndefinedValueRootIndex);
1462 } 1462 }
1463 if (j < 3) { 1463 if (j < 3) {
1464 __ jmp(&args_done); 1464 __ jmp(&args_done);
1465 __ bind(&over); 1465 __ bind(&over);
1466 } 1466 }
1467 } 1467 }
1468 __ bind(&args_done); 1468 __ bind(&args_done);
1469 1469
1470 // Call runtime, on success unwind frame, and parent frame. 1470 // Call runtime, on success unwind frame, and parent frame.
1471 __ CallRuntime(Runtime::kInstantiateAsmJs, 4); 1471 __ CallRuntime(Runtime::kInstantiateAsmJs, 4);
1472 // A smi 0 is returned on failure, an object on success. 1472 // A smi 0 is returned on failure, an object on success.
1473 __ JumpIfSmi(v0, &failed); 1473 __ JumpIfSmi(v0, &failed);
1474 1474
1475 __ Drop(2); 1475 __ Drop(2);
1476 __ pop(t2); 1476 __ pop(t2);
1477 __ SmiUntag(t2); 1477 __ SmiUntag(t2);
1478 scope.GenerateLeaveFrame(); 1478 scope.GenerateLeaveFrame();
1479 1479
1480 __ Addu(t2, t2, Operand(1)); 1480 __ Daddu(t2, t2, Operand(1));
1481 __ Lsa(sp, sp, t2, kPointerSizeLog2); 1481 __ Dlsa(sp, sp, t2, kPointerSizeLog2);
1482 __ Ret(); 1482 __ Ret();
1483 1483
1484 __ bind(&failed); 1484 __ bind(&failed);
1485 // Restore target function and new target. 1485 // Restore target function and new target.
1486 __ Pop(a0, a1, a3); 1486 __ Pop(a0, a1, a3);
1487 __ SmiUntag(a0); 1487 __ SmiUntag(a0);
1488 } 1488 }
1489 // On failure, tail call back to regular js. 1489 // On failure, tail call back to regular js.
1490 GenerateTailCallToReturnedCode(masm, Runtime::kCompileLazy); 1490 GenerateTailCallToReturnedCode(masm, Runtime::kCompileLazy);
1491 } 1491 }
(...skipping 1508 matching lines...) Expand 10 before | Expand all | Expand 10 after
3000 __ break_(0xCC); 3000 __ break_(0xCC);
3001 } 3001 }
3002 } 3002 }
3003 3003
3004 #undef __ 3004 #undef __
3005 3005
3006 } // namespace internal 3006 } // namespace internal
3007 } // namespace v8 3007 } // namespace v8
3008 3008
3009 #endif // V8_TARGET_ARCH_MIPS64 3009 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698