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

Unified Diff: src/deoptimizer.cc

Issue 7945009: Merge experimental/gc branch to the bleeding_edge. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/deoptimizer.h ('k') | src/disassembler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/deoptimizer.cc
===================================================================
--- src/deoptimizer.cc (revision 9327)
+++ src/deoptimizer.cc (working copy)
@@ -52,11 +52,13 @@
DeoptimizerData::~DeoptimizerData() {
if (eager_deoptimization_entry_code_ != NULL) {
- eager_deoptimization_entry_code_->Free(EXECUTABLE);
+ Isolate::Current()->memory_allocator()->Free(
+ eager_deoptimization_entry_code_);
eager_deoptimization_entry_code_ = NULL;
}
if (lazy_deoptimization_entry_code_ != NULL) {
- lazy_deoptimization_entry_code_->Free(EXECUTABLE);
+ Isolate::Current()->memory_allocator()->Free(
+ lazy_deoptimization_entry_code_);
lazy_deoptimization_entry_code_ = NULL;
}
}
@@ -388,7 +390,7 @@
Address Deoptimizer::GetDeoptimizationEntry(int id, BailoutType type) {
ASSERT(id >= 0);
if (id >= kNumberOfEntries) return NULL;
- LargeObjectChunk* base = NULL;
+ MemoryChunk* base = NULL;
DeoptimizerData* data = Isolate::Current()->deoptimizer_data();
if (type == EAGER) {
if (data->eager_deoptimization_entry_code_ == NULL) {
@@ -402,12 +404,12 @@
base = data->lazy_deoptimization_entry_code_;
}
return
- static_cast<Address>(base->GetStartAddress()) + (id * table_entry_size_);
+ static_cast<Address>(base->body()) + (id * table_entry_size_);
}
int Deoptimizer::GetDeoptimizationId(Address addr, BailoutType type) {
- LargeObjectChunk* base = NULL;
+ MemoryChunk* base = NULL;
DeoptimizerData* data = Isolate::Current()->deoptimizer_data();
if (type == EAGER) {
base = data->eager_deoptimization_entry_code_;
@@ -415,14 +417,14 @@
base = data->lazy_deoptimization_entry_code_;
}
if (base == NULL ||
- addr < base->GetStartAddress() ||
- addr >= base->GetStartAddress() +
+ addr < base->body() ||
+ addr >= base->body() +
(kNumberOfEntries * table_entry_size_)) {
return kNotDeoptimizationEntry;
}
ASSERT_EQ(0,
- static_cast<int>(addr - base->GetStartAddress()) % table_entry_size_);
- return static_cast<int>(addr - base->GetStartAddress()) / table_entry_size_;
+ static_cast<int>(addr - base->body()) % table_entry_size_);
+ return static_cast<int>(addr - base->body()) / table_entry_size_;
}
@@ -957,7 +959,10 @@
for (uint32_t i = 0; i < table_length; ++i) {
uint32_t pc_offset = Memory::uint32_at(stack_check_cursor + kIntSize);
Address pc_after = unoptimized_code->instruction_start() + pc_offset;
- PatchStackCheckCodeAt(pc_after, check_code, replacement_code);
+ PatchStackCheckCodeAt(unoptimized_code,
+ pc_after,
+ check_code,
+ replacement_code);
stack_check_cursor += 2 * kIntSize;
}
}
@@ -1043,7 +1048,7 @@
}
-LargeObjectChunk* Deoptimizer::CreateCode(BailoutType type) {
+MemoryChunk* Deoptimizer::CreateCode(BailoutType type) {
// We cannot run this if the serializer is enabled because this will
// cause us to emit relocation information for the external
// references. This is fine because the deoptimizer's code section
@@ -1057,12 +1062,15 @@
masm.GetCode(&desc);
ASSERT(desc.reloc_size == 0);
- LargeObjectChunk* chunk = LargeObjectChunk::New(desc.instr_size, EXECUTABLE);
+ MemoryChunk* chunk =
+ Isolate::Current()->memory_allocator()->AllocateChunk(desc.instr_size,
+ EXECUTABLE,
+ NULL);
if (chunk == NULL) {
V8::FatalProcessOutOfMemory("Not enough memory for deoptimization table");
}
- memcpy(chunk->GetStartAddress(), desc.buffer, desc.instr_size);
- CPU::FlushICache(chunk->GetStartAddress(), desc.instr_size);
+ memcpy(chunk->body(), desc.buffer, desc.instr_size);
+ CPU::FlushICache(chunk->body(), desc.instr_size);
return chunk;
}
« no previous file with comments | « src/deoptimizer.h ('k') | src/disassembler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698