Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(478)

Side by Side Diff: src/codegen.cc

Issue 12223007: Print generated code for Crankshafted stubs with --print-code-stubs (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 code->set_prologue_offset(info->prologue_offset()); 116 code->set_prologue_offset(info->prologue_offset());
117 } 117 }
118 return code; 118 return code;
119 } 119 }
120 120
121 121
122 void CodeGenerator::PrintCode(Handle<Code> code, CompilationInfo* info) { 122 void CodeGenerator::PrintCode(Handle<Code> code, CompilationInfo* info) {
123 #ifdef ENABLE_DISASSEMBLER 123 #ifdef ENABLE_DISASSEMBLER
124 bool print_code = Isolate::Current()->bootstrapper()->IsActive() 124 bool print_code = Isolate::Current()->bootstrapper()->IsActive()
125 ? FLAG_print_builtin_code 125 ? FLAG_print_builtin_code
126 : (FLAG_print_code || (info->IsOptimizing() && FLAG_print_opt_code)); 126 : (FLAG_print_code ||
127 (info->IsStub() && FLAG_print_code_stubs) ||
128 (info->IsOptimizing() && FLAG_print_opt_code));
127 if (print_code) { 129 if (print_code) {
128 // Print the source code if available. 130 // Print the source code if available.
129 FunctionLiteral* function = info->function(); 131 FunctionLiteral* function = info->function();
130 if (code->kind() != Code::COMPILED_STUB) { 132 if (code->kind() != Code::COMPILED_STUB) {
131 Handle<Script> script = info->script(); 133 Handle<Script> script = info->script();
132 if (!script->IsUndefined() && !script->source()->IsUndefined()) { 134 if (!script->IsUndefined() && !script->source()->IsUndefined()) {
133 PrintF("--- Raw source ---\n"); 135 PrintF("--- Raw source ---\n");
134 ConsStringIteratorOp op; 136 ConsStringIteratorOp op;
135 StringCharacterStream stream(String::cast(script->source()), 137 StringCharacterStream stream(String::cast(script->source()),
136 &op, 138 &op,
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 ASSERT(result_size_ == 1 || result_size_ == 2); 220 ASSERT(result_size_ == 1 || result_size_ == 2);
219 #ifdef _WIN64 221 #ifdef _WIN64
220 return result | ((result_size_ == 1) ? 0 : 2); 222 return result | ((result_size_ == 1) ? 0 : 2);
221 #else 223 #else
222 return result; 224 return result;
223 #endif 225 #endif
224 } 226 }
225 227
226 228
227 } } // namespace v8::internal 229 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698