| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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" | 5 #include "vm/globals.h" |
| 6 #if defined(TARGET_ARCH_IA32) | 6 #if defined(TARGET_ARCH_IA32) |
| 7 | 7 |
| 8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
| 9 #include "vm/assembler_macros.h" | 9 #include "vm/assembler_macros.h" |
| 10 #include "vm/code_generator.h" | 10 #include "vm/code_generator.h" |
| (...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 608 // Uses EAX, EBX, ECX, EDI as temporary registers. | 608 // Uses EAX, EBX, ECX, EDI as temporary registers. |
| 609 // NOTE: EDX cannot be clobbered here as the caller relies on it being saved. | 609 // NOTE: EDX cannot be clobbered here as the caller relies on it being saved. |
| 610 // The newly allocated object is returned in EAX. | 610 // The newly allocated object is returned in EAX. |
| 611 void StubCode::GenerateAllocateArrayStub(Assembler* assembler) { | 611 void StubCode::GenerateAllocateArrayStub(Assembler* assembler) { |
| 612 Label slow_case; | 612 Label slow_case; |
| 613 const Immediate raw_null = | 613 const Immediate raw_null = |
| 614 Immediate(reinterpret_cast<intptr_t>(Object::null())); | 614 Immediate(reinterpret_cast<intptr_t>(Object::null())); |
| 615 | 615 |
| 616 if (FLAG_inline_alloc) { | 616 if (FLAG_inline_alloc) { |
| 617 // Compute the size to be allocated, it is based on the array length | 617 // Compute the size to be allocated, it is based on the array length |
| 618 // and it computed as: | 618 // and is computed as: |
| 619 // RoundedAllocationSize((array_length * kwordSize) + sizeof(RawArray)). | 619 // RoundedAllocationSize((array_length * kwordSize) + sizeof(RawArray)). |
| 620 // Assert that length is a Smi. | 620 // Assert that length is a Smi. |
| 621 __ testl(EDX, Immediate(kSmiTagSize)); | 621 __ testl(EDX, Immediate(kSmiTagSize)); |
| 622 if (FLAG_use_slow_path) { | 622 if (FLAG_use_slow_path) { |
| 623 __ jmp(&slow_case); | 623 __ jmp(&slow_case); |
| 624 } else { | 624 } else { |
| 625 __ j(NOT_ZERO, &slow_case); | 625 __ j(NOT_ZERO, &slow_case); |
| 626 } | 626 } |
| 627 __ movl(EDI, FieldAddress(CTX, Context::isolate_offset())); | 627 __ movl(EDI, FieldAddress(CTX, Context::isolate_offset())); |
| 628 __ movl(EDI, Address(EDI, Isolate::heap_offset())); | 628 __ movl(EDI, Address(EDI, Isolate::heap_offset())); |
| (...skipping 1273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1902 // TOS + 2: instance. | 1902 // TOS + 2: instance. |
| 1903 // TOS + 3: cache array. | 1903 // TOS + 3: cache array. |
| 1904 // Result in ECX: null -> not found, otherwise result (true or false). | 1904 // Result in ECX: null -> not found, otherwise result (true or false). |
| 1905 void StubCode::GenerateSubtype3TestCacheStub(Assembler* assembler) { | 1905 void StubCode::GenerateSubtype3TestCacheStub(Assembler* assembler) { |
| 1906 GenerateSubtypeNTestCacheStub(assembler, 3); | 1906 GenerateSubtypeNTestCacheStub(assembler, 3); |
| 1907 } | 1907 } |
| 1908 | 1908 |
| 1909 } // namespace dart | 1909 } // namespace dart |
| 1910 | 1910 |
| 1911 #endif // defined TARGET_ARCH_IA32 | 1911 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |