Enabled new regular expression engine.
Made a number of changes to the debugger protocol.
Fixed a number of bugs in the preemption support.
Added -p option to the developer shell to run files in parallel using preemption.
Fixed a number of minor bugs (including issues 176, 187, 189, 192, 193, 198 and 201).
Fixed a number of bugs in the serialization/deserialization support for the ARM platform.
git-svn-id: http://v8.googlecode.com/svn/trunk@1172 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
diff --git a/src/heap.cc b/src/heap.cc
index f8caa49..b0a2db4 100644
--- a/src/heap.cc
+++ b/src/heap.cc
@@ -1724,9 +1724,12 @@
Object* Heap::AllocateFunctionPrototype(JSFunction* function) {
- // Allocate the prototype.
- Object* prototype =
- AllocateJSObject(Top::context()->global_context()->object_function());
+ // Allocate the prototype. Make sure to use the object function
+ // from the function's context, since the function can be from a
+ // different context.
+ JSFunction* object_function =
+ function->context()->global_context()->object_function();
+ Object* prototype = AllocateJSObject(object_function);
if (prototype->IsFailure()) return prototype;
// When creating the prototype for the function we must set its
// constructor to the function.