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

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

Issue 1229283002: VM: Share some stub code between isolates. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: addressed comments Created 5 years, 5 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
« no previous file with comments | « runtime/vm/stub_code.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) 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 #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/compiler.h" 9 #include "vm/compiler.h"
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 1326 matching lines...) Expand 10 before | Expand all | Expand 10 after
1337 __ cmpl(EBX, Immediate(num_args)); 1337 __ cmpl(EBX, Immediate(num_args));
1338 __ j(EQUAL, &ok, Assembler::kNearJump); 1338 __ j(EQUAL, &ok, Assembler::kNearJump);
1339 __ Stop("Incorrect stub for IC data"); 1339 __ Stop("Incorrect stub for IC data");
1340 __ Bind(&ok); 1340 __ Bind(&ok);
1341 } 1341 }
1342 #endif // DEBUG 1342 #endif // DEBUG
1343 1343
1344 Label stepping, done_stepping; 1344 Label stepping, done_stepping;
1345 if (FLAG_support_debugger && !optimized) { 1345 if (FLAG_support_debugger && !optimized) {
1346 __ Comment("Check single stepping"); 1346 __ Comment("Check single stepping");
1347 uword single_step_address = reinterpret_cast<uword>(Isolate::Current()) + 1347 __ LoadIsolate(EAX);
1348 Isolate::single_step_offset(); 1348 __ cmpb(Address(EAX, Isolate::single_step_offset()), Immediate(0));
1349 __ cmpb(Address::Absolute(single_step_address), Immediate(0));
1350 __ j(NOT_EQUAL, &stepping); 1349 __ j(NOT_EQUAL, &stepping);
1351 __ Bind(&done_stepping); 1350 __ Bind(&done_stepping);
1352 } 1351 }
1353 __ Comment("Range feedback collection"); 1352 __ Comment("Range feedback collection");
1354 Label not_smi_or_overflow; 1353 Label not_smi_or_overflow;
1355 if (range_collection_mode == kCollectRanges) { 1354 if (range_collection_mode == kCollectRanges) {
1356 ASSERT((num_args == 1) || (num_args == 2)); 1355 ASSERT((num_args == 1) || (num_args == 2));
1357 if (num_args == 2) { 1356 if (num_args == 2) {
1358 __ movl(EAX, Address(ESP, + 2 * kWordSize)); 1357 __ movl(EAX, Address(ESP, + 2 * kWordSize));
1359 __ UpdateRangeFeedback(EAX, 0, ECX, EBX, EDI, EDX, &not_smi_or_overflow); 1358 __ UpdateRangeFeedback(EAX, 0, ECX, EBX, EDI, EDX, &not_smi_or_overflow);
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
1639 __ andl(EBX, Immediate(ICData::NumArgsTestedMask())); 1638 __ andl(EBX, Immediate(ICData::NumArgsTestedMask()));
1640 __ cmpl(EBX, Immediate(0)); 1639 __ cmpl(EBX, Immediate(0));
1641 __ j(EQUAL, &ok, Assembler::kNearJump); 1640 __ j(EQUAL, &ok, Assembler::kNearJump);
1642 __ Stop("Incorrect IC data for unoptimized static call"); 1641 __ Stop("Incorrect IC data for unoptimized static call");
1643 __ Bind(&ok); 1642 __ Bind(&ok);
1644 } 1643 }
1645 #endif // DEBUG 1644 #endif // DEBUG
1646 // Check single stepping. 1645 // Check single stepping.
1647 Label stepping, done_stepping; 1646 Label stepping, done_stepping;
1648 if (FLAG_support_debugger) { 1647 if (FLAG_support_debugger) {
1649 uword single_step_address = reinterpret_cast<uword>(Isolate::Current()) + 1648 __ LoadIsolate(EAX);
1650 Isolate::single_step_offset(); 1649 __ cmpb(Address(EAX, Isolate::single_step_offset()), Immediate(0));
1651 __ cmpb(Address::Absolute(single_step_address), Immediate(0));
1652 __ j(NOT_EQUAL, &stepping, Assembler::kNearJump); 1650 __ j(NOT_EQUAL, &stepping, Assembler::kNearJump);
1653 __ Bind(&done_stepping); 1651 __ Bind(&done_stepping);
1654 } 1652 }
1655 1653
1656 // ECX: IC data object (preserved). 1654 // ECX: IC data object (preserved).
1657 __ movl(EBX, FieldAddress(ECX, ICData::ic_data_offset())); 1655 __ movl(EBX, FieldAddress(ECX, ICData::ic_data_offset()));
1658 // EBX: ic_data_array with entries: target functions and count. 1656 // EBX: ic_data_array with entries: target functions and count.
1659 __ leal(EBX, FieldAddress(EBX, Array::data_offset())); 1657 __ leal(EBX, FieldAddress(EBX, Array::data_offset()));
1660 // EBX: points directly to the first ic data array element. 1658 // EBX: points directly to the first ic data array element.
1661 const intptr_t target_offset = ICData::TargetIndexFor(0) * kWordSize; 1659 const intptr_t target_offset = ICData::TargetIndexFor(0) * kWordSize;
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after
2124 // EBX: entry point. 2122 // EBX: entry point.
2125 void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) { 2123 void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) {
2126 EmitMegamorphicLookup(assembler, EDI, EBX, EBX); 2124 EmitMegamorphicLookup(assembler, EDI, EBX, EBX);
2127 __ ret(); 2125 __ ret();
2128 } 2126 }
2129 2127
2130 2128
2131 } // namespace dart 2129 } // namespace dart
2132 2130
2133 #endif // defined TARGET_ARCH_IA32 2131 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « runtime/vm/stub_code.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698