OLD | NEW |
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" | 5 #include "vm/globals.h" |
6 #if defined(TARGET_ARCH_X64) | 6 #if defined(TARGET_ARCH_X64) |
7 | 7 |
8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
9 #include "vm/compiler.h" | 9 #include "vm/compiler.h" |
10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
(...skipping 1216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1227 // Note: RBX must be preserved. | 1227 // Note: RBX must be preserved. |
1228 // Attempt a quick Smi operation for known operations ('kind'). The ICData | 1228 // Attempt a quick Smi operation for known operations ('kind'). The ICData |
1229 // must have been primed with a Smi/Smi check that will be used for counting | 1229 // must have been primed with a Smi/Smi check that will be used for counting |
1230 // the invocations. | 1230 // the invocations. |
1231 static void EmitFastSmiOp(Assembler* assembler, | 1231 static void EmitFastSmiOp(Assembler* assembler, |
1232 Token::Kind kind, | 1232 Token::Kind kind, |
1233 intptr_t num_args, | 1233 intptr_t num_args, |
1234 Label* not_smi_or_overflow, | 1234 Label* not_smi_or_overflow, |
1235 bool should_update_result_range) { | 1235 bool should_update_result_range) { |
1236 __ Comment("Fast Smi op"); | 1236 __ Comment("Fast Smi op"); |
1237 if (FLAG_throw_on_javascript_int_overflow) { | |
1238 // The overflow check is more complex than implemented below. | |
1239 return; | |
1240 } | |
1241 ASSERT(num_args == 2); | 1237 ASSERT(num_args == 2); |
1242 __ movq(RCX, Address(RSP, + 1 * kWordSize)); // Right | 1238 __ movq(RCX, Address(RSP, + 1 * kWordSize)); // Right |
1243 __ movq(RAX, Address(RSP, + 2 * kWordSize)); // Left. | 1239 __ movq(RAX, Address(RSP, + 2 * kWordSize)); // Left. |
1244 __ movq(R13, RCX); | 1240 __ movq(R13, RCX); |
1245 __ orq(R13, RAX); | 1241 __ orq(R13, RAX); |
1246 __ testq(R13, Immediate(kSmiTagMask)); | 1242 __ testq(R13, Immediate(kSmiTagMask)); |
1247 __ j(NOT_ZERO, not_smi_or_overflow); | 1243 __ j(NOT_ZERO, not_smi_or_overflow); |
1248 switch (kind) { | 1244 switch (kind) { |
1249 case Token::kADD: { | 1245 case Token::kADD: { |
1250 __ addq(RAX, RCX); | 1246 __ addq(RAX, RCX); |
(...skipping 932 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2183 __ Bind(&miss); | 2179 __ Bind(&miss); |
2184 __ LoadIsolate(RAX); | 2180 __ LoadIsolate(RAX); |
2185 __ movq(CODE_REG, Address(RAX, Isolate::ic_miss_code_offset())); | 2181 __ movq(CODE_REG, Address(RAX, Isolate::ic_miss_code_offset())); |
2186 __ movq(RCX, FieldAddress(CODE_REG, Code::entry_point_offset())); | 2182 __ movq(RCX, FieldAddress(CODE_REG, Code::entry_point_offset())); |
2187 __ ret(); | 2183 __ ret(); |
2188 } | 2184 } |
2189 | 2185 |
2190 } // namespace dart | 2186 } // namespace dart |
2191 | 2187 |
2192 #endif // defined TARGET_ARCH_X64 | 2188 #endif // defined TARGET_ARCH_X64 |
OLD | NEW |