OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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_ARM64) | 6 #if defined(TARGET_ARCH_ARM64) |
7 | 7 |
8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
9 #include "vm/code_generator.h" | 9 #include "vm/code_generator.h" |
10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
(...skipping 1275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1286 // Note: R5 must be preserved. | 1286 // Note: R5 must be preserved. |
1287 // Attempt a quick Smi operation for known operations ('kind'). The ICData | 1287 // Attempt a quick Smi operation for known operations ('kind'). The ICData |
1288 // must have been primed with a Smi/Smi check that will be used for counting | 1288 // must have been primed with a Smi/Smi check that will be used for counting |
1289 // the invocations. | 1289 // the invocations. |
1290 static void EmitFastSmiOp(Assembler* assembler, | 1290 static void EmitFastSmiOp(Assembler* assembler, |
1291 Token::Kind kind, | 1291 Token::Kind kind, |
1292 intptr_t num_args, | 1292 intptr_t num_args, |
1293 Label* not_smi_or_overflow, | 1293 Label* not_smi_or_overflow, |
1294 bool should_update_result_range) { | 1294 bool should_update_result_range) { |
1295 __ Comment("Fast Smi op"); | 1295 __ Comment("Fast Smi op"); |
1296 if (FLAG_throw_on_javascript_int_overflow) { | |
1297 // The overflow check is more complex than implemented below. | |
1298 return; | |
1299 } | |
1300 __ ldr(R0, Address(SP, + 0 * kWordSize)); // Right. | 1296 __ ldr(R0, Address(SP, + 0 * kWordSize)); // Right. |
1301 __ ldr(R1, Address(SP, + 1 * kWordSize)); // Left. | 1297 __ ldr(R1, Address(SP, + 1 * kWordSize)); // Left. |
1302 __ orr(TMP, R0, Operand(R1)); | 1298 __ orr(TMP, R0, Operand(R1)); |
1303 __ tsti(TMP, Immediate(kSmiTagMask)); | 1299 __ tsti(TMP, Immediate(kSmiTagMask)); |
1304 __ b(not_smi_or_overflow, NE); | 1300 __ b(not_smi_or_overflow, NE); |
1305 switch (kind) { | 1301 switch (kind) { |
1306 case Token::kADD: { | 1302 case Token::kADD: { |
1307 __ adds(R0, R1, Operand(R0)); // Adds. | 1303 __ adds(R0, R1, Operand(R0)); // Adds. |
1308 __ b(not_smi_or_overflow, VS); // Branch if overflow. | 1304 __ b(not_smi_or_overflow, VS); // Branch if overflow. |
1309 break; | 1305 break; |
(...skipping 880 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2190 __ Bind(&miss); | 2186 __ Bind(&miss); |
2191 __ LoadIsolate(R2); | 2187 __ LoadIsolate(R2); |
2192 __ ldr(CODE_REG, Address(R2, Isolate::ic_miss_code_offset())); | 2188 __ ldr(CODE_REG, Address(R2, Isolate::ic_miss_code_offset())); |
2193 __ ldr(R1, FieldAddress(CODE_REG, Code::entry_point_offset())); | 2189 __ ldr(R1, FieldAddress(CODE_REG, Code::entry_point_offset())); |
2194 __ ret(); | 2190 __ ret(); |
2195 } | 2191 } |
2196 | 2192 |
2197 } // namespace dart | 2193 } // namespace dart |
2198 | 2194 |
2199 #endif // defined TARGET_ARCH_ARM64 | 2195 #endif // defined TARGET_ARCH_ARM64 |
OLD | NEW |