Revision: 15732
Author: [email protected]
Date: Wed Jul 17 11:39:34 2013
Log: MIPS: The gc should be able to traverse all AllocationSites for
decision making.
Port r15715 (2e830d4)
Original commit message:
The gc should be able to traverse all AllocationSites for decision making.
The sites are threaded into a weak list. Special problems include:
* Allocations of AllocationSites occur in generated code, so generated code
needs to be able to add to the list. For now I have a special hydrogen
instruction, though it would be nice to use general purpose instructions.
* The snapshot contains AllocationSites, and these need to be re-threaded
into the list on deserialization.
Something nice is that the AllocationSites are only created in old space,
so a special new space visitor isn't required.
BUG=
Review URL: https://codereview.chromium.org/19635002
Patch from Balazs Kilvady <[email protected]>.
http://code.google.com/p/v8/source/detail?r=15732
Modified:
/branches/bleeding_edge/src/mips/lithium-codegen-mips.cc
/branches/bleeding_edge/src/mips/lithium-mips.cc
/branches/bleeding_edge/src/mips/lithium-mips.h
=======================================
--- /branches/bleeding_edge/src/mips/lithium-codegen-mips.cc Mon Jul 15
08:12:16 2013
+++ /branches/bleeding_edge/src/mips/lithium-codegen-mips.cc Wed Jul 17
11:39:34 2013
@@ -2792,6 +2792,19 @@
: isolate()->builtins()->StoreIC_Initialize();
CallCode(ic, RelocInfo::CODE_TARGET_CONTEXT, instr);
}
+
+
+void LCodeGen::DoLinkObjectInList(LLinkObjectInList* instr) {
+ Register object = ToRegister(instr->object());
+ ExternalReference sites_list_address = instr->GetReference(isolate());
+
+ __ li(at, Operand(sites_list_address));
+ __ lw(at, MemOperand(at));
+ __ sw(at, FieldMemOperand(object,
+ instr->hydrogen()->store_field().offset()));
+ __ li(at, Operand(sites_list_address));
+ __ sw(object, MemOperand(at));
+}
void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) {
=======================================
--- /branches/bleeding_edge/src/mips/lithium-mips.cc Mon Jul 15 08:12:16
2013
+++ /branches/bleeding_edge/src/mips/lithium-mips.cc Wed Jul 17 11:39:34
2013
@@ -275,6 +275,24 @@
void LCallConstantFunction::PrintDataTo(StringStream* stream) {
stream->Add("#%d / ", arity());
}
+
+
+ExternalReference LLinkObjectInList::GetReference(Isolate* isolate) {
+ switch (hydrogen()->known_list()) {
+ case HLinkObjectInList::ALLOCATION_SITE_LIST:
+ return ExternalReference::allocation_sites_list_address(isolate);
+ }
+
+ UNREACHABLE();
+ // Return a dummy value
+ return ExternalReference::isolate_address(isolate);
+}
+
+
+void LLinkObjectInList::PrintDataTo(StringStream* stream) {
+ object()->PrintTo(stream);
+ stream->Add(" offset %d", hydrogen()->store_field().offset());
+}
void LLoadContextSlot::PrintDataTo(StringStream* stream) {
@@ -2033,6 +2051,13 @@
new(zone()) LStoreGlobalGeneric(global_object, value);
return MarkAsCall(result, instr);
}
+
+
+LInstruction* LChunkBuilder::DoLinkObjectInList(HLinkObjectInList* instr) {
+ LOperand* object = UseRegister(instr->value());
+ LLinkObjectInList* result = new(zone()) LLinkObjectInList(object);
+ return result;
+}
LInstruction* LChunkBuilder::DoLoadContextSlot(HLoadContextSlot* instr) {
=======================================
--- /branches/bleeding_edge/src/mips/lithium-mips.h Mon Jul 15 08:12:16 2013
+++ /branches/bleeding_edge/src/mips/lithium-mips.h Wed Jul 17 11:39:34 2013
@@ -120,6 +120,7 @@
V(IsUndetectableAndBranch) \
V(Label) \
V(LazyBailout) \
+ V(LinkObjectInList) \
V(LoadContextSlot) \
V(LoadExternalArrayPointer) \
V(LoadFunctionPrototype) \
@@ -1662,6 +1663,23 @@
};
+class LLinkObjectInList: public LTemplateInstruction<0, 1, 0> {
+ public:
+ explicit LLinkObjectInList(LOperand* object) {
+ inputs_[0] = object;
+ }
+
+ LOperand* object() { return inputs_[0]; }
+
+ ExternalReference GetReference(Isolate* isolate);
+
+ DECLARE_CONCRETE_INSTRUCTION(LinkObjectInList, "link-object-in-list")
+ DECLARE_HYDROGEN_ACCESSOR(LinkObjectInList)
+
+ virtual void PrintDataTo(StringStream* stream);
+};
+
+
class LLoadContextSlot: public LTemplateInstruction<1, 1, 0> {
public:
explicit LLoadContextSlot(LOperand* context) {
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.