| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 stream.Seek(function->start_position()); | 205 stream.Seek(function->start_position()); |
| 206 // fun->end_position() points to the last character in the stream. We | 206 // fun->end_position() points to the last character in the stream. We |
| 207 // need to compensate by adding one to calculate the length. | 207 // need to compensate by adding one to calculate the length. |
| 208 int source_len = | 208 int source_len = |
| 209 function->end_position() - function->start_position() + 1; | 209 function->end_position() - function->start_position() + 1; |
| 210 for (int i = 0; i < source_len; i++) { | 210 for (int i = 0; i < source_len; i++) { |
| 211 if (stream.has_more()) PrintF("%c", stream.GetNext()); | 211 if (stream.has_more()) PrintF("%c", stream.GetNext()); |
| 212 } | 212 } |
| 213 PrintF("\n\n"); | 213 PrintF("\n\n"); |
| 214 } | 214 } |
| 215 PrintF("--- Code ---\n"); | 215 if (info->IsOptimizing()) { |
| 216 code->Disassemble(*function->name()->ToCString()); | 216 if (FLAG_print_unopt_code) { |
| 217 PrintF("--- Unoptimized code ---\n"); |
| 218 info->closure()->shared()->code()->Disassemble( |
| 219 *function->debug_name()->ToCString()); |
| 220 } |
| 221 PrintF("--- Optimized code ---\n"); |
| 222 } else { |
| 223 PrintF("--- Code ---\n"); |
| 224 } |
| 225 code->Disassemble(*function->debug_name()->ToCString()); |
| 217 } | 226 } |
| 218 #endif // ENABLE_DISASSEMBLER | 227 #endif // ENABLE_DISASSEMBLER |
| 219 } | 228 } |
| 220 | 229 |
| 221 | 230 |
| 222 // Generate the code. Compile the AST and assemble all the pieces into a | 231 // Generate the code. Compile the AST and assemble all the pieces into a |
| 223 // Code object. | 232 // Code object. |
| 224 bool CodeGenerator::MakeCode(CompilationInfo* info) { | 233 bool CodeGenerator::MakeCode(CompilationInfo* info) { |
| 225 // When using Crankshaft the classic backend should never be used. | 234 // When using Crankshaft the classic backend should never be used. |
| 226 ASSERT(!V8::UseCrankshaft()); | 235 ASSERT(!V8::UseCrankshaft()); |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 int result = save_doubles_ ? 1 : 0; | 476 int result = save_doubles_ ? 1 : 0; |
| 468 #ifdef _WIN64 | 477 #ifdef _WIN64 |
| 469 return result | ((result_size_ == 1) ? 0 : 2); | 478 return result | ((result_size_ == 1) ? 0 : 2); |
| 470 #else | 479 #else |
| 471 return result; | 480 return result; |
| 472 #endif | 481 #endif |
| 473 } | 482 } |
| 474 | 483 |
| 475 | 484 |
| 476 } } // namespace v8::internal | 485 } } // namespace v8::internal |
| OLD | NEW |