Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: vm/stub_code_ia32.cc

Issue 9021025: Check all cases with "__ movl(FieldAddress" and converted them to StoreIntoObject where appropriate. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « vm/intrinsifier_ia32.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/code_generator.h" 8 #include "vm/code_generator.h"
9 #include "vm/compiler.h" 9 #include "vm/compiler.h"
10 #include "vm/ic_data.h" 10 #include "vm/ic_data.h"
(...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after
652 // EDI: Points to new space object. 652 // EDI: Points to new space object.
653 __ movl(Address(EDI, Scavenger::top_offset()), EBX); 653 __ movl(Address(EDI, Scavenger::top_offset()), EBX);
654 __ addl(EAX, Immediate(kHeapObjectTag)); 654 __ addl(EAX, Immediate(kHeapObjectTag));
655 655
656 // EAX: new object start as a tagged pointer. 656 // EAX: new object start as a tagged pointer.
657 // EBX: new object end address. 657 // EBX: new object end address.
658 // ECX: array element type. 658 // ECX: array element type.
659 // EDX: Array length as Smi. 659 // EDX: Array length as Smi.
660 660
661 // Store the type argument field. 661 // Store the type argument field.
662 __ movl(FieldAddress(EAX, Array::type_arguments_offset()), ECX); 662 __ StoreIntoObject(EAX,
663 FieldAddress(EAX, Array::type_arguments_offset()),
664 ECX);
663 665
664 // Set the length field. 666 // Set the length field.
665 __ movl(FieldAddress(EAX, Array::length_offset()), EDX); 667 __ StoreIntoObject(EAX,
668 FieldAddress(EAX, Array::length_offset()),
669 EDX);
666 670
667 // Store class value for array. 671 // Store class value for array.
668 __ movl(ECX, FieldAddress(CTX, Context::isolate_offset())); 672 __ movl(ECX, FieldAddress(CTX, Context::isolate_offset()));
669 __ movl(ECX, Address(ECX, Isolate::object_store_offset())); 673 __ movl(ECX, Address(ECX, Isolate::object_store_offset()));
670 __ movl(ECX, Address(ECX, ObjectStore::array_class_offset())); 674 __ movl(ECX, Address(ECX, ObjectStore::array_class_offset()));
671 __ movl(FieldAddress(EAX, Array::class_offset()), ECX); 675 __ StoreIntoObject(EAX,
676 FieldAddress(EAX, Array::class_offset()),
677 ECX);
672 __ movl(FieldAddress(EAX, Array::tags_offset()), Immediate(0)); // Tags. 678 __ movl(FieldAddress(EAX, Array::tags_offset()), Immediate(0)); // Tags.
673 679
674 // Initialize all array elements to raw_null. 680 // Initialize all array elements to raw_null.
675 // EAX: new object start as a tagged pointer. 681 // EAX: new object start as a tagged pointer.
676 // EBX: new object end address. 682 // EBX: new object end address.
677 // ECX: iterator which initially points to the start of the variable 683 // ECX: iterator which initially points to the start of the variable
678 // data area to be initialized. 684 // data area to be initialized.
679 __ leal(ECX, FieldAddress(EAX, Array::data_offset())); 685 __ leal(ECX, FieldAddress(EAX, Array::data_offset()));
680 Label done; 686 Label done;
681 Label init_loop; 687 Label init_loop;
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
962 // EAX: new object. 968 // EAX: new object.
963 // EBX: next object start. 969 // EBX: next object start.
964 // EDX: number of context variables. 970 // EDX: number of context variables.
965 __ movl(Address::Absolute(heap->TopAddress()), EBX); 971 __ movl(Address::Absolute(heap->TopAddress()), EBX);
966 __ addl(EAX, Immediate(kHeapObjectTag)); 972 __ addl(EAX, Immediate(kHeapObjectTag));
967 973
968 // Initialize the class field in the context object. 974 // Initialize the class field in the context object.
969 // EAX: new object. 975 // EAX: new object.
970 // EDX: number of context variables. 976 // EDX: number of context variables.
971 __ LoadObject(EBX, context_class); // Load up class field of context. 977 __ LoadObject(EBX, context_class); // Load up class field of context.
972 __ movl(FieldAddress(EAX, Context::class_offset()), EBX); 978 __ StoreIntoObject(EAX,
979 FieldAddress(EAX, Context::class_offset()),
980 EBX);
973 __ movl(FieldAddress(EAX, Context::tags_offset()), Immediate(0)); // Tags. 981 __ movl(FieldAddress(EAX, Context::tags_offset()), Immediate(0)); // Tags.
974 982
975 // Setup up number of context variables field. 983 // Setup up number of context variables field.
976 // EAX: new object. 984 // EAX: new object.
977 // EDX: number of context variables. 985 // EDX: number of context variables as integer value (not object).
978 __ movl(FieldAddress(EAX, Context::num_variables_offset()), EDX); 986 __ movl(FieldAddress(EAX, Context::num_variables_offset()), EDX);
979 987
980 // Setup isolate field. 988 // Setup isolate field.
981 // Load Isolate pointer from Context structure into EBX. 989 // Load Isolate pointer from Context structure into EBX.
982 // EAX: new object. 990 // EAX: new object.
983 // EDX: number of context variables. 991 // EDX: number of context variables.
984 __ movl(EBX, FieldAddress(CTX, Context::isolate_offset())); 992 __ movl(EBX, FieldAddress(CTX, Context::isolate_offset()));
993 // EBX: Isolate, not an object.
985 __ movl(FieldAddress(EAX, Context::isolate_offset()), EBX); 994 __ movl(FieldAddress(EAX, Context::isolate_offset()), EBX);
986 995
987 const Immediate raw_null = 996 const Immediate raw_null =
988 Immediate(reinterpret_cast<intptr_t>(Object::null())); 997 Immediate(reinterpret_cast<intptr_t>(Object::null()));
989 // Setup the parent field. 998 // Setup the parent field.
990 // EAX: new object. 999 // EAX: new object.
991 // EDX: number of context variables. 1000 // EDX: number of context variables.
992 __ movl(FieldAddress(EAX, Context::parent_offset()), raw_null); 1001 __ movl(FieldAddress(EAX, Context::parent_offset()), raw_null);
993 1002
994 // Initialize the context variables. 1003 // Initialize the context variables.
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after
1633 __ popl(EDX); 1642 __ popl(EDX);
1634 __ popl(ECX); 1643 __ popl(ECX);
1635 __ LeaveFrame(); 1644 __ LeaveFrame();
1636 // Now call the dynamic function. 1645 // Now call the dynamic function.
1637 __ jmp(&StubCode::OneArgCheckInlineCacheLabel()); 1646 __ jmp(&StubCode::OneArgCheckInlineCacheLabel());
1638 } 1647 }
1639 1648
1640 } // namespace dart 1649 } // namespace dart
1641 1650
1642 #endif // defined TARGET_ARCH_IA32 1651 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « vm/intrinsifier_ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698