Chromium Code Reviews| Index: regexp2000/src/heap.cc |
| diff --git a/regexp2000/src/heap.cc b/regexp2000/src/heap.cc |
| index cc894dd78bb5f42cdaa21e4b6c3b78efda808f76..2053a5dd795209ddfe3bff379e8050e5ce9fdcf6 100644 |
| --- a/regexp2000/src/heap.cc |
| +++ b/regexp2000/src/heap.cc |
| @@ -1624,7 +1624,8 @@ Object* Heap::AllocateByteArray(int length) { |
| Object* Heap::CreateCode(const CodeDesc& desc, |
| ScopeInfo<>* sinfo, |
| - Code::Flags flags) { |
| + Code::Flags flags, |
| + Handle<Code>* self) { |
|
Erik Corry
2008/11/21 13:03:04
As discussed offline this should be passed by valu
Lasse Reichstein
2008/11/24 08:32:33
Done.
|
| // Compute size |
| int body_size = RoundUp(desc.instr_size + desc.reloc_size, kObjectAlignment); |
| int sinfo_size = 0; |
| @@ -1647,6 +1648,10 @@ Object* Heap::CreateCode(const CodeDesc& desc, |
| code->set_sinfo_size(sinfo_size); |
| code->set_flags(flags); |
| code->set_ic_flag(Code::IC_TARGET_IS_ADDRESS); |
| + if (self != NULL) { |
| + // Allow self references to created code object. |
| + *(self->location()) = code; |
| + } |
| code->CopyFrom(desc); // migrate generated code |
|
Erik Corry
2008/11/21 13:03:04
A comment here to the effect that CopyFrom may mak
Lasse Reichstein
2008/11/24 08:32:33
Done.
|
| if (sinfo != NULL) sinfo->Serialize(code); // write scope info |