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 #include "v8.h" | 5 #include "v8.h" |
6 | 6 |
7 #include "bootstrapper.h" | 7 #include "bootstrapper.h" |
8 #include "codegen.h" | 8 #include "codegen.h" |
9 #include "compiler.h" | 9 #include "compiler.h" |
10 #include "cpu-profiler.h" | 10 #include "cpu-profiler.h" |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 } else { | 158 } else { |
159 code->Disassemble(function->debug_name()->ToCString().get(), | 159 code->Disassemble(function->debug_name()->ToCString().get(), |
160 tracing_scope.file()); | 160 tracing_scope.file()); |
161 } | 161 } |
162 PrintF(tracing_scope.file(), "--- End code ---\n"); | 162 PrintF(tracing_scope.file(), "--- End code ---\n"); |
163 } | 163 } |
164 #endif // ENABLE_DISASSEMBLER | 164 #endif // ENABLE_DISASSEMBLER |
165 } | 165 } |
166 | 166 |
167 | 167 |
168 bool CodeGenerator::ShouldGenerateLog(Isolate* isolate, Expression* type) { | |
169 ASSERT(type != NULL); | |
170 if (!isolate->logger()->is_logging() && | |
171 !isolate->cpu_profiler()->is_profiling()) { | |
172 return false; | |
173 } | |
174 Handle<String> name = Handle<String>::cast(type->AsLiteral()->value()); | |
175 if (FLAG_log_regexp) { | |
176 if (name->IsOneByteEqualTo(STATIC_ASCII_VECTOR("regexp"))) | |
177 return true; | |
178 } | |
179 return false; | |
180 } | |
181 | |
182 | |
183 bool CodeGenerator::RecordPositions(MacroAssembler* masm, | 168 bool CodeGenerator::RecordPositions(MacroAssembler* masm, |
184 int pos, | 169 int pos, |
185 bool right_here) { | 170 bool right_here) { |
186 if (pos != RelocInfo::kNoPosition) { | 171 if (pos != RelocInfo::kNoPosition) { |
187 masm->positions_recorder()->RecordStatementPosition(pos); | 172 masm->positions_recorder()->RecordStatementPosition(pos); |
188 masm->positions_recorder()->RecordPosition(pos); | 173 masm->positions_recorder()->RecordPosition(pos); |
189 if (right_here) { | 174 if (right_here) { |
190 return masm->positions_recorder()->WriteRecordedPositions(); | 175 return masm->positions_recorder()->WriteRecordedPositions(); |
191 } | 176 } |
192 } | 177 } |
(...skipping 24 matching lines...) Expand all Loading... |
217 ASSERT(result_size_ == 1 || result_size_ == 2); | 202 ASSERT(result_size_ == 1 || result_size_ == 2); |
218 #ifdef _WIN64 | 203 #ifdef _WIN64 |
219 return result | ((result_size_ == 1) ? 0 : 2); | 204 return result | ((result_size_ == 1) ? 0 : 2); |
220 #else | 205 #else |
221 return result; | 206 return result; |
222 #endif | 207 #endif |
223 } | 208 } |
224 | 209 |
225 | 210 |
226 } } // namespace v8::internal | 211 } } // namespace v8::internal |
OLD | NEW |