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

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

Issue 18130004: Split IdenticalWithNumberCheck in two versions: once called from unoptimized code the other called… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/flow_graph_compiler_mips.cc ('k') | runtime/vm/stub_code.h » ('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) 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" // Needed here to get TARGET_ARCH_X64. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64.
6 #if defined(TARGET_ARCH_X64) 6 #if defined(TARGET_ARCH_X64)
7 7
8 #include "vm/flow_graph_compiler.h" 8 #include "vm/flow_graph_compiler.h"
9 9
10 #include "lib/error.h" 10 #include "lib/error.h"
(...skipping 1409 matching lines...) Expand 10 before | Expand all | Expand 10 after
1420 1420
1421 if (obj.IsSmi() && (Smi::Cast(obj).Value() == 0)) { 1421 if (obj.IsSmi() && (Smi::Cast(obj).Value() == 0)) {
1422 ASSERT(!needs_number_check); 1422 ASSERT(!needs_number_check);
1423 __ testq(reg, reg); 1423 __ testq(reg, reg);
1424 return; 1424 return;
1425 } 1425 }
1426 1426
1427 if (needs_number_check) { 1427 if (needs_number_check) {
1428 __ pushq(reg); 1428 __ pushq(reg);
1429 __ PushObject(obj); 1429 __ PushObject(obj);
1430 __ call(&StubCode::IdenticalWithNumberCheckLabel()); 1430 if (is_optimizing()) {
1431 __ call(&StubCode::OptimizedIdenticalWithNumberCheckLabel());
1432 } else {
1433 __ call(&StubCode::UnoptimizedIdenticalWithNumberCheckLabel());
1434 }
1431 AddCurrentDescriptor(PcDescriptors::kRuntimeCall, 1435 AddCurrentDescriptor(PcDescriptors::kRuntimeCall,
1432 Isolate::kNoDeoptId, 1436 Isolate::kNoDeoptId,
1433 token_pos); 1437 token_pos);
1434 __ popq(reg); // Discard constant. 1438 __ popq(reg); // Discard constant.
1435 __ popq(reg); // Restore 'reg'. 1439 __ popq(reg); // Restore 'reg'.
1436 return; 1440 return;
1437 } 1441 }
1438 1442
1439 __ CompareObject(reg, obj); 1443 __ CompareObject(reg, obj);
1440 } 1444 }
1441 1445
1442 1446
1443 void FlowGraphCompiler::EmitEqualityRegRegCompare(Register left, 1447 void FlowGraphCompiler::EmitEqualityRegRegCompare(Register left,
1444 Register right, 1448 Register right,
1445 bool needs_number_check, 1449 bool needs_number_check,
1446 intptr_t token_pos) { 1450 intptr_t token_pos) {
1447 if (needs_number_check) { 1451 if (needs_number_check) {
1448 __ pushq(left); 1452 __ pushq(left);
1449 __ pushq(right); 1453 __ pushq(right);
1450 __ call(&StubCode::IdenticalWithNumberCheckLabel()); 1454 if (is_optimizing()) {
1455 __ call(&StubCode::OptimizedIdenticalWithNumberCheckLabel());
1456 } else {
1457 __ call(&StubCode::UnoptimizedIdenticalWithNumberCheckLabel());
1458 }
1451 AddCurrentDescriptor(PcDescriptors::kRuntimeCall, 1459 AddCurrentDescriptor(PcDescriptors::kRuntimeCall,
1452 Isolate::kNoDeoptId, 1460 Isolate::kNoDeoptId,
1453 token_pos); 1461 token_pos);
1454 // Stub returns result in flags (result of a cmpl, we need ZF computed). 1462 // Stub returns result in flags (result of a cmpl, we need ZF computed).
1455 __ popq(right); 1463 __ popq(right);
1456 __ popq(left); 1464 __ popq(left);
1457 } else { 1465 } else {
1458 __ cmpl(left, right); 1466 __ cmpl(left, right);
1459 } 1467 }
1460 } 1468 }
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after
1871 __ movups(reg, Address(RSP, 0)); 1879 __ movups(reg, Address(RSP, 0));
1872 __ addq(RSP, Immediate(kFpuRegisterSize)); 1880 __ addq(RSP, Immediate(kFpuRegisterSize));
1873 } 1881 }
1874 1882
1875 1883
1876 #undef __ 1884 #undef __
1877 1885
1878 } // namespace dart 1886 } // namespace dart
1879 1887
1880 #endif // defined TARGET_ARCH_X64 1888 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_compiler_mips.cc ('k') | runtime/vm/stub_code.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698