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

Side by Side Diff: src/arm/lithium-codegen-arm.cc

Issue 9388007: Allow inlining of functions containing object literals. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Added test case. Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/ast.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 4413 matching lines...) Expand 10 before | Expand all | Expand 10 after
4424 4424
4425 __ bind(&allocated); 4425 __ bind(&allocated);
4426 int offset = 0; 4426 int offset = 0;
4427 __ LoadHeapObject(r1, instr->hydrogen()->boilerplate()); 4427 __ LoadHeapObject(r1, instr->hydrogen()->boilerplate());
4428 EmitDeepCopy(instr->hydrogen()->boilerplate(), r0, r1, &offset); 4428 EmitDeepCopy(instr->hydrogen()->boilerplate(), r0, r1, &offset);
4429 ASSERT_EQ(size, offset); 4429 ASSERT_EQ(size, offset);
4430 } 4430 }
4431 4431
4432 4432
4433 void LCodeGen::DoObjectLiteralGeneric(LObjectLiteralGeneric* instr) { 4433 void LCodeGen::DoObjectLiteralGeneric(LObjectLiteralGeneric* instr) {
4434 Handle<FixedArray> literals(instr->environment()->closure()->literals());
4434 Handle<FixedArray> constant_properties = 4435 Handle<FixedArray> constant_properties =
4435 instr->hydrogen()->constant_properties(); 4436 instr->hydrogen()->constant_properties();
4436 4437
4437 __ ldr(r4, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); 4438 // Set up the parameters to the stub/runtime call.
4438 __ ldr(r4, FieldMemOperand(r4, JSFunction::kLiteralsOffset)); 4439 __ LoadHeapObject(r4, literals);
4439 __ mov(r3, Operand(Smi::FromInt(instr->hydrogen()->literal_index()))); 4440 __ mov(r3, Operand(Smi::FromInt(instr->hydrogen()->literal_index())));
4440 __ mov(r2, Operand(constant_properties)); 4441 __ mov(r2, Operand(constant_properties));
4441 int flags = instr->hydrogen()->fast_elements() 4442 int flags = instr->hydrogen()->fast_elements()
4442 ? ObjectLiteral::kFastElements 4443 ? ObjectLiteral::kFastElements
4443 : ObjectLiteral::kNoFlags; 4444 : ObjectLiteral::kNoFlags;
4444 __ mov(r1, Operand(Smi::FromInt(flags))); 4445 __ mov(r1, Operand(Smi::FromInt(flags)));
4445 __ Push(r4, r3, r2, r1); 4446 __ Push(r4, r3, r2, r1);
4446 4447
4447 // Pick the right runtime function to call. 4448 // Pick the right runtime function or stub to call.
4448 int properties_count = constant_properties->length() / 2; 4449 int properties_count = constant_properties->length() / 2;
4449 if (instr->hydrogen()->depth() > 1) { 4450 if (instr->hydrogen()->depth() > 1) {
4450 CallRuntime(Runtime::kCreateObjectLiteral, 4, instr); 4451 CallRuntime(Runtime::kCreateObjectLiteral, 4, instr);
4451 } else if (flags != ObjectLiteral::kFastElements || 4452 } else if (flags != ObjectLiteral::kFastElements ||
4452 properties_count > FastCloneShallowObjectStub::kMaximumClonedProperties) { 4453 properties_count > FastCloneShallowObjectStub::kMaximumClonedProperties) {
4453 CallRuntime(Runtime::kCreateObjectLiteralShallow, 4, instr); 4454 CallRuntime(Runtime::kCreateObjectLiteralShallow, 4, instr);
4454 } else { 4455 } else {
4455 FastCloneShallowObjectStub stub(properties_count); 4456 FastCloneShallowObjectStub stub(properties_count);
4456 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); 4457 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
4457 } 4458 }
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
4797 ASSERT(osr_pc_offset_ == -1); 4798 ASSERT(osr_pc_offset_ == -1);
4798 osr_pc_offset_ = masm()->pc_offset(); 4799 osr_pc_offset_ = masm()->pc_offset();
4799 } 4800 }
4800 4801
4801 4802
4802 4803
4803 4804
4804 #undef __ 4805 #undef __
4805 4806
4806 } } // namespace v8::internal 4807 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/ast.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698