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

Side by Side Diff: runtime/vm/intermediate_language_ia32.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 | « no previous file | runtime/vm/intermediate_language_x64.cc » ('j') | 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_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/intermediate_language.h" 8 #include "vm/intermediate_language.h"
9 9
10 #include "lib/error.h" 10 #include "lib/error.h"
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 } else { 361 } else {
362 __ j(ZERO, deopt); // Smi deopts. 362 __ j(ZERO, deopt); // Smi deopts.
363 __ LoadClassId(temp, left); 363 __ LoadClassId(temp, left);
364 } 364 }
365 Condition cond = TokenKindToSmiCondition(kind); 365 Condition cond = TokenKindToSmiCondition(kind);
366 Label done; 366 Label done;
367 for (intptr_t i = 0; i < ic_data.NumberOfChecks(); i++) { 367 for (intptr_t i = 0; i < ic_data.NumberOfChecks(); i++) {
368 ASSERT((ic_data.GetReceiverClassIdAt(i) != kSmi) || (i == 0)); 368 ASSERT((ic_data.GetReceiverClassIdAt(i) != kSmi) || (i == 0));
369 Label next_test; 369 Label next_test;
370 __ cmpl(temp, Immediate(ic_data.GetReceiverClassIdAt(i))); 370 __ cmpl(temp, Immediate(ic_data.GetReceiverClassIdAt(i)));
371 __ j(NOT_EQUAL, &next_test, Assembler::kNearJump); 371 __ j(NOT_EQUAL, &next_test);
372 const Function& target = Function::ZoneHandle(ic_data.GetTargetAt(i)); 372 const Function& target = Function::ZoneHandle(ic_data.GetTargetAt(i));
373 ObjectStore* object_store = Isolate::Current()->object_store(); 373 ObjectStore* object_store = Isolate::Current()->object_store();
374 if (target.owner() == object_store->object_class()) { 374 if (target.owner() == object_store->object_class()) {
375 // Object.== is same as ===. 375 // Object.== is same as ===.
376 __ Drop(2); 376 __ Drop(2);
377 __ cmpl(left, right); 377 __ cmpl(left, right);
378 if (branch != NULL) { 378 if (branch != NULL) {
379 branch->EmitBranchOnCondition(compiler, cond); 379 branch->EmitBranchOnCondition(compiler, cond);
380 } else { 380 } else {
381 // This case should be rare. 381 // This case should be rare.
(...skipping 13 matching lines...) Expand all
395 try_index, 395 try_index,
396 target, 396 target,
397 kNumberOfArguments, 397 kNumberOfArguments,
398 kNoArgumentNames); 398 kNoArgumentNames);
399 if (branch == NULL) { 399 if (branch == NULL) {
400 if (kind == Token::kNE) { 400 if (kind == Token::kNE) {
401 Label false_label; 401 Label false_label;
402 __ CompareObject(EAX, compiler->bool_true()); 402 __ CompareObject(EAX, compiler->bool_true());
403 __ j(EQUAL, &false_label, Assembler::kNearJump); 403 __ j(EQUAL, &false_label, Assembler::kNearJump);
404 __ LoadObject(EAX, compiler->bool_true()); 404 __ LoadObject(EAX, compiler->bool_true());
405 __ jmp(&done, Assembler::kNearJump); 405 __ jmp(&done);
406 __ Bind(&false_label); 406 __ Bind(&false_label);
407 __ LoadObject(EAX, compiler->bool_false()); 407 __ LoadObject(EAX, compiler->bool_false());
408 __ jmp(&done); 408 __ jmp(&done);
409 } 409 }
410 } else { 410 } else {
411 __ CompareObject(EAX, compiler->bool_true()); 411 __ CompareObject(EAX, compiler->bool_true());
412 branch->EmitBranchOnCondition(compiler, cond); 412 branch->EmitBranchOnCondition(compiler, cond);
413 } 413 }
414 } 414 }
415 __ jmp(&done); 415 __ jmp(&done);
(...skipping 1749 matching lines...) Expand 10 before | Expand all | Expand 10 after
2165 ASSERT(locs()->out().reg() == EAX); 2165 ASSERT(locs()->out().reg() == EAX);
2166 __ CompareObject(locs()->out().reg(), compiler->bool_true()); 2166 __ CompareObject(locs()->out().reg(), compiler->bool_true());
2167 EmitBranchOnCondition(compiler, branch_condition); 2167 EmitBranchOnCondition(compiler, branch_condition);
2168 } 2168 }
2169 2169
2170 } // namespace dart 2170 } // namespace dart
2171 2171
2172 #undef __ 2172 #undef __
2173 2173
2174 #endif // defined TARGET_ARCH_X64 2174 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/intermediate_language_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698