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 5219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5230 FastCloneShallowArrayStub::Mode mode = | 5230 FastCloneShallowArrayStub::Mode mode = |
5231 boilerplate_elements_kind == FAST_DOUBLE_ELEMENTS | 5231 boilerplate_elements_kind == FAST_DOUBLE_ELEMENTS |
5232 ? FastCloneShallowArrayStub::CLONE_DOUBLE_ELEMENTS | 5232 ? FastCloneShallowArrayStub::CLONE_DOUBLE_ELEMENTS |
5233 : FastCloneShallowArrayStub::CLONE_ELEMENTS; | 5233 : FastCloneShallowArrayStub::CLONE_ELEMENTS; |
5234 FastCloneShallowArrayStub stub(mode, allocation_site_mode, length); | 5234 FastCloneShallowArrayStub stub(mode, allocation_site_mode, length); |
5235 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); | 5235 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); |
5236 } | 5236 } |
5237 } | 5237 } |
5238 | 5238 |
5239 | 5239 |
5240 void LCodeGen::DoObjectLiteral(LObjectLiteral* instr) { | |
5241 ASSERT(ToRegister(instr->result()).is(v0)); | |
5242 Handle<FixedArray> literals = instr->hydrogen()->literals(); | |
5243 Handle<FixedArray> constant_properties = | |
5244 instr->hydrogen()->constant_properties(); | |
5245 | |
5246 // Set up the parameters to the stub/runtime call. | |
5247 __ LoadHeapObject(a3, literals); | |
5248 __ li(a2, Operand(Smi::FromInt(instr->hydrogen()->literal_index()))); | |
5249 __ li(a1, Operand(constant_properties)); | |
5250 int flags = instr->hydrogen()->fast_elements() | |
5251 ? ObjectLiteral::kFastElements | |
5252 : ObjectLiteral::kNoFlags; | |
5253 __ li(a0, Operand(Smi::FromInt(flags))); | |
5254 | |
5255 // Pick the right runtime function or stub to call. | |
5256 int properties_count = instr->hydrogen()->constant_properties_length() / 2; | |
5257 if ((FLAG_track_double_fields && instr->hydrogen()->may_store_doubles()) || | |
5258 instr->hydrogen()->depth() > 1) { | |
5259 __ Push(a3, a2, a1, a0); | |
5260 CallRuntime(Runtime::kCreateObjectLiteral, 4, instr); | |
5261 } else if (flags != ObjectLiteral::kFastElements || | |
5262 properties_count > FastCloneShallowObjectStub::kMaximumClonedProperties) { | |
5263 __ Push(a3, a2, a1, a0); | |
5264 CallRuntime(Runtime::kCreateObjectLiteralShallow, 4, instr); | |
5265 } else { | |
5266 FastCloneShallowObjectStub stub(properties_count); | |
5267 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); | |
5268 } | |
5269 } | |
5270 | |
5271 | |
5272 void LCodeGen::DoToFastProperties(LToFastProperties* instr) { | 5240 void LCodeGen::DoToFastProperties(LToFastProperties* instr) { |
5273 ASSERT(ToRegister(instr->value()).is(a0)); | 5241 ASSERT(ToRegister(instr->value()).is(a0)); |
5274 ASSERT(ToRegister(instr->result()).is(v0)); | 5242 ASSERT(ToRegister(instr->result()).is(v0)); |
5275 __ push(a0); | 5243 __ push(a0); |
5276 CallRuntime(Runtime::kToFastProperties, 1, instr); | 5244 CallRuntime(Runtime::kToFastProperties, 1, instr); |
5277 } | 5245 } |
5278 | 5246 |
5279 | 5247 |
5280 void LCodeGen::DoRegExpLiteral(LRegExpLiteral* instr) { | 5248 void LCodeGen::DoRegExpLiteral(LRegExpLiteral* instr) { |
5281 Label materialized; | 5249 Label materialized; |
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5743 __ Subu(scratch, result, scratch); | 5711 __ Subu(scratch, result, scratch); |
5744 __ lw(result, FieldMemOperand(scratch, | 5712 __ lw(result, FieldMemOperand(scratch, |
5745 FixedArray::kHeaderSize - kPointerSize)); | 5713 FixedArray::kHeaderSize - kPointerSize)); |
5746 __ bind(&done); | 5714 __ bind(&done); |
5747 } | 5715 } |
5748 | 5716 |
5749 | 5717 |
5750 #undef __ | 5718 #undef __ |
5751 | 5719 |
5752 } } // namespace v8::internal | 5720 } } // namespace v8::internal |
OLD | NEW |