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/code_generator.h" | 8 #include "vm/code_generator.h" |
9 #include "vm/compiler.h" | 9 #include "vm/compiler.h" |
10 #include "vm/object_store.h" | 10 #include "vm/object_store.h" |
(...skipping 1240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1251 void StubCode::GenerateAllocationStubForClosure(Assembler* assembler, | 1251 void StubCode::GenerateAllocationStubForClosure(Assembler* assembler, |
1252 const Function& func) { | 1252 const Function& func) { |
1253 const Immediate raw_null = | 1253 const Immediate raw_null = |
1254 Immediate(reinterpret_cast<intptr_t>(Object::null())); | 1254 Immediate(reinterpret_cast<intptr_t>(Object::null())); |
1255 ASSERT(func.IsClosureFunction()); | 1255 ASSERT(func.IsClosureFunction()); |
1256 const bool is_implicit_static_closure = | 1256 const bool is_implicit_static_closure = |
1257 func.IsImplicitStaticClosureFunction(); | 1257 func.IsImplicitStaticClosureFunction(); |
1258 const bool is_implicit_instance_closure = | 1258 const bool is_implicit_instance_closure = |
1259 func.IsImplicitInstanceClosureFunction(); | 1259 func.IsImplicitInstanceClosureFunction(); |
1260 const Class& cls = Class::ZoneHandle(func.signature_class()); | 1260 const Class& cls = Class::ZoneHandle(func.signature_class()); |
1261 const bool is_cls_parameterized = cls.IsParameterized(); | 1261 const bool is_cls_parameterized = cls.NumTypeArguments() > 0; |
1262 const intptr_t kTypeArgumentsOffset = 1 * kWordSize; | 1262 const intptr_t kTypeArgumentsOffset = 1 * kWordSize; |
1263 const intptr_t kReceiverOffset = (is_cls_parameterized ? 2 : 1) * kWordSize; | 1263 const intptr_t kReceiverOffset = (is_cls_parameterized ? 2 : 1) * kWordSize; |
1264 const intptr_t closure_size = Closure::InstanceSize(); | 1264 const intptr_t closure_size = Closure::InstanceSize(); |
1265 const intptr_t context_size = Context::InstanceSize(1); // Captured receiver. | 1265 const intptr_t context_size = Context::InstanceSize(1); // Captured receiver. |
1266 if (FLAG_inline_alloc && | 1266 if (FLAG_inline_alloc && |
1267 PageSpace::IsPageAllocatableSize(closure_size + context_size)) { | 1267 PageSpace::IsPageAllocatableSize(closure_size + context_size)) { |
1268 Label slow_case; | 1268 Label slow_case; |
1269 Heap* heap = Isolate::Current()->heap(); | 1269 Heap* heap = Isolate::Current()->heap(); |
1270 __ movl(EAX, Address::Absolute(heap->TopAddress())); | 1270 __ movl(EAX, Address::Absolute(heap->TopAddress())); |
1271 __ leal(EBX, Address(EAX, closure_size)); | 1271 __ leal(EBX, Address(EAX, closure_size)); |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1445 __ popl(EAX); // Get result into EAX. | 1445 __ popl(EAX); // Get result into EAX. |
1446 | 1446 |
1447 // Remove the stub frame as we are about to return. | 1447 // Remove the stub frame as we are about to return. |
1448 __ LeaveFrame(); | 1448 __ LeaveFrame(); |
1449 __ ret(); | 1449 __ ret(); |
1450 } | 1450 } |
1451 | 1451 |
1452 } // namespace dart | 1452 } // namespace dart |
1453 | 1453 |
1454 #endif // defined TARGET_ARCH_IA32 | 1454 #endif // defined TARGET_ARCH_IA32 |
OLD | NEW |