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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 __ pop(ebx); | 115 __ pop(ebx); |
116 __ pop(ecx); | 116 __ pop(ecx); |
117 __ popfd(); | 117 __ popfd(); |
118 __ pop(ebp); | 118 __ pop(ebp); |
119 __ ret(0); | 119 __ ret(0); |
120 #undef __ | 120 #undef __ |
121 | 121 |
122 CodeDesc desc; | 122 CodeDesc desc; |
123 assm.GetCode(&desc); | 123 assm.GetCode(&desc); |
124 Object* code; | 124 Object* code; |
125 { MaybeObject* maybe_code = HEAP->CreateCode(desc, | 125 { MaybeObject* maybe_code = |
126 Code::ComputeFlags(Code::STUB), | 126 assm.isolate()->heap()->CreateCode(desc, |
127 Handle<Code>::null()); | 127 Code::ComputeFlags(Code::STUB), |
| 128 Handle<Code>::null()); |
128 if (!maybe_code->ToObject(&code)) return; | 129 if (!maybe_code->ToObject(&code)) return; |
129 } | 130 } |
130 if (!code->IsCode()) return; | 131 if (!code->IsCode()) return; |
131 | 132 |
132 PROFILE(ISOLATE, | 133 PROFILE(ISOLATE, |
133 CodeCreateEvent(Logger::BUILTIN_TAG, | 134 CodeCreateEvent(Logger::BUILTIN_TAG, |
134 Code::cast(code), "CpuFeatures::Probe")); | 135 Code::cast(code), "CpuFeatures::Probe")); |
135 typedef uint64_t (*F0)(); | 136 typedef uint64_t (*F0)(); |
136 F0 probe = FUNCTION_CAST<F0>(Code::cast(code)->entry()); | 137 F0 probe = FUNCTION_CAST<F0>(Code::cast(code)->entry()); |
137 supported_ = probe(); | 138 supported_ = probe(); |
(...skipping 2527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2665 // Compute new buffer size. | 2666 // Compute new buffer size. |
2666 CodeDesc desc; // the new buffer | 2667 CodeDesc desc; // the new buffer |
2667 if (buffer_size_ < 4*KB) { | 2668 if (buffer_size_ < 4*KB) { |
2668 desc.buffer_size = 4*KB; | 2669 desc.buffer_size = 4*KB; |
2669 } else { | 2670 } else { |
2670 desc.buffer_size = 2*buffer_size_; | 2671 desc.buffer_size = 2*buffer_size_; |
2671 } | 2672 } |
2672 // Some internal data structures overflow for very large buffers, | 2673 // Some internal data structures overflow for very large buffers, |
2673 // they must ensure that kMaximalBufferSize is not too large. | 2674 // they must ensure that kMaximalBufferSize is not too large. |
2674 if ((desc.buffer_size > kMaximalBufferSize) || | 2675 if ((desc.buffer_size > kMaximalBufferSize) || |
2675 (desc.buffer_size > HEAP->MaxOldGenerationSize())) { | 2676 (desc.buffer_size > isolate()->heap()->MaxOldGenerationSize())) { |
2676 V8::FatalProcessOutOfMemory("Assembler::GrowBuffer"); | 2677 V8::FatalProcessOutOfMemory("Assembler::GrowBuffer"); |
2677 } | 2678 } |
2678 | 2679 |
2679 // Setup new buffer. | 2680 // Setup new buffer. |
2680 desc.buffer = NewArray<byte>(desc.buffer_size); | 2681 desc.buffer = NewArray<byte>(desc.buffer_size); |
2681 desc.instr_size = pc_offset(); | 2682 desc.instr_size = pc_offset(); |
2682 desc.reloc_size = (buffer_ + buffer_size_) - (reloc_info_writer.pos()); | 2683 desc.reloc_size = (buffer_ + buffer_size_) - (reloc_info_writer.pos()); |
2683 | 2684 |
2684 // Clear the buffer in debug mode. Use 'int3' instructions to make | 2685 // Clear the buffer in debug mode. Use 'int3' instructions to make |
2685 // sure to get into problems if we ever run uninitialized code. | 2686 // sure to get into problems if we ever run uninitialized code. |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2835 fprintf(coverage_log, "%s\n", file_line); | 2836 fprintf(coverage_log, "%s\n", file_line); |
2836 fflush(coverage_log); | 2837 fflush(coverage_log); |
2837 } | 2838 } |
2838 } | 2839 } |
2839 | 2840 |
2840 #endif | 2841 #endif |
2841 | 2842 |
2842 } } // namespace v8::internal | 2843 } } // namespace v8::internal |
2843 | 2844 |
2844 #endif // V8_TARGET_ARCH_IA32 | 2845 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |