OLD | NEW |
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 4316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4327 __ bind(&allocated); | 4327 __ bind(&allocated); |
4328 int offset = 0; | 4328 int offset = 0; |
4329 __ LoadHeapObject(a1, instr->hydrogen()->boilerplate()); | 4329 __ LoadHeapObject(a1, instr->hydrogen()->boilerplate()); |
4330 EmitDeepCopy(instr->hydrogen()->boilerplate(), v0, a1, &offset); | 4330 EmitDeepCopy(instr->hydrogen()->boilerplate(), v0, a1, &offset); |
4331 ASSERT_EQ(size, offset); | 4331 ASSERT_EQ(size, offset); |
4332 } | 4332 } |
4333 | 4333 |
4334 | 4334 |
4335 void LCodeGen::DoObjectLiteralGeneric(LObjectLiteralGeneric* instr) { | 4335 void LCodeGen::DoObjectLiteralGeneric(LObjectLiteralGeneric* instr) { |
4336 ASSERT(ToRegister(instr->result()).is(v0)); | 4336 ASSERT(ToRegister(instr->result()).is(v0)); |
4337 | 4337 Handle<FixedArray> literals(instr->environment()->closure()->literals()); |
4338 Handle<FixedArray> constant_properties = | 4338 Handle<FixedArray> constant_properties = |
4339 instr->hydrogen()->constant_properties(); | 4339 instr->hydrogen()->constant_properties(); |
4340 | 4340 |
4341 __ lw(t0, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 4341 // Set up the parameters to the stub/runtime call. |
4342 __ lw(t0, FieldMemOperand(t0, JSFunction::kLiteralsOffset)); | 4342 __ LoadHeapObject(t0, literals); |
4343 __ li(a3, Operand(Smi::FromInt(instr->hydrogen()->literal_index()))); | 4343 __ li(a3, Operand(Smi::FromInt(instr->hydrogen()->literal_index()))); |
4344 __ li(a2, Operand(constant_properties)); | 4344 __ li(a2, Operand(constant_properties)); |
4345 int flags = instr->hydrogen()->fast_elements() | 4345 int flags = instr->hydrogen()->fast_elements() |
4346 ? ObjectLiteral::kFastElements | 4346 ? ObjectLiteral::kFastElements |
4347 : ObjectLiteral::kNoFlags; | 4347 : ObjectLiteral::kNoFlags; |
4348 __ li(a1, Operand(Smi::FromInt(flags))); | 4348 __ li(a1, Operand(Smi::FromInt(flags))); |
4349 __ Push(t0, a3, a2, a1); | 4349 __ Push(t0, a3, a2, a1); |
4350 | 4350 |
4351 // Pick the right runtime function to call. | 4351 // Pick the right runtime function or stub to call. |
4352 int properties_count = constant_properties->length() / 2; | 4352 int properties_count = constant_properties->length() / 2; |
4353 if (instr->hydrogen()->depth() > 1) { | 4353 if (instr->hydrogen()->depth() > 1) { |
4354 CallRuntime(Runtime::kCreateObjectLiteral, 4, instr); | 4354 CallRuntime(Runtime::kCreateObjectLiteral, 4, instr); |
4355 } else if (flags != ObjectLiteral::kFastElements || | 4355 } else if (flags != ObjectLiteral::kFastElements || |
4356 properties_count > FastCloneShallowObjectStub::kMaximumClonedProperties) { | 4356 properties_count > FastCloneShallowObjectStub::kMaximumClonedProperties) { |
4357 CallRuntime(Runtime::kCreateObjectLiteralShallow, 4, instr); | 4357 CallRuntime(Runtime::kCreateObjectLiteralShallow, 4, instr); |
4358 } else { | 4358 } else { |
4359 FastCloneShallowObjectStub stub(properties_count); | 4359 FastCloneShallowObjectStub stub(properties_count); |
4360 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | 4360 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
4361 } | 4361 } |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4736 ASSERT(!environment->HasBeenRegistered()); | 4736 ASSERT(!environment->HasBeenRegistered()); |
4737 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); | 4737 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); |
4738 ASSERT(osr_pc_offset_ == -1); | 4738 ASSERT(osr_pc_offset_ == -1); |
4739 osr_pc_offset_ = masm()->pc_offset(); | 4739 osr_pc_offset_ = masm()->pc_offset(); |
4740 } | 4740 } |
4741 | 4741 |
4742 | 4742 |
4743 #undef __ | 4743 #undef __ |
4744 | 4744 |
4745 } } // namespace v8::internal | 4745 } } // namespace v8::internal |
OLD | NEW |