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

Side by Side Diff: src/disassembler.cc

Issue 6529032: Merge 6168:6800 from bleeding_edge to experimental/gc branch. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/gc/
Patch Set: Created 9 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 | « src/deoptimizer.cc ('k') | src/execution.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2010 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
11 // with the distribution. 11 // with the distribution.
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 ASSERT(obj->IsSmi()); 261 ASSERT(obj->IsSmi());
262 // Get the STUB key and extract major and minor key. 262 // Get the STUB key and extract major and minor key.
263 uint32_t key = Smi::cast(obj)->value(); 263 uint32_t key = Smi::cast(obj)->value();
264 uint32_t minor_key = CodeStub::MinorKeyFromKey(key); 264 uint32_t minor_key = CodeStub::MinorKeyFromKey(key);
265 CodeStub::Major major_key = CodeStub::GetMajorKey(code); 265 CodeStub::Major major_key = CodeStub::GetMajorKey(code);
266 ASSERT(major_key == CodeStub::MajorKeyFromKey(key)); 266 ASSERT(major_key == CodeStub::MajorKeyFromKey(key));
267 out.AddFormatted(" %s, %s, ", 267 out.AddFormatted(" %s, %s, ",
268 Code::Kind2String(kind), 268 Code::Kind2String(kind),
269 CodeStub::MajorName(major_key, false)); 269 CodeStub::MajorName(major_key, false));
270 switch (major_key) { 270 switch (major_key) {
271 case CodeStub::CallFunction: 271 case CodeStub::CallFunction: {
272 out.AddFormatted("argc = %d", minor_key); 272 int argc =
273 CallFunctionStub::ExtractArgcFromMinorKey(minor_key);
274 out.AddFormatted("argc = %d", argc);
273 break; 275 break;
274 default: 276 }
277 default:
275 out.AddFormatted("minor: %d", minor_key); 278 out.AddFormatted("minor: %d", minor_key);
276 } 279 }
277 } 280 }
278 } else { 281 } else {
279 out.AddFormatted(" %s", Code::Kind2String(kind)); 282 out.AddFormatted(" %s", Code::Kind2String(kind));
280 } 283 }
281 } else if (rmode == RelocInfo::RUNTIME_ENTRY) { 284 } else if (rmode == RelocInfo::RUNTIME_ENTRY) {
282 // A runtime entry reloinfo might be a deoptimization bailout. 285 // A runtime entry reloinfo might be a deoptimization bailout.
283 Address addr = relocinfo.target_address(); 286 Address addr = relocinfo.target_address();
284 int id = Deoptimizer::GetDeoptimizationId(addr, Deoptimizer::EAGER); 287 int id = Deoptimizer::GetDeoptimizationId(addr, Deoptimizer::EAGER);
(...skipping 18 matching lines...) Expand all
303 306
304 int Disassembler::Decode(FILE* f, byte* begin, byte* end) { 307 int Disassembler::Decode(FILE* f, byte* begin, byte* end) {
305 V8NameConverter defaultConverter(NULL); 308 V8NameConverter defaultConverter(NULL);
306 return DecodeIt(f, defaultConverter, begin, end); 309 return DecodeIt(f, defaultConverter, begin, end);
307 } 310 }
308 311
309 312
310 // Called by Code::CodePrint. 313 // Called by Code::CodePrint.
311 void Disassembler::Decode(FILE* f, Code* code) { 314 void Disassembler::Decode(FILE* f, Code* code) {
312 int decode_size = (code->kind() == Code::OPTIMIZED_FUNCTION) 315 int decode_size = (code->kind() == Code::OPTIMIZED_FUNCTION)
313 ? static_cast<int>(code->safepoint_table_start()) 316 ? static_cast<int>(code->safepoint_table_offset())
314 : code->instruction_size(); 317 : code->instruction_size();
315 // If there might be a stack check table, stop before reaching it. 318 // If there might be a stack check table, stop before reaching it.
316 if (code->kind() == Code::FUNCTION) { 319 if (code->kind() == Code::FUNCTION) {
317 decode_size = 320 decode_size =
318 Min(decode_size, static_cast<int>(code->stack_check_table_start())); 321 Min(decode_size, static_cast<int>(code->stack_check_table_offset()));
319 } 322 }
320 323
321 byte* begin = code->instruction_start(); 324 byte* begin = code->instruction_start();
322 byte* end = begin + decode_size; 325 byte* end = begin + decode_size;
323 V8NameConverter v8NameConverter(code); 326 V8NameConverter v8NameConverter(code);
324 DecodeIt(f, v8NameConverter, begin, end); 327 DecodeIt(f, v8NameConverter, begin, end);
325 } 328 }
326 329
327 #else // ENABLE_DISASSEMBLER 330 #else // ENABLE_DISASSEMBLER
328 331
329 void Disassembler::Dump(FILE* f, byte* begin, byte* end) {} 332 void Disassembler::Dump(FILE* f, byte* begin, byte* end) {}
330 int Disassembler::Decode(FILE* f, byte* begin, byte* end) { return 0; } 333 int Disassembler::Decode(FILE* f, byte* begin, byte* end) { return 0; }
331 void Disassembler::Decode(FILE* f, Code* code) {} 334 void Disassembler::Decode(FILE* f, Code* code) {}
332 335
333 #endif // ENABLE_DISASSEMBLER 336 #endif // ENABLE_DISASSEMBLER
334 337
335 } } // namespace v8::internal 338 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/deoptimizer.cc ('k') | src/execution.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698