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

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

Issue 8637018: Implement type checking of map literals (issue 221). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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_IA32. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32.
6 #if defined(TARGET_ARCH_IA32) 6 #if defined(TARGET_ARCH_IA32)
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 1387 matching lines...) Expand 10 before | Expand all | Expand 10 after
1398 __ PushObject(negate_result ? bool_false : bool_true); 1398 __ PushObject(negate_result ? bool_false : bool_true);
1399 return; 1399 return;
1400 } 1400 }
1401 1401
1402 const Immediate raw_null = 1402 const Immediate raw_null =
1403 Immediate(reinterpret_cast<intptr_t>(Object::null())); 1403 Immediate(reinterpret_cast<intptr_t>(Object::null()));
1404 Label done; 1404 Label done;
1405 // If type is instantiated and non-parameterized, we can inline code 1405 // If type is instantiated and non-parameterized, we can inline code
1406 // checking whether the tested instance is a Smi. 1406 // checking whether the tested instance is a Smi.
1407 if (type.IsInstantiated()) { 1407 if (type.IsInstantiated()) {
1408 // A null object is not an instance of any type, except of Object, Dynamic, 1408 // A null object is only an instance of Object and Dynamic, which has
1409 // and Null type. 1409 // already been checked above (if the type is instantiated). So we can
1410 // return false here if the instance is null (and if the type is
1411 // instantiated).
1410 // We can only inline this null check if the type is instantiated at compile 1412 // We can only inline this null check if the type is instantiated at compile
1411 // time, since an uninstantiated type at compile time could be Object or 1413 // time, since an uninstantiated type at compile time could be Object or
1412 // Dynamic at run time. 1414 // Dynamic at run time.
1413 Label non_null; 1415 Label non_null;
1414 __ cmpl(EAX, raw_null); 1416 __ cmpl(EAX, raw_null);
1415 __ j(NOT_EQUAL, &non_null, Assembler::kNearJump); 1417 __ j(NOT_EQUAL, &non_null, Assembler::kNearJump);
1416 __ PushObject(negate_result ? bool_true : bool_false); 1418 __ PushObject(negate_result ? bool_true : bool_false);
1417 __ jmp(&done, Assembler::kNearJump); 1419 __ jmp(&done, Assembler::kNearJump);
1418 1420
1419 __ Bind(&non_null); 1421 __ Bind(&non_null);
(...skipping 1339 matching lines...) Expand 10 before | Expand all | Expand 10 after
2759 message_buffer, kMessageBufferSize, 2761 message_buffer, kMessageBufferSize,
2760 format, args); 2762 format, args);
2761 va_end(args); 2763 va_end(args);
2762 Isolate::Current()->long_jump_base()->Jump(1, message_buffer); 2764 Isolate::Current()->long_jump_base()->Jump(1, message_buffer);
2763 UNREACHABLE(); 2765 UNREACHABLE();
2764 } 2766 }
2765 2767
2766 } // namespace dart 2768 } // namespace dart
2767 2769
2768 #endif // defined TARGET_ARCH_IA32 2770 #endif // defined TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698