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

Side by Side Diff: vm/intermediate_language_ia32.cc

Issue 10535180: Allow implicit 'close your eyes' of native methods. This will hopefully fix issue 3466. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 6 months 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/intermediate_language.h ('k') | vm/intermediate_language_x64.cc » ('j') | 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 "lib/error.h" 10 #include "lib/error.h"
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after
561 561
562 562
563 void NativeCallComp::EmitNativeCode(FlowGraphCompiler* compiler) { 563 void NativeCallComp::EmitNativeCode(FlowGraphCompiler* compiler) {
564 ASSERT(locs()->temp(0).reg() == EAX); 564 ASSERT(locs()->temp(0).reg() == EAX);
565 ASSERT(locs()->temp(1).reg() == ECX); 565 ASSERT(locs()->temp(1).reg() == ECX);
566 ASSERT(locs()->temp(2).reg() == EDX); 566 ASSERT(locs()->temp(2).reg() == EDX);
567 Register result = locs()->out().reg(); 567 Register result = locs()->out().reg();
568 // Push the result place holder initialized to NULL. 568 // Push the result place holder initialized to NULL.
569 __ PushObject(Object::ZoneHandle()); 569 __ PushObject(Object::ZoneHandle());
570 // Pass a pointer to the first argument in EAX. 570 // Pass a pointer to the first argument in EAX.
571 if (!has_optional_parameters()) { 571 intptr_t arg_count = argument_count();
572 __ leal(EAX, Address(EBP, (1 + argument_count()) * kWordSize)); 572 if (is_native_instance_closure()) {
573 arg_count += 1;
574 }
575 if (!has_optional_parameters() && !is_native_instance_closure()) {
576 __ leal(EAX, Address(EBP, (1 + arg_count) * kWordSize));
573 } else { 577 } else {
574 __ leal(EAX, 578 __ leal(EAX,
575 Address(EBP, ParsedFunction::kFirstLocalSlotIndex * kWordSize)); 579 Address(EBP, ParsedFunction::kFirstLocalSlotIndex * kWordSize));
576 } 580 }
577 __ movl(ECX, Immediate(reinterpret_cast<uword>(native_c_function()))); 581 __ movl(ECX, Immediate(reinterpret_cast<uword>(native_c_function())));
578 __ movl(EDX, Immediate(argument_count())); 582 __ movl(EDX, Immediate(arg_count));
579 compiler->GenerateCall(token_index(), 583 compiler->GenerateCall(token_index(),
580 try_index(), 584 try_index(),
581 &StubCode::CallNativeCFunctionLabel(), 585 &StubCode::CallNativeCFunctionLabel(),
582 PcDescriptors::kOther); 586 PcDescriptors::kOther);
583 __ popl(result); 587 __ popl(result);
584 } 588 }
585 589
586 590
587 LocationSummary* LoadIndexedComp::MakeLocationSummary() const { 591 LocationSummary* LoadIndexedComp::MakeLocationSummary() const {
588 const intptr_t kNumInputs = 2; 592 const intptr_t kNumInputs = 2;
(...skipping 1124 matching lines...) Expand 10 before | Expand all | Expand 10 after
1713 } 1717 }
1714 __ Bind(&done); 1718 __ Bind(&done);
1715 } 1719 }
1716 1720
1717 1721
1718 } // namespace dart 1722 } // namespace dart
1719 1723
1720 #undef __ 1724 #undef __
1721 1725
1722 #endif // defined TARGET_ARCH_X64 1726 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « vm/intermediate_language.h ('k') | vm/intermediate_language_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698