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

Side by Side Diff: src/gdb-jit.cc

Issue 13781002: GDBJIT: Properly terminate sub program and compile unit. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 7 years, 8 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 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 1195 matching lines...) Expand 10 before | Expand all | Expand 10 after
1206 { 1206 {
1207 w->WriteULEB128(current_abbreviation++); 1207 w->WriteULEB128(current_abbreviation++);
1208 w->WriteString("__context"); 1208 w->WriteString("__context");
1209 w->Write<uint32_t>(ty_offset); 1209 w->Write<uint32_t>(ty_offset);
1210 Writer::Slot<uint32_t> block_size = w->CreateSlotHere<uint32_t>(); 1210 Writer::Slot<uint32_t> block_size = w->CreateSlotHere<uint32_t>();
1211 uintptr_t block_start = w->position(); 1211 uintptr_t block_start = w->position();
1212 w->Write<uint8_t>(DW_OP_fbreg); 1212 w->Write<uint8_t>(DW_OP_fbreg);
1213 w->WriteSLEB128(StandardFrameConstants::kContextOffset); 1213 w->WriteSLEB128(StandardFrameConstants::kContextOffset);
1214 block_size.set(static_cast<uint32_t>(w->position() - block_start)); 1214 block_size.set(static_cast<uint32_t>(w->position() - block_start));
1215 } 1215 }
1216
1217 w->WriteULEB128(0); // Terminate the sub program.
1216 } 1218 }
1217 1219
1220 w->WriteULEB128(0); // Terminate the compile unit.
1218 size.set(static_cast<uint32_t>(w->position() - start)); 1221 size.set(static_cast<uint32_t>(w->position() - start));
1219 return true; 1222 return true;
1220 } 1223 }
1221 1224
1222 private: 1225 private:
1223 CodeDescription* desc_; 1226 CodeDescription* desc_;
1224 }; 1227 };
1225 1228
1226 1229
1227 class DebugAbbrevSection : public DebugSection { 1230 class DebugAbbrevSection : public DebugSection {
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
1317 w->WriteULEB128(0); 1320 w->WriteULEB128(0);
1318 1321
1319 if (extra_info) { 1322 if (extra_info) {
1320 Scope* scope = desc_->info()->scope(); 1323 Scope* scope = desc_->info()->scope();
1321 int params = scope->num_parameters(); 1324 int params = scope->num_parameters();
1322 int slots = scope->num_stack_slots(); 1325 int slots = scope->num_stack_slots();
1323 int context_slots = scope->ContextLocalCount(); 1326 int context_slots = scope->ContextLocalCount();
1324 // The real slot ID is internal_slots + context_slot_id. 1327 // The real slot ID is internal_slots + context_slot_id.
1325 int internal_slots = Context::MIN_CONTEXT_SLOTS; 1328 int internal_slots = Context::MIN_CONTEXT_SLOTS;
1326 int locals = scope->StackLocalCount(); 1329 int locals = scope->StackLocalCount();
1327 int total_children = 1330 // Total children is params + slots + context_slots + internal_slots +
1328 params + slots + context_slots + internal_slots + locals + 2; 1331 // locals + 2 (__function and __context).
1329 1332
1330 // The extra duplication below seems to be necessary to keep 1333 // The extra duplication below seems to be necessary to keep
1331 // gdb from getting upset on OSX. 1334 // gdb from getting upset on OSX.
1332 w->WriteULEB128(current_abbreviation++); // Abbreviation code. 1335 w->WriteULEB128(current_abbreviation++); // Abbreviation code.
1333 w->WriteULEB128(DW_TAG_SUBPROGRAM); 1336 w->WriteULEB128(DW_TAG_SUBPROGRAM);
1334 w->Write<uint8_t>( 1337 w->Write<uint8_t>(DW_CHILDREN_YES);
1335 total_children != 0 ? DW_CHILDREN_YES : DW_CHILDREN_NO);
1336 w->WriteULEB128(DW_AT_NAME); 1338 w->WriteULEB128(DW_AT_NAME);
1337 w->WriteULEB128(DW_FORM_STRING); 1339 w->WriteULEB128(DW_FORM_STRING);
1338 w->WriteULEB128(DW_AT_LOW_PC); 1340 w->WriteULEB128(DW_AT_LOW_PC);
1339 w->WriteULEB128(DW_FORM_ADDR); 1341 w->WriteULEB128(DW_FORM_ADDR);
1340 w->WriteULEB128(DW_AT_HIGH_PC); 1342 w->WriteULEB128(DW_AT_HIGH_PC);
1341 w->WriteULEB128(DW_FORM_ADDR); 1343 w->WriteULEB128(DW_FORM_ADDR);
1342 w->WriteULEB128(DW_AT_FRAME_BASE); 1344 w->WriteULEB128(DW_AT_FRAME_BASE);
1343 w->WriteULEB128(DW_FORM_BLOCK4); 1345 w->WriteULEB128(DW_FORM_BLOCK4);
1344 w->WriteULEB128(0); 1346 w->WriteULEB128(0);
1345 w->WriteULEB128(0); 1347 w->WriteULEB128(0);
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
1377 for (int local = 0; local < locals; ++local) { 1379 for (int local = 0; local < locals; ++local) {
1378 WriteVariableAbbreviation(w, current_abbreviation++, true, false); 1380 WriteVariableAbbreviation(w, current_abbreviation++, true, false);
1379 } 1381 }
1380 1382
1381 // The function. 1383 // The function.
1382 WriteVariableAbbreviation(w, current_abbreviation++, true, false); 1384 WriteVariableAbbreviation(w, current_abbreviation++, true, false);
1383 1385
1384 // The context. 1386 // The context.
1385 WriteVariableAbbreviation(w, current_abbreviation++, true, false); 1387 WriteVariableAbbreviation(w, current_abbreviation++, true, false);
1386 1388
1387 if (total_children != 0) { 1389 w->WriteULEB128(0); // Terminate the sibling list.
1388 w->WriteULEB128(0); // Terminate the sibling list.
1389 }
1390 } 1390 }
1391 1391
1392 w->WriteULEB128(0); // Terminate the table. 1392 w->WriteULEB128(0); // Terminate the table.
1393 return true; 1393 return true;
1394 } 1394 }
1395 1395
1396 private: 1396 private:
1397 CodeDescription* desc_; 1397 CodeDescription* desc_;
1398 }; 1398 };
1399 1399
(...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after
2169 ScopedLock lock(mutex.Pointer()); 2169 ScopedLock lock(mutex.Pointer());
2170 ASSERT(!IsLineInfoTagged(line_info)); 2170 ASSERT(!IsLineInfoTagged(line_info));
2171 HashMap::Entry* e = GetEntries()->Lookup(code, HashForCodeObject(code), true); 2171 HashMap::Entry* e = GetEntries()->Lookup(code, HashForCodeObject(code), true);
2172 ASSERT(e->value == NULL); 2172 ASSERT(e->value == NULL);
2173 e->value = TagLineInfo(line_info); 2173 e->value = TagLineInfo(line_info);
2174 } 2174 }
2175 2175
2176 2176
2177 } } // namespace v8::internal 2177 } } // namespace v8::internal
2178 #endif 2178 #endif
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