OLD | NEW |
1 // Copyright (c) 1994-2006 Sun Microsystems Inc. | 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. |
2 // All Rights Reserved. | 2 // All Rights Reserved. |
3 // | 3 // |
4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
5 // modification, are permitted provided that the following conditions | 5 // modification, are permitted provided that the following conditions |
6 // are met: | 6 // are met: |
7 // | 7 // |
8 // - Redistributions of source code must retain the above copyright notice, | 8 // - Redistributions of source code must retain the above copyright notice, |
9 // this list of conditions and the following disclaimer. | 9 // this list of conditions and the following disclaimer. |
10 // | 10 // |
(...skipping 2903 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2914 EMIT(data); | 2914 EMIT(data); |
2915 } | 2915 } |
2916 | 2916 |
2917 | 2917 |
2918 void Assembler::dd(uint32_t data) { | 2918 void Assembler::dd(uint32_t data) { |
2919 EnsureSpace ensure_space(this); | 2919 EnsureSpace ensure_space(this); |
2920 emit(data); | 2920 emit(data); |
2921 } | 2921 } |
2922 | 2922 |
2923 | 2923 |
2924 void Assembler::dq(uint64_t data) { | |
2925 EnsureSpace ensure_space(this); | |
2926 emit_q(data); | |
2927 } | |
2928 | |
2929 | |
2930 void Assembler::dd(Label* label) { | 2924 void Assembler::dd(Label* label) { |
2931 EnsureSpace ensure_space(this); | 2925 EnsureSpace ensure_space(this); |
2932 RecordRelocInfo(RelocInfo::INTERNAL_REFERENCE); | 2926 RecordRelocInfo(RelocInfo::INTERNAL_REFERENCE); |
2933 emit_label(label); | 2927 emit_label(label); |
2934 } | 2928 } |
2935 | 2929 |
2936 | 2930 |
2937 void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data) { | 2931 void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data) { |
2938 DCHECK(!RelocInfo::IsNone(rmode)); | 2932 DCHECK(!RelocInfo::IsNone(rmode)); |
2939 // Don't record external references unless the heap will be serialized. | 2933 // Don't record external references unless the heap will be serialized. |
2940 if (rmode == RelocInfo::EXTERNAL_REFERENCE && | 2934 if (rmode == RelocInfo::EXTERNAL_REFERENCE && |
2941 !serializer_enabled() && !emit_debug_code()) { | 2935 !serializer_enabled() && !emit_debug_code()) { |
2942 return; | 2936 return; |
2943 } | 2937 } |
2944 RelocInfo rinfo(pc_, rmode, data, NULL); | 2938 RelocInfo rinfo(pc_, rmode, data, NULL); |
2945 reloc_info_writer.Write(&rinfo); | 2939 reloc_info_writer.Write(&rinfo); |
2946 } | 2940 } |
2947 | 2941 |
2948 | 2942 |
| 2943 Handle<ConstantPoolArray> Assembler::NewConstantPool(Isolate* isolate) { |
| 2944 // No out-of-line constant pool support. |
| 2945 DCHECK(!FLAG_enable_ool_constant_pool); |
| 2946 return isolate->factory()->empty_constant_pool_array(); |
| 2947 } |
| 2948 |
| 2949 |
| 2950 void Assembler::PopulateConstantPool(ConstantPoolArray* constant_pool) { |
| 2951 // No out-of-line constant pool support. |
| 2952 DCHECK(!FLAG_enable_ool_constant_pool); |
| 2953 return; |
| 2954 } |
| 2955 |
| 2956 |
2949 #ifdef GENERATED_CODE_COVERAGE | 2957 #ifdef GENERATED_CODE_COVERAGE |
2950 static FILE* coverage_log = NULL; | 2958 static FILE* coverage_log = NULL; |
2951 | 2959 |
2952 | 2960 |
2953 static void InitCoverageLog() { | 2961 static void InitCoverageLog() { |
2954 char* file_name = getenv("V8_GENERATED_CODE_COVERAGE_LOG"); | 2962 char* file_name = getenv("V8_GENERATED_CODE_COVERAGE_LOG"); |
2955 if (file_name != NULL) { | 2963 if (file_name != NULL) { |
2956 coverage_log = fopen(file_name, "aw+"); | 2964 coverage_log = fopen(file_name, "aw+"); |
2957 } | 2965 } |
2958 } | 2966 } |
2959 | 2967 |
2960 | 2968 |
2961 void LogGeneratedCodeCoverage(const char* file_line) { | 2969 void LogGeneratedCodeCoverage(const char* file_line) { |
2962 const char* return_address = (&file_line)[-1]; | 2970 const char* return_address = (&file_line)[-1]; |
2963 char* push_insn = const_cast<char*>(return_address - 12); | 2971 char* push_insn = const_cast<char*>(return_address - 12); |
2964 push_insn[0] = 0xeb; // Relative branch insn. | 2972 push_insn[0] = 0xeb; // Relative branch insn. |
2965 push_insn[1] = 13; // Skip over coverage insns. | 2973 push_insn[1] = 13; // Skip over coverage insns. |
2966 if (coverage_log != NULL) { | 2974 if (coverage_log != NULL) { |
2967 fprintf(coverage_log, "%s\n", file_line); | 2975 fprintf(coverage_log, "%s\n", file_line); |
2968 fflush(coverage_log); | 2976 fflush(coverage_log); |
2969 } | 2977 } |
2970 } | 2978 } |
2971 | 2979 |
2972 #endif | 2980 #endif |
2973 | 2981 |
2974 } // namespace internal | 2982 } // namespace internal |
2975 } // namespace v8 | 2983 } // namespace v8 |
2976 | 2984 |
2977 #endif // V8_TARGET_ARCH_IA32 | 2985 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |