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

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

Issue 10790101: Fix crashes because of far jumps. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 5 months 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
« no previous file with comments | « runtime/vm/intermediate_language_ia32.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/intermediate_language.h" 8 #include "vm/intermediate_language.h"
9 9
10 #include "lib/error.h" 10 #include "lib/error.h"
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 } else { 370 } else {
371 __ j(ZERO, deopt); // Smi deopts. 371 __ j(ZERO, deopt); // Smi deopts.
372 __ LoadClassId(temp, left); 372 __ LoadClassId(temp, left);
373 } 373 }
374 Condition cond = TokenKindToSmiCondition(kind); 374 Condition cond = TokenKindToSmiCondition(kind);
375 Label done; 375 Label done;
376 for (intptr_t i = 0; i < ic_data.NumberOfChecks(); i++) { 376 for (intptr_t i = 0; i < ic_data.NumberOfChecks(); i++) {
377 ASSERT((ic_data.GetReceiverClassIdAt(i) != kSmi) || (i == 0)); 377 ASSERT((ic_data.GetReceiverClassIdAt(i) != kSmi) || (i == 0));
378 Label next_test; 378 Label next_test;
379 __ cmpq(temp, Immediate(ic_data.GetReceiverClassIdAt(i))); 379 __ cmpq(temp, Immediate(ic_data.GetReceiverClassIdAt(i)));
380 __ j(NOT_EQUAL, &next_test, Assembler::kNearJump); 380 __ j(NOT_EQUAL, &next_test);
381 const Function& target = Function::ZoneHandle(ic_data.GetTargetAt(i)); 381 const Function& target = Function::ZoneHandle(ic_data.GetTargetAt(i));
382 ObjectStore* object_store = Isolate::Current()->object_store(); 382 ObjectStore* object_store = Isolate::Current()->object_store();
383 if (target.owner() == object_store->object_class()) { 383 if (target.owner() == object_store->object_class()) {
384 // Object.== is same as ===. 384 // Object.== is same as ===.
385 __ Drop(2); 385 __ Drop(2);
386 __ cmpq(left, right); 386 __ cmpq(left, right);
387 if (branch != NULL) { 387 if (branch != NULL) {
388 branch->EmitBranchOnCondition(compiler, cond); 388 branch->EmitBranchOnCondition(compiler, cond);
389 } else { 389 } else {
390 // This case should be rare. 390 // This case should be rare.
(...skipping 13 matching lines...) Expand all
404 try_index, 404 try_index,
405 target, 405 target,
406 kNumberOfArguments, 406 kNumberOfArguments,
407 kNoArgumentNames); 407 kNoArgumentNames);
408 if (branch == NULL) { 408 if (branch == NULL) {
409 if (kind == Token::kNE) { 409 if (kind == Token::kNE) {
410 Label false_label; 410 Label false_label;
411 __ CompareObject(RAX, compiler->bool_true()); 411 __ CompareObject(RAX, compiler->bool_true());
412 __ j(EQUAL, &false_label, Assembler::kNearJump); 412 __ j(EQUAL, &false_label, Assembler::kNearJump);
413 __ LoadObject(RAX, compiler->bool_true()); 413 __ LoadObject(RAX, compiler->bool_true());
414 __ jmp(&done, Assembler::kNearJump); 414 __ jmp(&done);
415 __ Bind(&false_label); 415 __ Bind(&false_label);
416 __ LoadObject(RAX, compiler->bool_false()); 416 __ LoadObject(RAX, compiler->bool_false());
417 __ jmp(&done); 417 __ jmp(&done);
418 } 418 }
419 } else { 419 } else {
420 __ CompareObject(RAX, compiler->bool_true()); 420 __ CompareObject(RAX, compiler->bool_true());
421 branch->EmitBranchOnCondition(compiler, cond); 421 branch->EmitBranchOnCondition(compiler, cond);
422 } 422 }
423 } 423 }
424 __ jmp(&done); 424 __ jmp(&done);
(...skipping 1745 matching lines...) Expand 10 before | Expand all | Expand 10 after
2170 ASSERT(locs()->out().reg() == RAX); 2170 ASSERT(locs()->out().reg() == RAX);
2171 __ CompareObject(locs()->out().reg(), compiler->bool_true()); 2171 __ CompareObject(locs()->out().reg(), compiler->bool_true());
2172 EmitBranchOnCondition(compiler, branch_condition); 2172 EmitBranchOnCondition(compiler, branch_condition);
2173 } 2173 }
2174 2174
2175 } // namespace dart 2175 } // namespace dart
2176 2176
2177 #undef __ 2177 #undef __
2178 2178
2179 #endif // defined TARGET_ARCH_X64 2179 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698