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

Side by Side Diff: runtime/vm/intrinsifier_ia32.cc

Issue 721233002: Write barrier audit: Verify previous value in generated code. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 1 month 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
OLDNEW
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 // The intrinsic code below is executed before a method has built its frame. 5 // The intrinsic code below is executed before a method has built its frame.
6 // The return address is on the stack and the arguments below it. 6 // The return address is on the stack and the arguments below it.
7 // Registers EDX (arguments descriptor) and ECX (function) must be preserved. 7 // Registers EDX (arguments descriptor) and ECX (function) must be preserved.
8 // Each intrinsification method returns true if the corresponding 8 // Each intrinsification method returns true if the corresponding
9 // Dart method was intrinsified. 9 // Dart method was intrinsified.
10 10
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 // This snippet of inlined code uses the following registers: 107 // This snippet of inlined code uses the following registers:
108 // EAX, EBX 108 // EAX, EBX
109 // and the newly allocated object is returned in EAX. 109 // and the newly allocated object is returned in EAX.
110 const intptr_t kTypeArgumentsOffset = 2 * kWordSize; 110 const intptr_t kTypeArgumentsOffset = 2 * kWordSize;
111 const intptr_t kArrayOffset = 1 * kWordSize; 111 const intptr_t kArrayOffset = 1 * kWordSize;
112 Label fall_through; 112 Label fall_through;
113 113
114 // Try allocating in new space. 114 // Try allocating in new space.
115 const Class& cls = Class::Handle( 115 const Class& cls = Class::Handle(
116 Isolate::Current()->object_store()->growable_object_array_class()); 116 Isolate::Current()->object_store()->growable_object_array_class());
117 const bool jump_length = VerifiedMemory::enabled() ? 117 __ TryAllocate(cls, &fall_through, Assembler::kNearJump, EAX, EBX);
118 Assembler::kFarJump :
119 Assembler::kNearJump;
120 __ TryAllocate(cls, &fall_through, jump_length, EAX, EBX);
121 118
122 // Store backing array object in growable array object. 119 // Store backing array object in growable array object.
123 __ movl(EBX, Address(ESP, kArrayOffset)); // data argument. 120 __ movl(EBX, Address(ESP, kArrayOffset)); // data argument.
124 // EAX is new, no barrier needed. 121 // EAX is new, no barrier needed.
125 __ StoreIntoObjectNoBarrier( 122 __ StoreIntoObjectNoBarrier(
126 EAX, 123 EAX,
127 FieldAddress(EAX, GrowableObjectArray::data_offset()), 124 FieldAddress(EAX, GrowableObjectArray::data_offset()),
128 EBX); 125 EBX);
129 126
130 // EAX: new growable array object start as a tagged pointer. 127 // EAX: new growable array object start as a tagged pointer.
(...skipping 1962 matching lines...) Expand 10 before | Expand all | Expand 10 after
2093 Isolate::current_tag_offset()); 2090 Isolate::current_tag_offset());
2094 // Set return value to Isolate::current_tag_. 2091 // Set return value to Isolate::current_tag_.
2095 __ movl(EAX, current_tag_addr); 2092 __ movl(EAX, current_tag_addr);
2096 __ ret(); 2093 __ ret();
2097 } 2094 }
2098 2095
2099 #undef __ 2096 #undef __
2100 } // namespace dart 2097 } // namespace dart
2101 2098
2102 #endif // defined TARGET_ARCH_IA32 2099 #endif // defined TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698