| OLD | NEW |
| 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/code_generator.h" | 8 #include "vm/code_generator.h" |
| 9 | 9 |
| 10 #include "lib/error.h" | 10 #include "lib/error.h" |
| (...skipping 1327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1338 __ j(NOT_EQUAL, &runtime_call, Assembler::kNearJump); | 1338 __ j(NOT_EQUAL, &runtime_call, Assembler::kNearJump); |
| 1339 __ PushObject(negate_result ? bool_false : bool_true); | 1339 __ PushObject(negate_result ? bool_false : bool_true); |
| 1340 __ jmp(&done, Assembler::kNearJump); | 1340 __ jmp(&done, Assembler::kNearJump); |
| 1341 __ Bind(&runtime_call); | 1341 __ Bind(&runtime_call); |
| 1342 } | 1342 } |
| 1343 } | 1343 } |
| 1344 } | 1344 } |
| 1345 __ PushObject(Object::ZoneHandle()); // Make room for the result. | 1345 __ PushObject(Object::ZoneHandle()); // Make room for the result. |
| 1346 const Immediate location = | 1346 const Immediate location = |
| 1347 Immediate(reinterpret_cast<int64_t>(Smi::New(token_index))); | 1347 Immediate(reinterpret_cast<int64_t>(Smi::New(token_index))); |
| 1348 const Immediate node_id_as_smi = |
| 1349 Immediate(reinterpret_cast<int64_t>(Smi::New(node_id))); |
| 1348 __ pushq(location); // Push the source location. | 1350 __ pushq(location); // Push the source location. |
| 1351 __ pushq(node_id_as_smi); |
| 1349 __ pushq(RAX); // Push the instance. | 1352 __ pushq(RAX); // Push the instance. |
| 1350 __ PushObject(type); // Push the type. | 1353 __ PushObject(type); // Push the type. |
| 1351 if (!type.IsInstantiated()) { | 1354 if (!type.IsInstantiated()) { |
| 1352 GenerateInstantiatorTypeArguments(token_index); | 1355 GenerateInstantiatorTypeArguments(token_index); |
| 1353 } else { | 1356 } else { |
| 1354 __ pushq(raw_null); // Null instantiator. | 1357 __ pushq(raw_null); // Null instantiator. |
| 1355 } | 1358 } |
| 1356 GenerateCallRuntime(node_id, token_index, kInstanceofRuntimeEntry); | 1359 GenerateCallRuntime(node_id, token_index, kInstanceofRuntimeEntry); |
| 1357 // Pop the two parameters supplied to the runtime entry. The result of the | 1360 // Pop the two parameters supplied to the runtime entry. The result of the |
| 1358 // instanceof runtime call will be left as the result of the operation. | 1361 // instanceof runtime call will be left as the result of the operation. |
| 1359 __ addq(RSP, Immediate(4 * kWordSize)); | 1362 __ addq(RSP, Immediate(5 * kWordSize)); |
| 1360 if (negate_result) { | 1363 if (negate_result) { |
| 1361 Label negate_done; | 1364 Label negate_done; |
| 1362 __ popq(RDX); | 1365 __ popq(RDX); |
| 1363 __ LoadObject(RAX, bool_true); | 1366 __ LoadObject(RAX, bool_true); |
| 1364 __ cmpq(RDX, RAX); | 1367 __ cmpq(RDX, RAX); |
| 1365 __ j(NOT_EQUAL, &negate_done, Assembler::kNearJump); | 1368 __ j(NOT_EQUAL, &negate_done, Assembler::kNearJump); |
| 1366 __ LoadObject(RAX, bool_false); | 1369 __ LoadObject(RAX, bool_false); |
| 1367 __ Bind(&negate_done); | 1370 __ Bind(&negate_done); |
| 1368 __ pushq(RAX); | 1371 __ pushq(RAX); |
| 1369 } | 1372 } |
| (...skipping 1290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2660 const Error& error = Error::Handle( | 2663 const Error& error = Error::Handle( |
| 2661 Parser::FormatError(script, token_index, "Error", format, args)); | 2664 Parser::FormatError(script, token_index, "Error", format, args)); |
| 2662 va_end(args); | 2665 va_end(args); |
| 2663 Isolate::Current()->long_jump_base()->Jump(1, error); | 2666 Isolate::Current()->long_jump_base()->Jump(1, error); |
| 2664 UNREACHABLE(); | 2667 UNREACHABLE(); |
| 2665 } | 2668 } |
| 2666 | 2669 |
| 2667 } // namespace dart | 2670 } // namespace dart |
| 2668 | 2671 |
| 2669 #endif // defined TARGET_ARCH_X64 | 2672 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |