| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. |
| 6 #if defined(TARGET_ARCH_IA32) | 6 #if defined(TARGET_ARCH_IA32) |
| 7 | 7 |
| 8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
| 9 | 9 |
| 10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
| (...skipping 2062 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2073 // data area to be initialized. | 2073 // data area to be initialized. |
| 2074 if (num_elements > 0) { | 2074 if (num_elements > 0) { |
| 2075 const intptr_t array_size = instance_size - sizeof(RawArray); | 2075 const intptr_t array_size = instance_size - sizeof(RawArray); |
| 2076 const Immediate& raw_null = | 2076 const Immediate& raw_null = |
| 2077 Immediate(reinterpret_cast<intptr_t>(Object::null())); | 2077 Immediate(reinterpret_cast<intptr_t>(Object::null())); |
| 2078 __ leal(EDI, FieldAddress(EAX, sizeof(RawArray))); | 2078 __ leal(EDI, FieldAddress(EAX, sizeof(RawArray))); |
| 2079 if (array_size < (kInlineArraySize * kWordSize)) { | 2079 if (array_size < (kInlineArraySize * kWordSize)) { |
| 2080 intptr_t current_offset = 0; | 2080 intptr_t current_offset = 0; |
| 2081 __ movl(EBX, raw_null); | 2081 __ movl(EBX, raw_null); |
| 2082 while (current_offset < array_size) { | 2082 while (current_offset < array_size) { |
| 2083 __ movl(Address(EDI, current_offset), EBX); | 2083 __ StoreIntoObjectNoBarrier(EAX, Address(EDI, current_offset), EBX); |
| 2084 current_offset += kWordSize; | 2084 current_offset += kWordSize; |
| 2085 } | 2085 } |
| 2086 } else { | 2086 } else { |
| 2087 Label init_loop; | 2087 Label init_loop; |
| 2088 __ Bind(&init_loop); | 2088 __ Bind(&init_loop); |
| 2089 __ movl(Address(EDI, 0), raw_null); | 2089 __ StoreIntoObjectNoBarrier(EAX, Address(EDI, 0), Object::null_object()); |
| 2090 __ addl(EDI, Immediate(kWordSize)); | 2090 __ addl(EDI, Immediate(kWordSize)); |
| 2091 __ cmpl(EDI, EBX); | 2091 __ cmpl(EDI, EBX); |
| 2092 __ j(BELOW, &init_loop, Assembler::kNearJump); | 2092 __ j(BELOW, &init_loop, Assembler::kNearJump); |
| 2093 } | 2093 } |
| 2094 } | 2094 } |
| 2095 __ jmp(done, Assembler::kNearJump); | 2095 __ jmp(done, Assembler::kNearJump); |
| 2096 } | 2096 } |
| 2097 | 2097 |
| 2098 | 2098 |
| 2099 void CreateArrayInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2099 void CreateArrayInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| (...skipping 4508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6608 #if defined(DEBUG) | 6608 #if defined(DEBUG) |
| 6609 __ movl(EDX, Immediate(kInvalidObjectPointer)); | 6609 __ movl(EDX, Immediate(kInvalidObjectPointer)); |
| 6610 #endif | 6610 #endif |
| 6611 } | 6611 } |
| 6612 | 6612 |
| 6613 } // namespace dart | 6613 } // namespace dart |
| 6614 | 6614 |
| 6615 #undef __ | 6615 #undef __ |
| 6616 | 6616 |
| 6617 #endif // defined TARGET_ARCH_IA32 | 6617 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |