| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 // | 44 // |
| 45 // The programmer should know that the MacroAssembler may clobber these three, | 45 // The programmer should know that the MacroAssembler may clobber these three, |
| 46 // but won't touch other registers except in special cases. | 46 // but won't touch other registers except in special cases. |
| 47 // | 47 // |
| 48 // Per the MIPS ABI, register t9 must be used for indirect function call | 48 // Per the MIPS ABI, register t9 must be used for indirect function call |
| 49 // via 'jalr t9' or 'jr t9' instructions. This is relied upon by gcc when | 49 // via 'jalr t9' or 'jr t9' instructions. This is relied upon by gcc when |
| 50 // trying to update gp register for position-independent-code. Whenever | 50 // trying to update gp register for position-independent-code. Whenever |
| 51 // MIPS generated code calls C code, it must be via t9 register. | 51 // MIPS generated code calls C code, it must be via t9 register. |
| 52 | 52 |
| 53 | 53 |
| 54 // Flags used for LeaveExitFrame function. |
| 55 enum LeaveExitFrameMode { |
| 56 EMIT_RETURN = true, |
| 57 NO_EMIT_RETURN = false |
| 58 }; |
| 59 |
| 54 // Flags used for AllocateHeapNumber | 60 // Flags used for AllocateHeapNumber |
| 55 enum TaggingMode { | 61 enum TaggingMode { |
| 56 // Tag the result. | 62 // Tag the result. |
| 57 TAG_RESULT, | 63 TAG_RESULT, |
| 58 // Don't tag | 64 // Don't tag |
| 59 DONT_TAG_RESULT | 65 DONT_TAG_RESULT |
| 60 }; | 66 }; |
| 61 | 67 |
| 62 // Flags used for the ObjectToDoubleFPURegister function. | 68 // Flags used for the ObjectToDoubleFPURegister function. |
| 63 enum ObjectToDoubleFlags { | 69 enum ObjectToDoubleFlags { |
| (...skipping 777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 841 // Enter exit frame. | 847 // Enter exit frame. |
| 842 // argc - argument count to be dropped by LeaveExitFrame. | 848 // argc - argument count to be dropped by LeaveExitFrame. |
| 843 // save_doubles - saves FPU registers on stack, currently disabled. | 849 // save_doubles - saves FPU registers on stack, currently disabled. |
| 844 // stack_space - extra stack space. | 850 // stack_space - extra stack space. |
| 845 void EnterExitFrame(bool save_doubles, | 851 void EnterExitFrame(bool save_doubles, |
| 846 int stack_space = 0); | 852 int stack_space = 0); |
| 847 | 853 |
| 848 // Leave the current exit frame. | 854 // Leave the current exit frame. |
| 849 void LeaveExitFrame(bool save_doubles, | 855 void LeaveExitFrame(bool save_doubles, |
| 850 Register arg_count, | 856 Register arg_count, |
| 851 bool do_return = false); | 857 bool restore_context, |
| 858 bool do_return = NO_EMIT_RETURN); |
| 852 | 859 |
| 853 // Get the actual activation frame alignment for target environment. | 860 // Get the actual activation frame alignment for target environment. |
| 854 static int ActivationFrameAlignment(); | 861 static int ActivationFrameAlignment(); |
| 855 | 862 |
| 856 // Make sure the stack is aligned. Only emits code in debug mode. | 863 // Make sure the stack is aligned. Only emits code in debug mode. |
| 857 void AssertStackIsAligned(); | 864 void AssertStackIsAligned(); |
| 858 | 865 |
| 859 void LoadContext(Register dst, int context_chain_length); | 866 void LoadContext(Register dst, int context_chain_length); |
| 860 | 867 |
| 861 // Conditionally load the cached Array transitioned map of type | 868 // Conditionally load the cached Array transitioned map of type |
| (...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1264 | 1271 |
| 1265 // Calls an API function. Allocates HandleScope, extracts returned value | 1272 // Calls an API function. Allocates HandleScope, extracts returned value |
| 1266 // from handle and propagates exceptions. Restores context. stack_space | 1273 // from handle and propagates exceptions. Restores context. stack_space |
| 1267 // - space to be unwound on exit (includes the call JS arguments space and | 1274 // - space to be unwound on exit (includes the call JS arguments space and |
| 1268 // the additional space allocated for the fast call). | 1275 // the additional space allocated for the fast call). |
| 1269 void CallApiFunctionAndReturn(ExternalReference function, | 1276 void CallApiFunctionAndReturn(ExternalReference function, |
| 1270 Address function_address, | 1277 Address function_address, |
| 1271 ExternalReference thunk_ref, | 1278 ExternalReference thunk_ref, |
| 1272 Register thunk_last_arg, | 1279 Register thunk_last_arg, |
| 1273 int stack_space, | 1280 int stack_space, |
| 1274 int return_value_offset_from_fp); | 1281 MemOperand return_value_operand, |
| 1282 MemOperand* context_restore_operand); |
| 1275 | 1283 |
| 1276 // Jump to the builtin routine. | 1284 // Jump to the builtin routine. |
| 1277 void JumpToExternalReference(const ExternalReference& builtin, | 1285 void JumpToExternalReference(const ExternalReference& builtin, |
| 1278 BranchDelaySlot bd = PROTECT); | 1286 BranchDelaySlot bd = PROTECT); |
| 1279 | 1287 |
| 1280 // Invoke specified builtin JavaScript function. Adds an entry to | 1288 // Invoke specified builtin JavaScript function. Adds an entry to |
| 1281 // the unresolved list if the name does not resolve. | 1289 // the unresolved list if the name does not resolve. |
| 1282 void InvokeBuiltin(Builtins::JavaScript id, | 1290 void InvokeBuiltin(Builtins::JavaScript id, |
| 1283 InvokeFlag flag, | 1291 InvokeFlag flag, |
| 1284 const CallWrapper& call_wrapper = NullCallWrapper()); | 1292 const CallWrapper& call_wrapper = NullCallWrapper()); |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1412 // HeapNumber utilities. | 1420 // HeapNumber utilities. |
| 1413 | 1421 |
| 1414 void JumpIfNotHeapNumber(Register object, | 1422 void JumpIfNotHeapNumber(Register object, |
| 1415 Register heap_number_map, | 1423 Register heap_number_map, |
| 1416 Register scratch, | 1424 Register scratch, |
| 1417 Label* on_not_heap_number); | 1425 Label* on_not_heap_number); |
| 1418 | 1426 |
| 1419 // ------------------------------------------------------------------------- | 1427 // ------------------------------------------------------------------------- |
| 1420 // String utilities. | 1428 // String utilities. |
| 1421 | 1429 |
| 1430 // Generate code to do a lookup in the number string cache. If the number in |
| 1431 // the register object is found in the cache the generated code falls through |
| 1432 // with the result in the result register. The object and the result register |
| 1433 // can be the same. If the number is not found in the cache the code jumps to |
| 1434 // the label not_found with only the content of register object unchanged. |
| 1435 void LookupNumberStringCache(Register object, |
| 1436 Register result, |
| 1437 Register scratch1, |
| 1438 Register scratch2, |
| 1439 Register scratch3, |
| 1440 Label* not_found); |
| 1441 |
| 1422 // Checks if both instance types are sequential ASCII strings and jumps to | 1442 // Checks if both instance types are sequential ASCII strings and jumps to |
| 1423 // label if either is not. | 1443 // label if either is not. |
| 1424 void JumpIfBothInstanceTypesAreNotSequentialAscii( | 1444 void JumpIfBothInstanceTypesAreNotSequentialAscii( |
| 1425 Register first_object_instance_type, | 1445 Register first_object_instance_type, |
| 1426 Register second_object_instance_type, | 1446 Register second_object_instance_type, |
| 1427 Register scratch1, | 1447 Register scratch1, |
| 1428 Register scratch2, | 1448 Register scratch2, |
| 1429 Label* failure); | 1449 Label* failure); |
| 1430 | 1450 |
| 1431 // Check if instance type is sequential ASCII string and jump to label if | 1451 // Check if instance type is sequential ASCII string and jump to label if |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1615 #define CODE_COVERAGE_TOSTRING(x) CODE_COVERAGE_STRINGIFY(x) | 1635 #define CODE_COVERAGE_TOSTRING(x) CODE_COVERAGE_STRINGIFY(x) |
| 1616 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) | 1636 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) |
| 1617 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> | 1637 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> |
| 1618 #else | 1638 #else |
| 1619 #define ACCESS_MASM(masm) masm-> | 1639 #define ACCESS_MASM(masm) masm-> |
| 1620 #endif | 1640 #endif |
| 1621 | 1641 |
| 1622 } } // namespace v8::internal | 1642 } } // namespace v8::internal |
| 1623 | 1643 |
| 1624 #endif // V8_MIPS_MACRO_ASSEMBLER_MIPS_H_ | 1644 #endif // V8_MIPS_MACRO_ASSEMBLER_MIPS_H_ |
| OLD | NEW |