| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 void InitializeRootRegister() { | 335 void InitializeRootRegister() { |
| 336 ExternalReference roots_array_start = | 336 ExternalReference roots_array_start = |
| 337 ExternalReference::roots_array_start(isolate()); | 337 ExternalReference::roots_array_start(isolate()); |
| 338 Move(kRootRegister, roots_array_start); | 338 Move(kRootRegister, roots_array_start); |
| 339 addq(kRootRegister, Immediate(kRootRegisterBias)); | 339 addq(kRootRegister, Immediate(kRootRegisterBias)); |
| 340 } | 340 } |
| 341 | 341 |
| 342 // --------------------------------------------------------------------------- | 342 // --------------------------------------------------------------------------- |
| 343 // JavaScript invokes | 343 // JavaScript invokes |
| 344 | 344 |
| 345 // Set up call kind marking in rcx. The method takes rcx as an | |
| 346 // explicit first parameter to make the code more readable at the | |
| 347 // call sites. | |
| 348 void SetCallKind(Register dst, CallKind kind); | |
| 349 | |
| 350 // Invoke the JavaScript function code by either calling or jumping. | 345 // Invoke the JavaScript function code by either calling or jumping. |
| 351 void InvokeCode(Register code, | 346 void InvokeCode(Register code, |
| 352 const ParameterCount& expected, | 347 const ParameterCount& expected, |
| 353 const ParameterCount& actual, | 348 const ParameterCount& actual, |
| 354 InvokeFlag flag, | 349 InvokeFlag flag, |
| 355 const CallWrapper& call_wrapper, | 350 const CallWrapper& call_wrapper); |
| 356 CallKind call_kind); | |
| 357 | 351 |
| 358 void InvokeCode(Handle<Code> code, | 352 void InvokeCode(Handle<Code> code, |
| 359 const ParameterCount& expected, | 353 const ParameterCount& expected, |
| 360 const ParameterCount& actual, | 354 const ParameterCount& actual, |
| 361 RelocInfo::Mode rmode, | 355 RelocInfo::Mode rmode, |
| 362 InvokeFlag flag, | 356 InvokeFlag flag, |
| 363 const CallWrapper& call_wrapper, | 357 const CallWrapper& call_wrapper); |
| 364 CallKind call_kind); | |
| 365 | 358 |
| 366 // Invoke the JavaScript function in the given register. Changes the | 359 // Invoke the JavaScript function in the given register. Changes the |
| 367 // current context to the context in the function before invoking. | 360 // current context to the context in the function before invoking. |
| 368 void InvokeFunction(Register function, | 361 void InvokeFunction(Register function, |
| 369 const ParameterCount& actual, | 362 const ParameterCount& actual, |
| 370 InvokeFlag flag, | 363 InvokeFlag flag, |
| 371 const CallWrapper& call_wrapper, | 364 const CallWrapper& call_wrapper); |
| 372 CallKind call_kind); | |
| 373 | 365 |
| 374 void InvokeFunction(Register function, | 366 void InvokeFunction(Register function, |
| 375 const ParameterCount& expected, | 367 const ParameterCount& expected, |
| 376 const ParameterCount& actual, | 368 const ParameterCount& actual, |
| 377 InvokeFlag flag, | 369 InvokeFlag flag, |
| 378 const CallWrapper& call_wrapper, | 370 const CallWrapper& call_wrapper); |
| 379 CallKind call_kind); | |
| 380 | 371 |
| 381 void InvokeFunction(Handle<JSFunction> function, | 372 void InvokeFunction(Handle<JSFunction> function, |
| 382 const ParameterCount& expected, | 373 const ParameterCount& expected, |
| 383 const ParameterCount& actual, | 374 const ParameterCount& actual, |
| 384 InvokeFlag flag, | 375 InvokeFlag flag, |
| 385 const CallWrapper& call_wrapper, | 376 const CallWrapper& call_wrapper); |
| 386 CallKind call_kind); | |
| 387 | 377 |
| 388 // Invoke specified builtin JavaScript function. Adds an entry to | 378 // Invoke specified builtin JavaScript function. Adds an entry to |
| 389 // the unresolved list if the name does not resolve. | 379 // the unresolved list if the name does not resolve. |
| 390 void InvokeBuiltin(Builtins::JavaScript id, | 380 void InvokeBuiltin(Builtins::JavaScript id, |
| 391 InvokeFlag flag, | 381 InvokeFlag flag, |
| 392 const CallWrapper& call_wrapper = NullCallWrapper()); | 382 const CallWrapper& call_wrapper = NullCallWrapper()); |
| 393 | 383 |
| 394 // Store the function for the given builtin in the target register. | 384 // Store the function for the given builtin in the target register. |
| 395 void GetBuiltinFunction(Register target, Builtins::JavaScript id); | 385 void GetBuiltinFunction(Register target, Builtins::JavaScript id); |
| 396 | 386 |
| (...skipping 1086 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1483 | 1473 |
| 1484 // Helper functions for generating invokes. | 1474 // Helper functions for generating invokes. |
| 1485 void InvokePrologue(const ParameterCount& expected, | 1475 void InvokePrologue(const ParameterCount& expected, |
| 1486 const ParameterCount& actual, | 1476 const ParameterCount& actual, |
| 1487 Handle<Code> code_constant, | 1477 Handle<Code> code_constant, |
| 1488 Register code_register, | 1478 Register code_register, |
| 1489 Label* done, | 1479 Label* done, |
| 1490 bool* definitely_mismatches, | 1480 bool* definitely_mismatches, |
| 1491 InvokeFlag flag, | 1481 InvokeFlag flag, |
| 1492 Label::Distance near_jump = Label::kFar, | 1482 Label::Distance near_jump = Label::kFar, |
| 1493 const CallWrapper& call_wrapper = NullCallWrapper(), | 1483 const CallWrapper& call_wrapper = NullCallWrapper()); |
| 1494 CallKind call_kind = CALL_AS_METHOD); | |
| 1495 | 1484 |
| 1496 void EnterExitFramePrologue(bool save_rax); | 1485 void EnterExitFramePrologue(bool save_rax); |
| 1497 | 1486 |
| 1498 // Allocates arg_stack_space * kPointerSize memory (not GCed) on the stack | 1487 // Allocates arg_stack_space * kPointerSize memory (not GCed) on the stack |
| 1499 // accessible via StackSpaceOperand. | 1488 // accessible via StackSpaceOperand. |
| 1500 void EnterExitFrameEpilogue(int arg_stack_space, bool save_doubles); | 1489 void EnterExitFrameEpilogue(int arg_stack_space, bool save_doubles); |
| 1501 | 1490 |
| 1502 void LeaveExitFrameEpilogue(bool restore_context); | 1491 void LeaveExitFrameEpilogue(bool restore_context); |
| 1503 | 1492 |
| 1504 // Allocation support helpers. | 1493 // Allocation support helpers. |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1633 masm->popfq(); \ | 1622 masm->popfq(); \ |
| 1634 } \ | 1623 } \ |
| 1635 masm-> | 1624 masm-> |
| 1636 #else | 1625 #else |
| 1637 #define ACCESS_MASM(masm) masm-> | 1626 #define ACCESS_MASM(masm) masm-> |
| 1638 #endif | 1627 #endif |
| 1639 | 1628 |
| 1640 } } // namespace v8::internal | 1629 } } // namespace v8::internal |
| 1641 | 1630 |
| 1642 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ | 1631 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ |
| OLD | NEW |