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

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

Issue 11414136: Implement proposed new identity spec. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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
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_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 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after
1103 token_pos, 1103 token_pos,
1104 &StubCode::CallStaticFunctionLabel(), 1104 &StubCode::CallStaticFunctionLabel(),
1105 PcDescriptors::kFuncCall, 1105 PcDescriptors::kFuncCall,
1106 locs); 1106 locs);
1107 AddStaticCallTarget(function); 1107 AddStaticCallTarget(function);
1108 __ Drop(argument_count); 1108 __ Drop(argument_count);
1109 } 1109 }
1110 1110
1111 1111
1112 void FlowGraphCompiler::EmitEqualityRegConstCompare(Register reg, 1112 void FlowGraphCompiler::EmitEqualityRegConstCompare(Register reg,
1113 const Object& obj) { 1113 const Object& obj,
1114 bool needs_number_check) {
1115 if (needs_number_check) {
1116 if (!obj.IsMint() && !obj.IsDouble() && !obj.IsBigint()) {
1117 needs_number_check = false;
1118 }
1119 }
1114 if (obj.IsSmi() && (Smi::Cast(obj).Value() == 0)) { 1120 if (obj.IsSmi() && (Smi::Cast(obj).Value() == 0)) {
1121 ASSERT(!needs_number_check);
1115 __ testq(reg, reg); 1122 __ testq(reg, reg);
1116 } else { 1123 } else {
Florian Schneider 2012/11/23 10:33:40 } else if ...
srdjan 2012/11/23 19:45:39 Done.
1117 __ CompareObject(reg, obj); 1124 if (needs_number_check) {
1125 __ pushq(reg);
1126 __ PushObject(obj);
1127 __ call(&StubCode::IdenticalWithNumberCheckLabel());
Florian Schneider 2012/11/23 10:33:40 Please add comment that result is in flags.
srdjan 2012/11/23 19:45:39 Done.
1128 __ popq(reg); // Discard constant.
1129 __ popq(reg); // Restore 'reg'.
1130 } else {
1131 __ CompareObject(reg, obj);
1132 }
1133 }
1134 }
1135
1136
1137 void FlowGraphCompiler::EmitEqualityRegRegCompare(Register left,
1138 Register right,
1139 bool needs_number_check) {
1140 if (needs_number_check) {
1141 __ pushq(left);
1142 __ pushq(right);
1143 __ call(&StubCode::IdenticalWithNumberCheckLabel());
1144 __ popq(right);
1145 __ popq(left);
1146 } else {
1147 __ cmpl(left, right);
1118 } 1148 }
1119 } 1149 }
1120 1150
1121 1151
1122 // Implement equality spec: if any of the arguments is null do identity check. 1152 // Implement equality spec: if any of the arguments is null do identity check.
1123 // Fallthrough calls super equality. 1153 // Fallthrough calls super equality.
1124 void FlowGraphCompiler::EmitSuperEqualityCallPrologue(Register result, 1154 void FlowGraphCompiler::EmitSuperEqualityCallPrologue(Register result,
1125 Label* skip_call) { 1155 Label* skip_call) {
1126 const Immediate raw_null = 1156 const Immediate raw_null =
1127 Immediate(reinterpret_cast<intptr_t>(Object::null())); 1157 Immediate(reinterpret_cast<intptr_t>(Object::null()));
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
1363 void ParallelMoveResolver::Exchange(const Address& mem1, const Address& mem2) { 1393 void ParallelMoveResolver::Exchange(const Address& mem1, const Address& mem2) {
1364 __ Exchange(mem1, mem2); 1394 __ Exchange(mem1, mem2);
1365 } 1395 }
1366 1396
1367 1397
1368 #undef __ 1398 #undef __
1369 1399
1370 } // namespace dart 1400 } // namespace dart
1371 1401
1372 #endif // defined TARGET_ARCH_X64 1402 #endif // defined TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698