| 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 1927 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1938 | 1938 |
| 1939 // Some internal data structures overflow for very large buffers, | 1939 // Some internal data structures overflow for very large buffers, |
| 1940 // they must ensure that kMaximalBufferSize is not too large. | 1940 // they must ensure that kMaximalBufferSize is not too large. |
| 1941 if ((desc.buffer_size > kMaximalBufferSize) || | 1941 if ((desc.buffer_size > kMaximalBufferSize) || |
| 1942 (desc.buffer_size > isolate()->heap()->MaxOldGenerationSize())) { | 1942 (desc.buffer_size > isolate()->heap()->MaxOldGenerationSize())) { |
| 1943 V8::FatalProcessOutOfMemory("Assembler::GrowBuffer"); | 1943 V8::FatalProcessOutOfMemory("Assembler::GrowBuffer"); |
| 1944 } | 1944 } |
| 1945 | 1945 |
| 1946 // Set up new buffer. | 1946 // Set up new buffer. |
| 1947 desc.buffer = NewArray<byte>(desc.buffer_size); | 1947 desc.buffer = NewArray<byte>(desc.buffer_size); |
| 1948 desc.origin = this; |
| 1948 desc.instr_size = pc_offset(); | 1949 desc.instr_size = pc_offset(); |
| 1949 desc.reloc_size = (buffer_ + buffer_size_) - (reloc_info_writer.pos()); | 1950 desc.reloc_size = (buffer_ + buffer_size_) - (reloc_info_writer.pos()); |
| 1950 | 1951 |
| 1951 // Clear the buffer in debug mode. Use 'int3' instructions to make | 1952 // Clear the buffer in debug mode. Use 'int3' instructions to make |
| 1952 // sure to get into problems if we ever run uninitialized code. | 1953 // sure to get into problems if we ever run uninitialized code. |
| 1953 #ifdef DEBUG | 1954 #ifdef DEBUG |
| 1954 memset(desc.buffer, 0xCC, desc.buffer_size); | 1955 memset(desc.buffer, 0xCC, desc.buffer_size); |
| 1955 #endif | 1956 #endif |
| 1956 | 1957 |
| 1957 // Copy the data. | 1958 // Copy the data. |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2073 } | 2074 } |
| 2074 | 2075 |
| 2075 | 2076 |
| 2076 void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data) { | 2077 void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data) { |
| 2077 DCHECK(!RelocInfo::IsNone(rmode)); | 2078 DCHECK(!RelocInfo::IsNone(rmode)); |
| 2078 // Don't record external references unless the heap will be serialized. | 2079 // Don't record external references unless the heap will be serialized. |
| 2079 if (rmode == RelocInfo::EXTERNAL_REFERENCE && | 2080 if (rmode == RelocInfo::EXTERNAL_REFERENCE && |
| 2080 !serializer_enabled() && !emit_debug_code()) { | 2081 !serializer_enabled() && !emit_debug_code()) { |
| 2081 return; | 2082 return; |
| 2082 } | 2083 } |
| 2083 RelocInfo rinfo(pc_, rmode, data, NULL); | 2084 RelocInfo rinfo(isolate(), pc_, rmode, data, NULL); |
| 2084 reloc_info_writer.Write(&rinfo); | 2085 reloc_info_writer.Write(&rinfo); |
| 2085 } | 2086 } |
| 2086 | 2087 |
| 2087 | 2088 |
| 2088 #ifdef GENERATED_CODE_COVERAGE | 2089 #ifdef GENERATED_CODE_COVERAGE |
| 2089 static FILE* coverage_log = NULL; | 2090 static FILE* coverage_log = NULL; |
| 2090 | 2091 |
| 2091 | 2092 |
| 2092 static void InitCoverageLog() { | 2093 static void InitCoverageLog() { |
| 2093 char* file_name = getenv("V8_GENERATED_CODE_COVERAGE_LOG"); | 2094 char* file_name = getenv("V8_GENERATED_CODE_COVERAGE_LOG"); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 2107 fflush(coverage_log); | 2108 fflush(coverage_log); |
| 2108 } | 2109 } |
| 2109 } | 2110 } |
| 2110 | 2111 |
| 2111 #endif | 2112 #endif |
| 2112 | 2113 |
| 2113 } // namespace internal | 2114 } // namespace internal |
| 2114 } // namespace v8 | 2115 } // namespace v8 |
| 2115 | 2116 |
| 2116 #endif // V8_TARGET_ARCH_X87 | 2117 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |