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

Side by Side Diff: src/deoptimizer.cc

Issue 22852024: Track JS allocations as they arrive with no affection on performance when tracking is switched off (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Deoptimize code and generate optimized code when switching allocations tracking Created 7 years, 3 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
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 2422 matching lines...) Expand 10 before | Expand all | Expand 10 after
2433 ASSERT(type == EAGER || type == SOFT || type == LAZY); 2433 ASSERT(type == EAGER || type == SOFT || type == LAZY);
2434 DeoptimizerData* data = isolate->deoptimizer_data(); 2434 DeoptimizerData* data = isolate->deoptimizer_data();
2435 int entry_count = data->deopt_entry_code_entries_[type]; 2435 int entry_count = data->deopt_entry_code_entries_[type];
2436 if (max_entry_id < entry_count) return; 2436 if (max_entry_id < entry_count) return;
2437 entry_count = Max(entry_count, Deoptimizer::kMinNumberOfEntries); 2437 entry_count = Max(entry_count, Deoptimizer::kMinNumberOfEntries);
2438 while (max_entry_id >= entry_count) entry_count *= 2; 2438 while (max_entry_id >= entry_count) entry_count *= 2;
2439 ASSERT(entry_count <= Deoptimizer::kMaxNumberOfEntries); 2439 ASSERT(entry_count <= Deoptimizer::kMaxNumberOfEntries);
2440 2440
2441 MacroAssembler masm(isolate, NULL, 16 * KB); 2441 MacroAssembler masm(isolate, NULL, 16 * KB);
2442 masm.set_emit_debug_code(false); 2442 masm.set_emit_debug_code(false);
2443 masm.set_emit_allocations_tracking_code(
2444 isolate->heap_profiler()->is_tracking_allocations());
2443 GenerateDeoptimizationEntries(&masm, entry_count, type); 2445 GenerateDeoptimizationEntries(&masm, entry_count, type);
2444 CodeDesc desc; 2446 CodeDesc desc;
2445 masm.GetCode(&desc); 2447 masm.GetCode(&desc);
2446 ASSERT(!RelocInfo::RequiresRelocation(desc)); 2448 ASSERT(!RelocInfo::RequiresRelocation(desc));
2447 2449
2448 MemoryChunk* chunk = data->deopt_entry_code_[type]; 2450 MemoryChunk* chunk = data->deopt_entry_code_[type];
2449 ASSERT(static_cast<int>(Deoptimizer::GetMaxDeoptTableSize()) >= 2451 ASSERT(static_cast<int>(Deoptimizer::GetMaxDeoptTableSize()) >=
2450 desc.instr_size); 2452 desc.instr_size);
2451 chunk->CommitArea(desc.instr_size); 2453 chunk->CommitArea(desc.instr_size);
2452 CopyBytes(chunk->area_start(), desc.buffer, 2454 CopyBytes(chunk->area_start(), desc.buffer,
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after
2973 2975
2974 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) { 2976 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) {
2975 v->VisitPointer(BitCast<Object**>(&function_)); 2977 v->VisitPointer(BitCast<Object**>(&function_));
2976 v->VisitPointers(parameters_, parameters_ + parameters_count_); 2978 v->VisitPointers(parameters_, parameters_ + parameters_count_);
2977 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_); 2979 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_);
2978 } 2980 }
2979 2981
2980 #endif // ENABLE_DEBUGGER_SUPPORT 2982 #endif // ENABLE_DEBUGGER_SUPPORT
2981 2983
2982 } } // namespace v8::internal 2984 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/builtins.cc ('k') | src/full-codegen.cc » ('j') | test/cctest/cctest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698