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 4908 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4919 // Pick the right runtime function or stub to call. | 4919 // Pick the right runtime function or stub to call. |
4920 int length = instr->hydrogen()->length(); | 4920 int length = instr->hydrogen()->length(); |
4921 if (instr->hydrogen()->IsCopyOnWrite()) { | 4921 if (instr->hydrogen()->IsCopyOnWrite()) { |
4922 ASSERT(instr->hydrogen()->depth() == 1); | 4922 ASSERT(instr->hydrogen()->depth() == 1); |
4923 FastCloneShallowArrayStub::Mode mode = | 4923 FastCloneShallowArrayStub::Mode mode = |
4924 FastCloneShallowArrayStub::COPY_ON_WRITE_ELEMENTS; | 4924 FastCloneShallowArrayStub::COPY_ON_WRITE_ELEMENTS; |
4925 FastCloneShallowArrayStub stub(mode, length); | 4925 FastCloneShallowArrayStub stub(mode, length); |
4926 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | 4926 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
4927 } else if (instr->hydrogen()->depth() > 1) { | 4927 } else if (instr->hydrogen()->depth() > 1) { |
4928 CallRuntime(Runtime::kCreateArrayLiteral, 3, instr); | 4928 CallRuntime(Runtime::kCreateArrayLiteral, 3, instr); |
4929 } else if (length > FastCloneShallowArrayStub::kMaximumClonedLength) { | 4929 } else if (length > FastCloneShallowArrayStub::MaximumClonedLength()) { |
4930 CallRuntime(Runtime::kCreateArrayLiteralShallow, 3, instr); | 4930 CallRuntime(Runtime::kCreateArrayLiteralShallow, 3, instr); |
4931 } else { | 4931 } else { |
4932 FastCloneShallowArrayStub::Mode mode = | 4932 FastCloneShallowArrayStub::Mode mode = |
4933 boilerplate_elements_kind == FAST_DOUBLE_ELEMENTS | 4933 boilerplate_elements_kind == FAST_DOUBLE_ELEMENTS |
4934 ? FastCloneShallowArrayStub::CLONE_DOUBLE_ELEMENTS | 4934 ? FastCloneShallowArrayStub::CLONE_DOUBLE_ELEMENTS |
4935 : FastCloneShallowArrayStub::CLONE_ELEMENTS; | 4935 : FastCloneShallowArrayStub::CLONE_ELEMENTS; |
4936 FastCloneShallowArrayStub stub(mode, length); | 4936 FastCloneShallowArrayStub stub(mode, length); |
4937 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | 4937 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
4938 } | 4938 } |
4939 } | 4939 } |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5106 flags |= instr->hydrogen()->has_function() | 5106 flags |= instr->hydrogen()->has_function() |
5107 ? ObjectLiteral::kHasFunction | 5107 ? ObjectLiteral::kHasFunction |
5108 : ObjectLiteral::kNoFlags; | 5108 : ObjectLiteral::kNoFlags; |
5109 __ push(Immediate(Smi::FromInt(flags))); | 5109 __ push(Immediate(Smi::FromInt(flags))); |
5110 | 5110 |
5111 // Pick the right runtime function or stub to call. | 5111 // Pick the right runtime function or stub to call. |
5112 int properties_count = constant_properties->length() / 2; | 5112 int properties_count = constant_properties->length() / 2; |
5113 if (instr->hydrogen()->depth() > 1) { | 5113 if (instr->hydrogen()->depth() > 1) { |
5114 CallRuntime(Runtime::kCreateObjectLiteral, 4, instr); | 5114 CallRuntime(Runtime::kCreateObjectLiteral, 4, instr); |
5115 } else if (flags != ObjectLiteral::kFastElements || | 5115 } else if (flags != ObjectLiteral::kFastElements || |
5116 properties_count > FastCloneShallowObjectStub::kMaximumClonedProperties) { | 5116 properties_count > |
| 5117 FastCloneShallowObjectStub::MaximumClonedProperties()) { |
5117 CallRuntime(Runtime::kCreateObjectLiteralShallow, 4, instr); | 5118 CallRuntime(Runtime::kCreateObjectLiteralShallow, 4, instr); |
5118 } else { | 5119 } else { |
5119 FastCloneShallowObjectStub stub(properties_count); | 5120 FastCloneShallowObjectStub stub(properties_count); |
5120 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | 5121 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
5121 } | 5122 } |
5122 } | 5123 } |
5123 | 5124 |
5124 | 5125 |
5125 void LCodeGen::DoToFastProperties(LToFastProperties* instr) { | 5126 void LCodeGen::DoToFastProperties(LToFastProperties* instr) { |
5126 ASSERT(ToRegister(instr->InputAt(0)).is(eax)); | 5127 ASSERT(ToRegister(instr->InputAt(0)).is(eax)); |
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5545 FixedArray::kHeaderSize - kPointerSize)); | 5546 FixedArray::kHeaderSize - kPointerSize)); |
5546 __ bind(&done); | 5547 __ bind(&done); |
5547 } | 5548 } |
5548 | 5549 |
5549 | 5550 |
5550 #undef __ | 5551 #undef __ |
5551 | 5552 |
5552 } } // namespace v8::internal | 5553 } } // namespace v8::internal |
5553 | 5554 |
5554 #endif // V8_TARGET_ARCH_IA32 | 5555 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |