| 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 4680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4691 // Pick the right runtime function or stub to call. | 4691 // Pick the right runtime function or stub to call. |
| 4692 int length = instr->hydrogen()->length(); | 4692 int length = instr->hydrogen()->length(); |
| 4693 if (instr->hydrogen()->IsCopyOnWrite()) { | 4693 if (instr->hydrogen()->IsCopyOnWrite()) { |
| 4694 ASSERT(instr->hydrogen()->depth() == 1); | 4694 ASSERT(instr->hydrogen()->depth() == 1); |
| 4695 FastCloneShallowArrayStub::Mode mode = | 4695 FastCloneShallowArrayStub::Mode mode = |
| 4696 FastCloneShallowArrayStub::COPY_ON_WRITE_ELEMENTS; | 4696 FastCloneShallowArrayStub::COPY_ON_WRITE_ELEMENTS; |
| 4697 FastCloneShallowArrayStub stub(mode, length); | 4697 FastCloneShallowArrayStub stub(mode, length); |
| 4698 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | 4698 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
| 4699 } else if (instr->hydrogen()->depth() > 1) { | 4699 } else if (instr->hydrogen()->depth() > 1) { |
| 4700 CallRuntime(Runtime::kCreateArrayLiteral, 3, instr); | 4700 CallRuntime(Runtime::kCreateArrayLiteral, 3, instr); |
| 4701 } else if (length > FastCloneShallowArrayStub::kMaximumClonedLength) { | 4701 } else if (length > FastCloneShallowArrayStub::MaximumClonedLength()) { |
| 4702 CallRuntime(Runtime::kCreateArrayLiteralShallow, 3, instr); | 4702 CallRuntime(Runtime::kCreateArrayLiteralShallow, 3, instr); |
| 4703 } else { | 4703 } else { |
| 4704 FastCloneShallowArrayStub::Mode mode = | 4704 FastCloneShallowArrayStub::Mode mode = |
| 4705 boilerplate_elements_kind == FAST_DOUBLE_ELEMENTS | 4705 boilerplate_elements_kind == FAST_DOUBLE_ELEMENTS |
| 4706 ? FastCloneShallowArrayStub::CLONE_DOUBLE_ELEMENTS | 4706 ? FastCloneShallowArrayStub::CLONE_DOUBLE_ELEMENTS |
| 4707 : FastCloneShallowArrayStub::CLONE_ELEMENTS; | 4707 : FastCloneShallowArrayStub::CLONE_ELEMENTS; |
| 4708 FastCloneShallowArrayStub stub(mode, length); | 4708 FastCloneShallowArrayStub stub(mode, length); |
| 4709 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | 4709 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
| 4710 } | 4710 } |
| 4711 } | 4711 } |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4863 flags |= instr->hydrogen()->has_function() | 4863 flags |= instr->hydrogen()->has_function() |
| 4864 ? ObjectLiteral::kHasFunction | 4864 ? ObjectLiteral::kHasFunction |
| 4865 : ObjectLiteral::kNoFlags; | 4865 : ObjectLiteral::kNoFlags; |
| 4866 __ Push(Smi::FromInt(flags)); | 4866 __ Push(Smi::FromInt(flags)); |
| 4867 | 4867 |
| 4868 // Pick the right runtime function or stub to call. | 4868 // Pick the right runtime function or stub to call. |
| 4869 int properties_count = constant_properties->length() / 2; | 4869 int properties_count = constant_properties->length() / 2; |
| 4870 if (instr->hydrogen()->depth() > 1) { | 4870 if (instr->hydrogen()->depth() > 1) { |
| 4871 CallRuntime(Runtime::kCreateObjectLiteral, 4, instr); | 4871 CallRuntime(Runtime::kCreateObjectLiteral, 4, instr); |
| 4872 } else if (flags != ObjectLiteral::kFastElements || | 4872 } else if (flags != ObjectLiteral::kFastElements || |
| 4873 properties_count > FastCloneShallowObjectStub::kMaximumClonedProperties) { | 4873 properties_count > |
| 4874 FastCloneShallowObjectStub::MaximumClonedProperties()) { |
| 4874 CallRuntime(Runtime::kCreateObjectLiteralShallow, 4, instr); | 4875 CallRuntime(Runtime::kCreateObjectLiteralShallow, 4, instr); |
| 4875 } else { | 4876 } else { |
| 4876 FastCloneShallowObjectStub stub(properties_count); | 4877 FastCloneShallowObjectStub stub(properties_count); |
| 4877 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | 4878 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
| 4878 } | 4879 } |
| 4879 } | 4880 } |
| 4880 | 4881 |
| 4881 | 4882 |
| 4882 void LCodeGen::DoToFastProperties(LToFastProperties* instr) { | 4883 void LCodeGen::DoToFastProperties(LToFastProperties* instr) { |
| 4883 ASSERT(ToRegister(instr->InputAt(0)).is(rax)); | 4884 ASSERT(ToRegister(instr->InputAt(0)).is(rax)); |
| (...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5313 FixedArray::kHeaderSize - kPointerSize)); | 5314 FixedArray::kHeaderSize - kPointerSize)); |
| 5314 __ bind(&done); | 5315 __ bind(&done); |
| 5315 } | 5316 } |
| 5316 | 5317 |
| 5317 | 5318 |
| 5318 #undef __ | 5319 #undef __ |
| 5319 | 5320 |
| 5320 } } // namespace v8::internal | 5321 } } // namespace v8::internal |
| 5321 | 5322 |
| 5322 #endif // V8_TARGET_ARCH_X64 | 5323 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |