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 5515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5526 FastCloneShallowArrayStub::Mode mode = | 5526 FastCloneShallowArrayStub::Mode mode = |
5527 boilerplate_elements_kind == FAST_DOUBLE_ELEMENTS | 5527 boilerplate_elements_kind == FAST_DOUBLE_ELEMENTS |
5528 ? FastCloneShallowArrayStub::CLONE_DOUBLE_ELEMENTS | 5528 ? FastCloneShallowArrayStub::CLONE_DOUBLE_ELEMENTS |
5529 : FastCloneShallowArrayStub::CLONE_ELEMENTS; | 5529 : FastCloneShallowArrayStub::CLONE_ELEMENTS; |
5530 FastCloneShallowArrayStub stub(mode, allocation_site_mode, length); | 5530 FastCloneShallowArrayStub stub(mode, allocation_site_mode, length); |
5531 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); | 5531 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); |
5532 } | 5532 } |
5533 } | 5533 } |
5534 | 5534 |
5535 | 5535 |
5536 void LCodeGen::DoObjectLiteral(LObjectLiteral* instr) { | |
5537 Handle<FixedArray> literals = instr->hydrogen()->literals(); | |
5538 Handle<FixedArray> constant_properties = | |
5539 instr->hydrogen()->constant_properties(); | |
5540 | |
5541 // Set up the parameters to the stub/runtime call. | |
5542 __ LoadHeapObject(r3, literals); | |
5543 __ mov(r2, Operand(Smi::FromInt(instr->hydrogen()->literal_index()))); | |
5544 __ mov(r1, Operand(constant_properties)); | |
5545 int flags = instr->hydrogen()->fast_elements() | |
5546 ? ObjectLiteral::kFastElements | |
5547 : ObjectLiteral::kNoFlags; | |
5548 __ mov(r0, Operand(Smi::FromInt(flags))); | |
5549 | |
5550 // Pick the right runtime function or stub to call. | |
5551 int properties_count = instr->hydrogen()->constant_properties_length() / 2; | |
5552 if ((FLAG_track_double_fields && instr->hydrogen()->may_store_doubles()) || | |
5553 instr->hydrogen()->depth() > 1) { | |
5554 __ Push(r3, r2, r1, r0); | |
5555 CallRuntime(Runtime::kCreateObjectLiteral, 4, instr); | |
5556 } else if (flags != ObjectLiteral::kFastElements || | |
5557 properties_count > FastCloneShallowObjectStub::kMaximumClonedProperties) { | |
5558 __ Push(r3, r2, r1, r0); | |
5559 CallRuntime(Runtime::kCreateObjectLiteralShallow, 4, instr); | |
5560 } else { | |
5561 FastCloneShallowObjectStub stub(properties_count); | |
5562 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); | |
5563 } | |
5564 } | |
5565 | |
5566 | |
5567 void LCodeGen::DoToFastProperties(LToFastProperties* instr) { | 5536 void LCodeGen::DoToFastProperties(LToFastProperties* instr) { |
5568 ASSERT(ToRegister(instr->value()).is(r0)); | 5537 ASSERT(ToRegister(instr->value()).is(r0)); |
5569 __ push(r0); | 5538 __ push(r0); |
5570 CallRuntime(Runtime::kToFastProperties, 1, instr); | 5539 CallRuntime(Runtime::kToFastProperties, 1, instr); |
5571 } | 5540 } |
5572 | 5541 |
5573 | 5542 |
5574 void LCodeGen::DoRegExpLiteral(LRegExpLiteral* instr) { | 5543 void LCodeGen::DoRegExpLiteral(LRegExpLiteral* instr) { |
5575 Label materialized; | 5544 Label materialized; |
5576 // Registers will be used as follows: | 5545 // Registers will be used as follows: |
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5997 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); | 5966 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); |
5998 __ ldr(result, FieldMemOperand(scratch, | 5967 __ ldr(result, FieldMemOperand(scratch, |
5999 FixedArray::kHeaderSize - kPointerSize)); | 5968 FixedArray::kHeaderSize - kPointerSize)); |
6000 __ bind(&done); | 5969 __ bind(&done); |
6001 } | 5970 } |
6002 | 5971 |
6003 | 5972 |
6004 #undef __ | 5973 #undef __ |
6005 | 5974 |
6006 } } // namespace v8::internal | 5975 } } // namespace v8::internal |
OLD | NEW |