| 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 2010 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2021 EMIT(data); | 2021 EMIT(data); |
| 2022 } | 2022 } |
| 2023 | 2023 |
| 2024 | 2024 |
| 2025 void Assembler::dd(uint32_t data) { | 2025 void Assembler::dd(uint32_t data) { |
| 2026 EnsureSpace ensure_space(this); | 2026 EnsureSpace ensure_space(this); |
| 2027 emit(data); | 2027 emit(data); |
| 2028 } | 2028 } |
| 2029 | 2029 |
| 2030 | 2030 |
| 2031 void Assembler::dq(uint64_t data) { | |
| 2032 EnsureSpace ensure_space(this); | |
| 2033 emit_q(data); | |
| 2034 } | |
| 2035 | |
| 2036 | |
| 2037 void Assembler::dd(Label* label) { | 2031 void Assembler::dd(Label* label) { |
| 2038 EnsureSpace ensure_space(this); | 2032 EnsureSpace ensure_space(this); |
| 2039 RecordRelocInfo(RelocInfo::INTERNAL_REFERENCE); | 2033 RecordRelocInfo(RelocInfo::INTERNAL_REFERENCE); |
| 2040 emit_label(label); | 2034 emit_label(label); |
| 2041 } | 2035 } |
| 2042 | 2036 |
| 2043 | 2037 |
| 2044 void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data) { | 2038 void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data) { |
| 2045 DCHECK(!RelocInfo::IsNone(rmode)); | 2039 DCHECK(!RelocInfo::IsNone(rmode)); |
| 2046 // Don't record external references unless the heap will be serialized. | 2040 // Don't record external references unless the heap will be serialized. |
| 2047 if (rmode == RelocInfo::EXTERNAL_REFERENCE && | 2041 if (rmode == RelocInfo::EXTERNAL_REFERENCE && |
| 2048 !serializer_enabled() && !emit_debug_code()) { | 2042 !serializer_enabled() && !emit_debug_code()) { |
| 2049 return; | 2043 return; |
| 2050 } | 2044 } |
| 2051 RelocInfo rinfo(pc_, rmode, data, NULL); | 2045 RelocInfo rinfo(pc_, rmode, data, NULL); |
| 2052 reloc_info_writer.Write(&rinfo); | 2046 reloc_info_writer.Write(&rinfo); |
| 2053 } | 2047 } |
| 2054 | 2048 |
| 2055 | 2049 |
| 2050 Handle<ConstantPoolArray> Assembler::NewConstantPool(Isolate* isolate) { |
| 2051 // No out-of-line constant pool support. |
| 2052 DCHECK(!FLAG_enable_ool_constant_pool); |
| 2053 return isolate->factory()->empty_constant_pool_array(); |
| 2054 } |
| 2055 |
| 2056 |
| 2057 void Assembler::PopulateConstantPool(ConstantPoolArray* constant_pool) { |
| 2058 // No out-of-line constant pool support. |
| 2059 DCHECK(!FLAG_enable_ool_constant_pool); |
| 2060 return; |
| 2061 } |
| 2062 |
| 2063 |
| 2056 #ifdef GENERATED_CODE_COVERAGE | 2064 #ifdef GENERATED_CODE_COVERAGE |
| 2057 static FILE* coverage_log = NULL; | 2065 static FILE* coverage_log = NULL; |
| 2058 | 2066 |
| 2059 | 2067 |
| 2060 static void InitCoverageLog() { | 2068 static void InitCoverageLog() { |
| 2061 char* file_name = getenv("V8_GENERATED_CODE_COVERAGE_LOG"); | 2069 char* file_name = getenv("V8_GENERATED_CODE_COVERAGE_LOG"); |
| 2062 if (file_name != NULL) { | 2070 if (file_name != NULL) { |
| 2063 coverage_log = fopen(file_name, "aw+"); | 2071 coverage_log = fopen(file_name, "aw+"); |
| 2064 } | 2072 } |
| 2065 } | 2073 } |
| 2066 | 2074 |
| 2067 | 2075 |
| 2068 void LogGeneratedCodeCoverage(const char* file_line) { | 2076 void LogGeneratedCodeCoverage(const char* file_line) { |
| 2069 const char* return_address = (&file_line)[-1]; | 2077 const char* return_address = (&file_line)[-1]; |
| 2070 char* push_insn = const_cast<char*>(return_address - 12); | 2078 char* push_insn = const_cast<char*>(return_address - 12); |
| 2071 push_insn[0] = 0xeb; // Relative branch insn. | 2079 push_insn[0] = 0xeb; // Relative branch insn. |
| 2072 push_insn[1] = 13; // Skip over coverage insns. | 2080 push_insn[1] = 13; // Skip over coverage insns. |
| 2073 if (coverage_log != NULL) { | 2081 if (coverage_log != NULL) { |
| 2074 fprintf(coverage_log, "%s\n", file_line); | 2082 fprintf(coverage_log, "%s\n", file_line); |
| 2075 fflush(coverage_log); | 2083 fflush(coverage_log); |
| 2076 } | 2084 } |
| 2077 } | 2085 } |
| 2078 | 2086 |
| 2079 #endif | 2087 #endif |
| 2080 | 2088 |
| 2081 } // namespace internal | 2089 } // namespace internal |
| 2082 } // namespace v8 | 2090 } // namespace v8 |
| 2083 | 2091 |
| 2084 #endif // V8_TARGET_ARCH_X87 | 2092 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |