OLD | NEW |
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 #ifndef V8_IA32_MACRO_ASSEMBLER_IA32_H_ | 5 #ifndef V8_IA32_MACRO_ASSEMBLER_IA32_H_ |
6 #define V8_IA32_MACRO_ASSEMBLER_IA32_H_ | 6 #define V8_IA32_MACRO_ASSEMBLER_IA32_H_ |
7 | 7 |
8 #include "src/assembler.h" | 8 #include "src/assembler.h" |
9 #include "src/bailout-reason.h" | 9 #include "src/bailout-reason.h" |
10 #include "src/frames.h" | 10 #include "src/frames.h" |
(...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
605 void FastAllocate(Register object_size, Register result, Register result_end, | 605 void FastAllocate(Register object_size, Register result, Register result_end, |
606 AllocationFlags flags); | 606 AllocationFlags flags); |
607 | 607 |
608 // Allocate a heap number in new space with undefined value. The | 608 // Allocate a heap number in new space with undefined value. The |
609 // register scratch2 can be passed as no_reg; the others must be | 609 // register scratch2 can be passed as no_reg; the others must be |
610 // valid registers. Returns tagged pointer in result register, or | 610 // valid registers. Returns tagged pointer in result register, or |
611 // jumps to gc_required if new space is full. | 611 // jumps to gc_required if new space is full. |
612 void AllocateHeapNumber(Register result, Register scratch1, Register scratch2, | 612 void AllocateHeapNumber(Register result, Register scratch1, Register scratch2, |
613 Label* gc_required, MutableMode mode = IMMUTABLE); | 613 Label* gc_required, MutableMode mode = IMMUTABLE); |
614 | 614 |
615 // Allocate a sequential string. All the header fields of the string object | |
616 // are initialized. | |
617 void AllocateTwoByteString(Register result, Register length, | |
618 Register scratch1, Register scratch2, | |
619 Register scratch3, Label* gc_required); | |
620 void AllocateOneByteString(Register result, Register length, | |
621 Register scratch1, Register scratch2, | |
622 Register scratch3, Label* gc_required); | |
623 void AllocateOneByteString(Register result, int length, Register scratch1, | |
624 Register scratch2, Label* gc_required); | |
625 | |
626 // Allocate a raw cons string object. Only the map field of the result is | |
627 // initialized. | |
628 void AllocateTwoByteConsString(Register result, Register scratch1, | |
629 Register scratch2, Label* gc_required); | |
630 void AllocateOneByteConsString(Register result, Register scratch1, | |
631 Register scratch2, Label* gc_required); | |
632 | |
633 // Allocate a raw sliced string object. Only the map field of the result is | |
634 // initialized. | |
635 void AllocateTwoByteSlicedString(Register result, Register scratch1, | |
636 Register scratch2, Label* gc_required); | |
637 void AllocateOneByteSlicedString(Register result, Register scratch1, | |
638 Register scratch2, Label* gc_required); | |
639 | |
640 // Allocate and initialize a JSValue wrapper with the specified {constructor} | 615 // Allocate and initialize a JSValue wrapper with the specified {constructor} |
641 // and {value}. | 616 // and {value}. |
642 void AllocateJSValue(Register result, Register constructor, Register value, | 617 void AllocateJSValue(Register result, Register constructor, Register value, |
643 Register scratch, Label* gc_required); | 618 Register scratch, Label* gc_required); |
644 | 619 |
645 // Initialize fields with filler values. Fields starting at |current_address| | 620 // Initialize fields with filler values. Fields starting at |current_address| |
646 // not including |end_address| are overwritten with the value in |filler|. At | 621 // not including |end_address| are overwritten with the value in |filler|. At |
647 // the end the loop, |current_address| takes the value of |end_address|. | 622 // the end the loop, |current_address| takes the value of |end_address|. |
648 void InitializeFieldsWithFiller(Register current_address, | 623 void InitializeFieldsWithFiller(Register current_address, |
649 Register end_address, Register filler); | 624 Register end_address, Register filler); |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
854 // Verify restrictions about code generated in stubs. | 829 // Verify restrictions about code generated in stubs. |
855 void set_generating_stub(bool value) { generating_stub_ = value; } | 830 void set_generating_stub(bool value) { generating_stub_ = value; } |
856 bool generating_stub() { return generating_stub_; } | 831 bool generating_stub() { return generating_stub_; } |
857 void set_has_frame(bool value) { has_frame_ = value; } | 832 void set_has_frame(bool value) { has_frame_ = value; } |
858 bool has_frame() { return has_frame_; } | 833 bool has_frame() { return has_frame_; } |
859 inline bool AllowThisStubCall(CodeStub* stub); | 834 inline bool AllowThisStubCall(CodeStub* stub); |
860 | 835 |
861 // --------------------------------------------------------------------------- | 836 // --------------------------------------------------------------------------- |
862 // String utilities. | 837 // String utilities. |
863 | 838 |
864 // Check whether the instance type represents a flat one-byte string. Jump to | |
865 // the label if not. If the instance type can be scratched specify same | |
866 // register for both instance type and scratch. | |
867 void JumpIfInstanceTypeIsNotSequentialOneByte( | |
868 Register instance_type, Register scratch, | |
869 Label* on_not_flat_one_byte_string); | |
870 | |
871 // Checks if both objects are sequential one-byte strings, and jumps to label | 839 // Checks if both objects are sequential one-byte strings, and jumps to label |
872 // if either is not. | 840 // if either is not. |
873 void JumpIfNotBothSequentialOneByteStrings( | 841 void JumpIfNotBothSequentialOneByteStrings( |
874 Register object1, Register object2, Register scratch1, Register scratch2, | 842 Register object1, Register object2, Register scratch1, Register scratch2, |
875 Label* on_not_flat_one_byte_strings); | 843 Label* on_not_flat_one_byte_strings); |
876 | 844 |
877 // Checks if the given register or operand is a unique name | 845 // Checks if the given register or operand is a unique name |
878 void JumpIfNotUniqueNameInstanceType(Register reg, Label* not_unique_name, | 846 void JumpIfNotUniqueNameInstanceType(Register reg, Label* not_unique_name, |
879 Label::Distance distance = Label::kFar) { | 847 Label::Distance distance = Label::kFar) { |
880 JumpIfNotUniqueNameInstanceType(Operand(reg), not_unique_name, distance); | 848 JumpIfNotUniqueNameInstanceType(Operand(reg), not_unique_name, distance); |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1011 inline Operand NativeContextOperand() { | 979 inline Operand NativeContextOperand() { |
1012 return ContextOperand(esi, Context::NATIVE_CONTEXT_INDEX); | 980 return ContextOperand(esi, Context::NATIVE_CONTEXT_INDEX); |
1013 } | 981 } |
1014 | 982 |
1015 #define ACCESS_MASM(masm) masm-> | 983 #define ACCESS_MASM(masm) masm-> |
1016 | 984 |
1017 } // namespace internal | 985 } // namespace internal |
1018 } // namespace v8 | 986 } // namespace v8 |
1019 | 987 |
1020 #endif // V8_IA32_MACRO_ASSEMBLER_IA32_H_ | 988 #endif // V8_IA32_MACRO_ASSEMBLER_IA32_H_ |
OLD | NEW |