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

Unified Diff: src/heap.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/heap.h ('k') | src/heap-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap.cc
===================================================================
--- src/heap.cc (revision 6800)
+++ src/heap.cc (working copy)
@@ -35,6 +35,7 @@
#include "debug.h"
#include "heap-profiler.h"
#include "global-handles.h"
+#include "liveobjectlist-inl.h"
#include "mark-compact.h"
#include "natives.h"
#include "objects-visiting.h"
@@ -379,6 +380,8 @@
#if defined(DEBUG) || defined(ENABLE_LOGGING_AND_PROFILING)
ReportStatisticsBeforeGC();
#endif
+
+ LiveObjectList::GCPrologue();
}
intptr_t Heap::SizeOfObjects() {
@@ -391,6 +394,7 @@
}
void Heap::GarbageCollectionEpilogue() {
+ LiveObjectList::GCEpilogue();
#ifdef DEBUG
allow_allocation(true);
ZapFromSpace();
@@ -1012,6 +1016,8 @@
UpdateNewSpaceReferencesInExternalStringTable(
&UpdateNewSpaceReferenceInExternalStringTableEntry);
+ LiveObjectList::UpdateReferencesForScavengeGC();
+
ASSERT(new_space_front == new_space_.top());
// Set age mark.
@@ -1773,6 +1779,12 @@
}
set_shared_function_info_map(Map::cast(obj));
+ { MaybeObject* maybe_obj = AllocateMap(JS_MESSAGE_OBJECT_TYPE,
+ JSMessageObject::kSize);
+ if (!maybe_obj->ToObject(&obj)) return false;
+ }
+ set_message_object_map(Map::cast(obj));
+
ASSERT(!Heap::InNewSpace(Heap::empty_fixed_array()));
return true;
}
@@ -1884,6 +1896,14 @@
}
+#if V8_TARGET_ARCH_ARM
+void Heap::CreateDirectCEntryStub() {
+ DirectCEntryStub stub;
+ set_direct_c_entry_code(*stub.GetCode());
+}
+#endif
+
+
void Heap::CreateFixedStubs() {
// Here we create roots for fixed stubs. They are needed at GC
// for cooking and uncooking (check out frames.cc).
@@ -1904,6 +1924,9 @@
#if V8_TARGET_ARCH_ARM && !V8_INTERPRETED_REGEXP
Heap::CreateRegExpCEntryStub();
#endif
+#if V8_TARGET_ARCH_ARM
+ Heap::CreateDirectCEntryStub();
+#endif
}
@@ -1964,6 +1987,12 @@
}
set_the_hole_value(obj);
+ { MaybeObject* maybe_obj = CreateOddball("arguments_marker",
+ Smi::FromInt(-4));
+ if (!maybe_obj->ToObject(&obj)) return false;
+ }
+ set_arguments_marker(obj);
+
{ MaybeObject* maybe_obj =
CreateOddball("no_interceptor_result_sentinel", Smi::FromInt(-2));
if (!maybe_obj->ToObject(&obj)) return false;
@@ -2270,6 +2299,32 @@
}
+MaybeObject* Heap::AllocateJSMessageObject(String* type,
+ JSArray* arguments,
+ int start_position,
+ int end_position,
+ Object* script,
+ Object* stack_trace,
+ Object* stack_frames) {
+ Object* result;
+ { MaybeObject* maybe_result = Allocate(message_object_map(), NEW_SPACE);
+ if (!maybe_result->ToObject(&result)) return maybe_result;
+ }
+ JSMessageObject* message = JSMessageObject::cast(result);
+ message->set_properties(Heap::empty_fixed_array());
+ message->set_elements(Heap::empty_fixed_array());
+ message->set_type(type);
+ message->set_arguments(arguments);
+ message->set_start_position(start_position);
+ message->set_end_position(end_position);
+ message->set_script(script);
+ message->set_stack_trace(stack_trace);
+ message->set_stack_frames(stack_frames);
+ return result;
+}
+
+
+
// Returns true for a character in a range. Both limits are inclusive.
static inline bool Between(uint32_t character, uint32_t from, uint32_t to) {
// This makes uses of the the unsigned wraparound.
@@ -2671,6 +2726,9 @@
code->set_instruction_size(desc.instr_size);
code->set_relocation_info(ByteArray::cast(reloc_info));
code->set_flags(flags);
+ if (code->is_call_stub() || code->is_keyed_call_stub()) {
+ code->set_check_type(RECEIVER_MAP_CHECK);
+ }
code->set_deoptimization_data(empty_fixed_array());
// Allow self references to created code object by patching the handle to
// point to the newly allocated Code object.
@@ -4023,7 +4081,7 @@
#ifdef DEBUG
void Heap::ZapFromSpace() {
- ASSERT(reinterpret_cast<Object*>(kFromSpaceZapValue)->IsHeapObject());
+ ASSERT(reinterpret_cast<Object*>(kFromSpaceZapValue)->IsFailure());
for (Address a = new_space_.FromSpaceLow();
a < new_space_.FromSpaceHigh();
a += kPointerSize) {
@@ -5003,7 +5061,7 @@
IntrusiveMarking::SetMark(obj);
}
UnmarkingVisitor visitor;
- Heap::IterateRoots(&visitor, VISIT_ONLY_STRONG);
+ Heap::IterateRoots(&visitor, VISIT_ALL);
while (visitor.can_process())
visitor.ProcessNext();
}
« no previous file with comments | « src/heap.h ('k') | src/heap-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698