| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 } | 162 } |
| 163 PrintF("--- Optimized code ---\n"); | 163 PrintF("--- Optimized code ---\n"); |
| 164 } else { | 164 } else { |
| 165 PrintF("--- Code ---\n"); | 165 PrintF("--- Code ---\n"); |
| 166 } | 166 } |
| 167 code->Disassemble(*function->debug_name()->ToCString()); | 167 code->Disassemble(*function->debug_name()->ToCString()); |
| 168 } | 168 } |
| 169 #endif // ENABLE_DISASSEMBLER | 169 #endif // ENABLE_DISASSEMBLER |
| 170 } | 170 } |
| 171 | 171 |
| 172 #ifdef ENABLE_LOGGING_AND_PROFILING | |
| 173 | |
| 174 static Vector<const char> kRegexp = CStrVector("regexp"); | 172 static Vector<const char> kRegexp = CStrVector("regexp"); |
| 175 | 173 |
| 176 bool CodeGenerator::ShouldGenerateLog(Expression* type) { | 174 bool CodeGenerator::ShouldGenerateLog(Expression* type) { |
| 177 ASSERT(type != NULL); | 175 ASSERT(type != NULL); |
| 178 Isolate* isolate = Isolate::Current(); | 176 Isolate* isolate = Isolate::Current(); |
| 179 if (!isolate->logger()->is_logging() && !CpuProfiler::is_profiling(isolate)) { | 177 if (!isolate->logger()->is_logging() && !CpuProfiler::is_profiling(isolate)) { |
| 180 return false; | 178 return false; |
| 181 } | 179 } |
| 182 Handle<String> name = Handle<String>::cast(type->AsLiteral()->handle()); | 180 Handle<String> name = Handle<String>::cast(type->AsLiteral()->handle()); |
| 183 if (FLAG_log_regexp) { | 181 if (FLAG_log_regexp) { |
| 184 if (name->IsEqualTo(kRegexp)) | 182 if (name->IsEqualTo(kRegexp)) |
| 185 return true; | 183 return true; |
| 186 } | 184 } |
| 187 return false; | 185 return false; |
| 188 } | 186 } |
| 189 | 187 |
| 190 #endif | |
| 191 | |
| 192 | 188 |
| 193 bool CodeGenerator::RecordPositions(MacroAssembler* masm, | 189 bool CodeGenerator::RecordPositions(MacroAssembler* masm, |
| 194 int pos, | 190 int pos, |
| 195 bool right_here) { | 191 bool right_here) { |
| 196 if (pos != RelocInfo::kNoPosition) { | 192 if (pos != RelocInfo::kNoPosition) { |
| 197 masm->positions_recorder()->RecordStatementPosition(pos); | 193 masm->positions_recorder()->RecordStatementPosition(pos); |
| 198 masm->positions_recorder()->RecordPosition(pos); | 194 masm->positions_recorder()->RecordPosition(pos); |
| 199 if (right_here) { | 195 if (right_here) { |
| 200 return masm->positions_recorder()->WriteRecordedPositions(); | 196 return masm->positions_recorder()->WriteRecordedPositions(); |
| 201 } | 197 } |
| (...skipping 25 matching lines...) Expand all Loading... |
| 227 int result = save_doubles_ ? 1 : 0; | 223 int result = save_doubles_ ? 1 : 0; |
| 228 #ifdef _WIN64 | 224 #ifdef _WIN64 |
| 229 return result | ((result_size_ == 1) ? 0 : 2); | 225 return result | ((result_size_ == 1) ? 0 : 2); |
| 230 #else | 226 #else |
| 231 return result; | 227 return result; |
| 232 #endif | 228 #endif |
| 233 } | 229 } |
| 234 | 230 |
| 235 | 231 |
| 236 } } // namespace v8::internal | 232 } } // namespace v8::internal |
| OLD | NEW |