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

Side by Side Diff: src/ia32/lithium-codegen-ia32.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 | « src/ast.cc ('k') | src/mips/lithium-codegen-mips.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 4294 matching lines...) Expand 10 before | Expand all | Expand 10 after
4305 __ bind(&allocated); 4305 __ bind(&allocated);
4306 int offset = 0; 4306 int offset = 0;
4307 __ LoadHeapObject(ebx, instr->hydrogen()->boilerplate()); 4307 __ LoadHeapObject(ebx, instr->hydrogen()->boilerplate());
4308 EmitDeepCopy(instr->hydrogen()->boilerplate(), eax, ebx, &offset); 4308 EmitDeepCopy(instr->hydrogen()->boilerplate(), eax, ebx, &offset);
4309 ASSERT_EQ(size, offset); 4309 ASSERT_EQ(size, offset);
4310 } 4310 }
4311 4311
4312 4312
4313 void LCodeGen::DoObjectLiteralGeneric(LObjectLiteralGeneric* instr) { 4313 void LCodeGen::DoObjectLiteralGeneric(LObjectLiteralGeneric* instr) {
4314 ASSERT(ToRegister(instr->context()).is(esi)); 4314 ASSERT(ToRegister(instr->context()).is(esi));
4315 Handle<FixedArray> literals(instr->environment()->closure()->literals());
4315 Handle<FixedArray> constant_properties = 4316 Handle<FixedArray> constant_properties =
4316 instr->hydrogen()->constant_properties(); 4317 instr->hydrogen()->constant_properties();
4317 4318
4318 // Set up the parameters to the stub/runtime call. 4319 // Set up the parameters to the stub/runtime call.
4319 __ mov(eax, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); 4320 __ PushHeapObject(literals);
4320 __ push(FieldOperand(eax, JSFunction::kLiteralsOffset));
4321 __ push(Immediate(Smi::FromInt(instr->hydrogen()->literal_index()))); 4321 __ push(Immediate(Smi::FromInt(instr->hydrogen()->literal_index())));
4322 __ push(Immediate(constant_properties)); 4322 __ push(Immediate(constant_properties));
4323 int flags = instr->hydrogen()->fast_elements() 4323 int flags = instr->hydrogen()->fast_elements()
4324 ? ObjectLiteral::kFastElements 4324 ? ObjectLiteral::kFastElements
4325 : ObjectLiteral::kNoFlags; 4325 : ObjectLiteral::kNoFlags;
4326 flags |= instr->hydrogen()->has_function() 4326 flags |= instr->hydrogen()->has_function()
4327 ? ObjectLiteral::kHasFunction 4327 ? ObjectLiteral::kHasFunction
4328 : ObjectLiteral::kNoFlags; 4328 : ObjectLiteral::kNoFlags;
4329 __ push(Immediate(Smi::FromInt(flags))); 4329 __ push(Immediate(Smi::FromInt(flags)));
4330 4330
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
4680 this, pointers, Safepoint::kLazyDeopt); 4680 this, pointers, Safepoint::kLazyDeopt);
4681 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator); 4681 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator);
4682 } 4682 }
4683 4683
4684 4684
4685 #undef __ 4685 #undef __
4686 4686
4687 } } // namespace v8::internal 4687 } } // namespace v8::internal
4688 4688
4689 #endif // V8_TARGET_ARCH_IA32 4689 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ast.cc ('k') | src/mips/lithium-codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698