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

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

Issue 798643003: Pass condition result explicitly. Do not imply the existence of a status (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years 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.h ('k') | runtime/vm/flow_graph_compiler_arm64.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) 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_ARM. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM.
6 #if defined(TARGET_ARCH_ARM) 6 #if defined(TARGET_ARCH_ARM)
7 7
8 #include "vm/flow_graph_compiler.h" 8 #include "vm/flow_graph_compiler.h"
9 9
10 #include "vm/ast_printer.h" 10 #include "vm/ast_printer.h"
(...skipping 1363 matching lines...) Expand 10 before | Expand all | Expand 10 after
1374 GenerateDartCall(deopt_id, 1374 GenerateDartCall(deopt_id,
1375 token_pos, 1375 token_pos,
1376 &stub_code->CallStaticFunctionLabel(), 1376 &stub_code->CallStaticFunctionLabel(),
1377 RawPcDescriptors::kOptStaticCall, 1377 RawPcDescriptors::kOptStaticCall,
1378 locs); 1378 locs);
1379 AddStaticCallTarget(function); 1379 AddStaticCallTarget(function);
1380 __ Drop(argument_count); 1380 __ Drop(argument_count);
1381 } 1381 }
1382 1382
1383 1383
1384 void FlowGraphCompiler::EmitEqualityRegConstCompare(Register reg, 1384 Condition FlowGraphCompiler::EmitEqualityRegConstCompare(
1385 const Object& obj, 1385 Register reg,
1386 bool needs_number_check, 1386 const Object& obj,
1387 intptr_t token_pos) { 1387 bool needs_number_check,
1388 intptr_t token_pos) {
1388 if (needs_number_check) { 1389 if (needs_number_check) {
1389 StubCode* stub_code = isolate()->stub_code(); 1390 StubCode* stub_code = isolate()->stub_code();
1390 ASSERT(!obj.IsMint() && !obj.IsDouble() && !obj.IsBigint()); 1391 ASSERT(!obj.IsMint() && !obj.IsDouble() && !obj.IsBigint());
1391 __ Push(reg); 1392 __ Push(reg);
1392 __ PushObject(obj); 1393 __ PushObject(obj);
1393 if (is_optimizing()) { 1394 if (is_optimizing()) {
1394 __ BranchLinkPatchable( 1395 __ BranchLinkPatchable(
1395 &stub_code->OptimizedIdenticalWithNumberCheckLabel()); 1396 &stub_code->OptimizedIdenticalWithNumberCheckLabel());
1396 } else { 1397 } else {
1397 __ BranchLinkPatchable( 1398 __ BranchLinkPatchable(
1398 &stub_code->UnoptimizedIdenticalWithNumberCheckLabel()); 1399 &stub_code->UnoptimizedIdenticalWithNumberCheckLabel());
1399 } 1400 }
1400 if (token_pos != Scanner::kNoSourcePos) { 1401 if (token_pos != Scanner::kNoSourcePos) {
1401 AddCurrentDescriptor(RawPcDescriptors::kRuntimeCall, 1402 AddCurrentDescriptor(RawPcDescriptors::kRuntimeCall,
1402 Isolate::kNoDeoptId, 1403 Isolate::kNoDeoptId,
1403 token_pos); 1404 token_pos);
1404 } 1405 }
1406 // Stub returns result in flags (result of a cmp, we need Z computed).
1405 __ Drop(1); // Discard constant. 1407 __ Drop(1); // Discard constant.
1406 __ Pop(reg); // Restore 'reg'. 1408 __ Pop(reg); // Restore 'reg'.
1407 return; 1409 } else {
1410 __ CompareObject(reg, obj);
1408 } 1411 }
1409 1412 return EQ;
1410 __ CompareObject(reg, obj);
1411 } 1413 }
1412 1414
1413 1415
1414 void FlowGraphCompiler::EmitEqualityRegRegCompare(Register left, 1416 Condition FlowGraphCompiler::EmitEqualityRegRegCompare(Register left,
1415 Register right, 1417 Register right,
1416 bool needs_number_check, 1418 bool needs_number_check,
1417 intptr_t token_pos) { 1419 intptr_t token_pos) {
1418 if (needs_number_check) { 1420 if (needs_number_check) {
1419 StubCode* stub_code = isolate()->stub_code(); 1421 StubCode* stub_code = isolate()->stub_code();
1420 __ Push(left); 1422 __ Push(left);
1421 __ Push(right); 1423 __ Push(right);
1422 if (is_optimizing()) { 1424 if (is_optimizing()) {
1423 __ BranchLinkPatchable( 1425 __ BranchLinkPatchable(
1424 &stub_code->OptimizedIdenticalWithNumberCheckLabel()); 1426 &stub_code->OptimizedIdenticalWithNumberCheckLabel());
1425 } else { 1427 } else {
1426 __ BranchLinkPatchable( 1428 __ BranchLinkPatchable(
1427 &stub_code->UnoptimizedIdenticalWithNumberCheckLabel()); 1429 &stub_code->UnoptimizedIdenticalWithNumberCheckLabel());
1428 } 1430 }
1429 if (token_pos != Scanner::kNoSourcePos) { 1431 if (token_pos != Scanner::kNoSourcePos) {
1430 AddCurrentDescriptor(RawPcDescriptors::kRuntimeCall, 1432 AddCurrentDescriptor(RawPcDescriptors::kRuntimeCall,
1431 Isolate::kNoDeoptId, 1433 Isolate::kNoDeoptId,
1432 token_pos); 1434 token_pos);
1433 } 1435 }
1434 #if defined(DEBUG) 1436 #if defined(DEBUG)
1435 if (!is_optimizing()) { 1437 if (!is_optimizing()) {
1436 // Do this *after* adding the pc descriptor! 1438 // Do this *after* adding the pc descriptor!
1437 __ LoadImmediate(R4, kInvalidObjectPointer); 1439 __ LoadImmediate(R4, kInvalidObjectPointer);
1438 __ LoadImmediate(R5, kInvalidObjectPointer); 1440 __ LoadImmediate(R5, kInvalidObjectPointer);
1439 } 1441 }
1440 #endif 1442 #endif
1441 // Stub returns result in flags (result of a cmpl, we need ZF computed). 1443 // Stub returns result in flags (result of a cmp, we need Z computed).
1442 __ Pop(right); 1444 __ Pop(right);
1443 __ Pop(left); 1445 __ Pop(left);
1444 } else { 1446 } else {
1445 __ cmp(left, Operand(right)); 1447 __ cmp(left, Operand(right));
1446 } 1448 }
1449 return EQ;
1447 } 1450 }
1448 1451
1449 1452
1450 // This function must be in sync with FlowGraphCompiler::RecordSafepoint and 1453 // This function must be in sync with FlowGraphCompiler::RecordSafepoint and
1451 // FlowGraphCompiler::SlowPathEnvironmentFor. 1454 // FlowGraphCompiler::SlowPathEnvironmentFor.
1452 void FlowGraphCompiler::SaveLiveRegisters(LocationSummary* locs) { 1455 void FlowGraphCompiler::SaveLiveRegisters(LocationSummary* locs) {
1453 #if defined(DEBUG) 1456 #if defined(DEBUG)
1454 locs->CheckWritableInputs(); 1457 locs->CheckWritableInputs();
1455 ClobberDeadTempRegisters(locs); 1458 ClobberDeadTempRegisters(locs);
1456 #endif 1459 #endif
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after
1886 DRegister dreg = EvenDRegisterOf(reg); 1889 DRegister dreg = EvenDRegisterOf(reg);
1887 __ vldrd(dreg, Address(SP, kDoubleSize, Address::PostIndex)); 1890 __ vldrd(dreg, Address(SP, kDoubleSize, Address::PostIndex));
1888 } 1891 }
1889 1892
1890 1893
1891 #undef __ 1894 #undef __
1892 1895
1893 } // namespace dart 1896 } // namespace dart
1894 1897
1895 #endif // defined TARGET_ARCH_ARM 1898 #endif // defined TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_compiler.h ('k') | runtime/vm/flow_graph_compiler_arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698