OLD | NEW |
1 // Copyright 2011 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 |
11 // with the distribution. | 11 // with the distribution. |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 | 45 |
46 | 46 |
47 inline Operand SmiUntagOperand(Register object) { | 47 inline Operand SmiUntagOperand(Register object) { |
48 return Operand(object, ASR, kSmiTagSize); | 48 return Operand(object, ASR, kSmiTagSize); |
49 } | 49 } |
50 | 50 |
51 | 51 |
52 | 52 |
53 // Give alias names to registers | 53 // Give alias names to registers |
54 const Register cp = { 8 }; // JavaScript context pointer | 54 const Register cp = { 8 }; // JavaScript context pointer |
55 const Register roots = { 10 }; // Roots array pointer. | 55 const Register kRootRegister = { 10 }; // Roots array pointer. |
56 | 56 |
57 // Flags used for the AllocateInNewSpace functions. | 57 // Flags used for the AllocateInNewSpace functions. |
58 enum AllocationFlags { | 58 enum AllocationFlags { |
59 // No special flags. | 59 // No special flags. |
60 NO_ALLOCATION_FLAGS = 0, | 60 NO_ALLOCATION_FLAGS = 0, |
61 // Return the pointer to the allocated already tagged as a heap object. | 61 // Return the pointer to the allocated already tagged as a heap object. |
62 TAG_OBJECT = 1 << 0, | 62 TAG_OBJECT = 1 << 0, |
63 // The content of the result register already contains the allocation top in | 63 // The content of the result register already contains the allocation top in |
64 // new space. | 64 // new space. |
65 RESULT_CONTAINS_TOP = 1 << 1, | 65 RESULT_CONTAINS_TOP = 1 << 1, |
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
492 void LoadContext(Register dst, int context_chain_length); | 492 void LoadContext(Register dst, int context_chain_length); |
493 | 493 |
494 void LoadGlobalFunction(int index, Register function); | 494 void LoadGlobalFunction(int index, Register function); |
495 | 495 |
496 // Load the initial map from the global function. The registers | 496 // Load the initial map from the global function. The registers |
497 // function and map can be the same, function is then overwritten. | 497 // function and map can be the same, function is then overwritten. |
498 void LoadGlobalFunctionInitialMap(Register function, | 498 void LoadGlobalFunctionInitialMap(Register function, |
499 Register map, | 499 Register map, |
500 Register scratch); | 500 Register scratch); |
501 | 501 |
| 502 void InitializeRootRegister() { |
| 503 ExternalReference roots_array_start = |
| 504 ExternalReference::roots_array_start(isolate()); |
| 505 mov(kRootRegister, Operand(roots_array_start)); |
| 506 } |
| 507 |
502 // --------------------------------------------------------------------------- | 508 // --------------------------------------------------------------------------- |
503 // JavaScript invokes | 509 // JavaScript invokes |
504 | 510 |
505 // Setup call kind marking in ecx. The method takes ecx as an | 511 // Set up call kind marking in ecx. The method takes ecx as an |
506 // explicit first parameter to make the code more readable at the | 512 // explicit first parameter to make the code more readable at the |
507 // call sites. | 513 // call sites. |
508 void SetCallKind(Register dst, CallKind kind); | 514 void SetCallKind(Register dst, CallKind kind); |
509 | 515 |
510 // Invoke the JavaScript function code by either calling or jumping. | 516 // Invoke the JavaScript function code by either calling or jumping. |
511 void InvokeCode(Register code, | 517 void InvokeCode(Register code, |
512 const ParameterCount& expected, | 518 const ParameterCount& expected, |
513 const ParameterCount& actual, | 519 const ParameterCount& actual, |
514 InvokeFlag flag, | 520 InvokeFlag flag, |
515 const CallWrapper& call_wrapper, | 521 const CallWrapper& call_wrapper, |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
577 // --------------------------------------------------------------------------- | 583 // --------------------------------------------------------------------------- |
578 // Inline caching support | 584 // Inline caching support |
579 | 585 |
580 // Generate code for checking access rights - used for security checks | 586 // Generate code for checking access rights - used for security checks |
581 // on access to global objects across environments. The holder register | 587 // on access to global objects across environments. The holder register |
582 // is left untouched, whereas both scratch registers are clobbered. | 588 // is left untouched, whereas both scratch registers are clobbered. |
583 void CheckAccessGlobalProxy(Register holder_reg, | 589 void CheckAccessGlobalProxy(Register holder_reg, |
584 Register scratch, | 590 Register scratch, |
585 Label* miss); | 591 Label* miss); |
586 | 592 |
| 593 void GetNumberHash(Register t0, Register scratch); |
587 | 594 |
588 void LoadFromNumberDictionary(Label* miss, | 595 void LoadFromNumberDictionary(Label* miss, |
589 Register elements, | 596 Register elements, |
590 Register key, | 597 Register key, |
591 Register result, | 598 Register result, |
592 Register t0, | 599 Register t0, |
593 Register t1, | 600 Register t1, |
594 Register t2); | 601 Register t2); |
595 | 602 |
596 | 603 |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
783 void StoreNumberToDoubleElements(Register value_reg, | 790 void StoreNumberToDoubleElements(Register value_reg, |
784 Register key_reg, | 791 Register key_reg, |
785 Register receiver_reg, | 792 Register receiver_reg, |
786 Register elements_reg, | 793 Register elements_reg, |
787 Register scratch1, | 794 Register scratch1, |
788 Register scratch2, | 795 Register scratch2, |
789 Register scratch3, | 796 Register scratch3, |
790 Register scratch4, | 797 Register scratch4, |
791 Label* fail); | 798 Label* fail); |
792 | 799 |
793 // Check if the map of an object is equal to a specified map (either | 800 // Compare an object's map with the specified map and its transitioned |
794 // given directly or as an index into the root list) and branch to | 801 // elements maps if mode is ALLOW_ELEMENT_TRANSITION_MAPS. Condition flags are |
795 // label if not. Skip the smi check if not required (object is known | 802 // set with result of map compare. If multiple map compares are required, the |
796 // to be a heap object) | 803 // compare sequences branches to early_success. |
| 804 void CompareMap(Register obj, |
| 805 Register scratch, |
| 806 Handle<Map> map, |
| 807 Label* early_success, |
| 808 CompareMapMode mode = REQUIRE_EXACT_MAP); |
| 809 |
| 810 // Check if the map of an object is equal to a specified map and branch to |
| 811 // label if not. Skip the smi check if not required (object is known to be a |
| 812 // heap object). If mode is ALLOW_ELEMENT_TRANSITION_MAPS, then also match |
| 813 // against maps that are ElementsKind transition maps of the specificed map. |
797 void CheckMap(Register obj, | 814 void CheckMap(Register obj, |
798 Register scratch, | 815 Register scratch, |
799 Handle<Map> map, | 816 Handle<Map> map, |
800 Label* fail, | 817 Label* fail, |
801 SmiCheckType smi_check_type); | 818 SmiCheckType smi_check_type, |
| 819 CompareMapMode mode = REQUIRE_EXACT_MAP); |
802 | 820 |
803 | 821 |
804 void CheckMap(Register obj, | 822 void CheckMap(Register obj, |
805 Register scratch, | 823 Register scratch, |
806 Heap::RootListIndex index, | 824 Heap::RootListIndex index, |
807 Label* fail, | 825 Label* fail, |
808 SmiCheckType smi_check_type); | 826 SmiCheckType smi_check_type); |
809 | 827 |
810 | 828 |
811 // Check if the map of an object is equal to a specified map and branch to a | 829 // Check if the map of an object is equal to a specified map and branch to a |
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1326 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) | 1344 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) |
1327 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> | 1345 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> |
1328 #else | 1346 #else |
1329 #define ACCESS_MASM(masm) masm-> | 1347 #define ACCESS_MASM(masm) masm-> |
1330 #endif | 1348 #endif |
1331 | 1349 |
1332 | 1350 |
1333 } } // namespace v8::internal | 1351 } } // namespace v8::internal |
1334 | 1352 |
1335 #endif // V8_ARM_MACRO_ASSEMBLER_ARM_H_ | 1353 #endif // V8_ARM_MACRO_ASSEMBLER_ARM_H_ |
OLD | NEW |