Commit c2427115 authored by kasperl@chromium.org's avatar kasperl@chromium.org

Fix issue 656 on ARM.

TBR=iposva@chromium.org
Review URL: http://codereview.chromium.org/1117010

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4214 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 4ddc744f
...@@ -2311,8 +2311,7 @@ void CodeGenerator::InstantiateFunction( ...@@ -2311,8 +2311,7 @@ void CodeGenerator::InstantiateFunction(
__ mov(r0, Operand(function_info)); __ mov(r0, Operand(function_info));
// Use the fast case closure allocation code that allocates in new // Use the fast case closure allocation code that allocates in new
// space for nested functions that don't need literals cloning. // space for nested functions that don't need literals cloning.
if (false && if (scope()->is_function_scope() && function_info->num_literals() == 0) {
scope()->is_function_scope() && function_info->num_literals() == 0) {
FastNewClosureStub stub; FastNewClosureStub stub;
frame_->EmitPush(r0); frame_->EmitPush(r0);
frame_->CallStub(&stub, 1); frame_->CallStub(&stub, 1);
...@@ -4527,11 +4526,11 @@ void Reference::SetValue(InitState init_state) { ...@@ -4527,11 +4526,11 @@ void Reference::SetValue(InitState init_state) {
void FastNewClosureStub::Generate(MacroAssembler* masm) { void FastNewClosureStub::Generate(MacroAssembler* masm) {
// Clone the boilerplate in new space. Set the context to the // Create a new closure from the given function info in new
// current context in cp. // space. Set the context to the current context in cp.
Label gc; Label gc;
// Pop the boilerplate function from the stack. // Pop the function info from the stack.
__ pop(r3); __ pop(r3);
// Attempt to allocate new JSFunction in new space. // Attempt to allocate new JSFunction in new space.
...@@ -4549,20 +4548,18 @@ void FastNewClosureStub::Generate(MacroAssembler* masm) { ...@@ -4549,20 +4548,18 @@ void FastNewClosureStub::Generate(MacroAssembler* masm) {
__ ldr(r2, MemOperand(r2, Context::SlotOffset(Context::FUNCTION_MAP_INDEX))); __ ldr(r2, MemOperand(r2, Context::SlotOffset(Context::FUNCTION_MAP_INDEX)));
__ str(r2, FieldMemOperand(r0, HeapObject::kMapOffset)); __ str(r2, FieldMemOperand(r0, HeapObject::kMapOffset));
// Clone the rest of the boilerplate fields. We don't have to update // Initialize the rest of the function. We don't have to update the
// the write barrier because the allocated object is in new space. // write barrier because the allocated object is in new space.
for (int offset = kPointerSize; __ LoadRoot(r1, Heap::kEmptyFixedArrayRootIndex);
offset < JSFunction::kSize; __ LoadRoot(r2, Heap::kTheHoleValueRootIndex);
offset += kPointerSize) { __ str(r1, FieldMemOperand(r0, JSObject::kPropertiesOffset));
if (offset == JSFunction::kContextOffset) { __ str(r1, FieldMemOperand(r0, JSObject::kElementsOffset));
__ str(cp, FieldMemOperand(r0, offset)); __ str(r2, FieldMemOperand(r0, JSFunction::kPrototypeOrInitialMapOffset));
} else { __ str(r3, FieldMemOperand(r0, JSFunction::kSharedFunctionInfoOffset));
__ ldr(r1, FieldMemOperand(r3, offset)); __ str(cp, FieldMemOperand(r0, JSFunction::kContextOffset));
__ str(r1, FieldMemOperand(r0, offset)); __ str(r1, FieldMemOperand(r0, JSFunction::kLiteralsOffset));
}
} // Return result. The argument function info has been popped already.
// Return result. The argument boilerplate has been popped already.
__ Ret(); __ Ret();
// Create a new closure through the slower runtime call. // Create a new closure through the slower runtime call.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment