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

Side by Side Diff: runtime/vm/flow_graph_compiler_mips.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_ia32.cc ('k') | runtime/vm/flow_graph_compiler_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) 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_MIPS. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS.
6 #if defined(TARGET_ARCH_MIPS) 6 #if defined(TARGET_ARCH_MIPS)
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 1381 matching lines...) Expand 10 before | Expand all | Expand 10 after
1392 const Object& obj, 1392 const Object& obj,
1393 bool needs_number_check, 1393 bool needs_number_check,
1394 intptr_t token_pos) { 1394 intptr_t token_pos) {
1395 __ TraceSimMsg("EqualityRegConstCompare"); 1395 __ TraceSimMsg("EqualityRegConstCompare");
1396 if (needs_number_check && 1396 if (needs_number_check &&
1397 (obj.IsMint() || obj.IsDouble() || obj.IsBigint())) { 1397 (obj.IsMint() || obj.IsDouble() || obj.IsBigint())) {
1398 __ addiu(SP, SP, Immediate(-2 * kWordSize)); 1398 __ addiu(SP, SP, Immediate(-2 * kWordSize));
1399 __ sw(reg, Address(SP, 1 * kWordSize)); 1399 __ sw(reg, Address(SP, 1 * kWordSize));
1400 __ LoadObject(TMP1, obj); 1400 __ LoadObject(TMP1, obj);
1401 __ sw(TMP1, Address(SP, 0 * kWordSize)); 1401 __ sw(TMP1, Address(SP, 0 * kWordSize));
1402 __ BranchLink(&StubCode::IdenticalWithNumberCheckLabel()); 1402 if (is_optimizing()) {
1403 __ BranchLink(&StubCode::OptimizedIdenticalWithNumberCheckLabel());
1404 } else {
1405 __ BranchLink(&StubCode::UnoptimizedIdenticalWithNumberCheckLabel());
1406 }
1403 AddCurrentDescriptor(PcDescriptors::kRuntimeCall, 1407 AddCurrentDescriptor(PcDescriptors::kRuntimeCall,
1404 Isolate::kNoDeoptId, 1408 Isolate::kNoDeoptId,
1405 token_pos); 1409 token_pos);
1406 __ TraceSimMsg("EqualityRegConstCompare return"); 1410 __ TraceSimMsg("EqualityRegConstCompare return");
1407 __ lw(reg, Address(SP, 1 * kWordSize)); // Restore 'reg'. 1411 __ lw(reg, Address(SP, 1 * kWordSize)); // Restore 'reg'.
1408 __ addiu(SP, SP, Immediate(2 * kWordSize)); // Discard constant. 1412 __ addiu(SP, SP, Immediate(2 * kWordSize)); // Discard constant.
1409 return; 1413 return;
1410 } 1414 }
1411 __ CompareObject(CMPRES, TMP1, reg, obj); 1415 __ CompareObject(CMPRES, TMP1, reg, obj);
1412 } 1416 }
1413 1417
1414 1418
1415 void FlowGraphCompiler::EmitEqualityRegRegCompare(Register left, 1419 void FlowGraphCompiler::EmitEqualityRegRegCompare(Register left,
1416 Register right, 1420 Register right,
1417 bool needs_number_check, 1421 bool needs_number_check,
1418 intptr_t token_pos) { 1422 intptr_t token_pos) {
1419 __ TraceSimMsg("EqualityRegRegCompare"); 1423 __ TraceSimMsg("EqualityRegRegCompare");
1420 __ Comment("EqualityRegRegCompare"); 1424 __ Comment("EqualityRegRegCompare");
1421 if (needs_number_check) { 1425 if (needs_number_check) {
1422 __ addiu(SP, SP, Immediate(-2 * kWordSize)); 1426 __ addiu(SP, SP, Immediate(-2 * kWordSize));
1423 __ sw(left, Address(SP, 1 * kWordSize)); 1427 __ sw(left, Address(SP, 1 * kWordSize));
1424 __ sw(right, Address(SP, 0 * kWordSize)); 1428 __ sw(right, Address(SP, 0 * kWordSize));
1425 __ BranchLink(&StubCode::IdenticalWithNumberCheckLabel()); 1429 if (is_optimizing()) {
1430 __ BranchLink(&StubCode::OptimizedIdenticalWithNumberCheckLabel());
1431 } else {
1432 __ BranchLink(&StubCode::UnoptimizedIdenticalWithNumberCheckLabel());
1433 }
1426 AddCurrentDescriptor(PcDescriptors::kRuntimeCall, 1434 AddCurrentDescriptor(PcDescriptors::kRuntimeCall,
1427 Isolate::kNoDeoptId, 1435 Isolate::kNoDeoptId,
1428 token_pos); 1436 token_pos);
1429 __ TraceSimMsg("EqualityRegRegCompare return"); 1437 __ TraceSimMsg("EqualityRegRegCompare return");
1430 // Stub returns result in CMPRES. If it is 0, then left and right are equal. 1438 // Stub returns result in CMPRES. If it is 0, then left and right are equal.
1431 __ lw(right, Address(SP, 0 * kWordSize)); 1439 __ lw(right, Address(SP, 0 * kWordSize));
1432 __ lw(left, Address(SP, 1 * kWordSize)); 1440 __ lw(left, Address(SP, 1 * kWordSize));
1433 __ addiu(SP, SP, Immediate(2 * kWordSize)); 1441 __ addiu(SP, SP, Immediate(2 * kWordSize));
1434 } else { 1442 } else {
1435 __ slt(CMPRES, left, right); 1443 __ slt(CMPRES, left, right);
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
1904 __ AddImmediate(SP, kDoubleSize); 1912 __ AddImmediate(SP, kDoubleSize);
1905 } 1913 }
1906 1914
1907 1915
1908 #undef __ 1916 #undef __
1909 1917
1910 1918
1911 } // namespace dart 1919 } // namespace dart
1912 1920
1913 #endif // defined TARGET_ARCH_MIPS 1921 #endif // defined TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_compiler_ia32.cc ('k') | runtime/vm/flow_graph_compiler_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698