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

Side by Side Diff: src/compiler/arm64/code-generator-arm64.cc

Issue 1205023002: [turbofan] Add basic support for calling to (a subset of) C functions. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix argument slots. Created 5 years, 6 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
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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 #include "src/compiler/code-generator.h" 5 #include "src/compiler/code-generator.h"
6 6
7 #include "src/arm64/macro-assembler-arm64.h" 7 #include "src/arm64/macro-assembler-arm64.h"
8 #include "src/compiler/code-generator-impl.h" 8 #include "src/compiler/code-generator-impl.h"
9 #include "src/compiler/gap-resolver.h" 9 #include "src/compiler/gap-resolver.h"
10 #include "src/compiler/node-matchers.h" 10 #include "src/compiler/node-matchers.h"
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 Register temp = scope.AcquireX(); 413 Register temp = scope.AcquireX();
414 __ Ldr(temp, FieldMemOperand(func, JSFunction::kContextOffset)); 414 __ Ldr(temp, FieldMemOperand(func, JSFunction::kContextOffset));
415 __ cmp(cp, temp); 415 __ cmp(cp, temp);
416 __ Assert(eq, kWrongFunctionContext); 416 __ Assert(eq, kWrongFunctionContext);
417 } 417 }
418 AssembleDeconstructActivationRecord(); 418 AssembleDeconstructActivationRecord();
419 __ Ldr(x10, FieldMemOperand(func, JSFunction::kCodeEntryOffset)); 419 __ Ldr(x10, FieldMemOperand(func, JSFunction::kCodeEntryOffset));
420 __ Jump(x10); 420 __ Jump(x10);
421 break; 421 break;
422 } 422 }
423 case kArchPrepareCallCFunction:
424 // We don't need kArchPrepareCallCFunction on arm64 as the instruction
425 // selector already perform a Claim to reserve space on the stack and
426 // guarantee correct alignment of stack pointer.
427 UNREACHABLE();
428 break;
429 case kArchCallCFunction: {
430 int const num_parameters = MiscField::decode(instr->opcode());
431 if (instr->InputAt(0)->IsImmediate()) {
432 ExternalReference ref = i.InputExternalReference(0);
433 __ CallCFunction(ref, num_parameters, 0);
434 } else {
435 Register func = i.InputRegister(0);
436 __ CallCFunction(func, num_parameters, 0);
437 }
438 break;
439 }
423 case kArchJmp: 440 case kArchJmp:
424 AssembleArchJump(i.InputRpo(0)); 441 AssembleArchJump(i.InputRpo(0));
425 break; 442 break;
426 case kArchTableSwitch: 443 case kArchTableSwitch:
427 AssembleArchTableSwitch(instr); 444 AssembleArchTableSwitch(instr);
428 break; 445 break;
429 case kArchLookupSwitch: 446 case kArchLookupSwitch:
430 AssembleArchLookupSwitch(instr); 447 AssembleArchLookupSwitch(instr);
431 break; 448 break;
432 case kArchNop: 449 case kArchNop:
(...skipping 896 matching lines...) Expand 10 before | Expand all | Expand 10 after
1329 } 1346 }
1330 } 1347 }
1331 } 1348 }
1332 } 1349 }
1333 1350
1334 #undef __ 1351 #undef __
1335 1352
1336 } // namespace compiler 1353 } // namespace compiler
1337 } // namespace internal 1354 } // namespace internal
1338 } // namespace v8 1355 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698