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

Side by Side Diff: src/codegen-ia32.cc

Issue 18046: Assert that, when jumping or binding a label, there is no value in the... (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/toiger/
Patch Set: Created 11 years, 11 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 | src/jump-target-ia32.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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 JumpTarget true_target(this); 434 JumpTarget true_target(this);
435 JumpTarget false_target(this); 435 JumpTarget false_target(this);
436 LoadCondition(x, typeof_state, &true_target, &false_target, false); 436 LoadCondition(x, typeof_state, &true_target, &false_target, false);
437 437
438 if (has_cc()) { 438 if (has_cc()) {
439 ASSERT(has_valid_frame()); 439 ASSERT(has_valid_frame());
440 VirtualFrame::SpilledScope spilled_scope(this); 440 VirtualFrame::SpilledScope spilled_scope(this);
441 // Convert cc_reg_ into a boolean value. 441 // Convert cc_reg_ into a boolean value.
442 JumpTarget loaded(this); 442 JumpTarget loaded(this);
443 JumpTarget materialize_true(this); 443 JumpTarget materialize_true(this);
444 materialize_true.Branch(cc_reg_); 444 Condition cc = cc_reg_;
445 cc_reg_ = no_condition;
446 materialize_true.Branch(cc);
445 frame_->EmitPush(Immediate(Factory::false_value())); 447 frame_->EmitPush(Immediate(Factory::false_value()));
446 loaded.Jump(); 448 loaded.Jump();
447 materialize_true.Bind(); 449 materialize_true.Bind();
448 frame_->EmitPush(Immediate(Factory::true_value())); 450 frame_->EmitPush(Immediate(Factory::true_value()));
449 loaded.Bind(); 451 loaded.Bind();
450 cc_reg_ = no_condition;
451 } 452 }
452 453
453 if (true_target.is_linked() || false_target.is_linked()) { 454 if (true_target.is_linked() || false_target.is_linked()) {
454 // We have at least one condition value that has been "translated" into 455 // We have at least one condition value that has been "translated" into
455 // a branch, thus it needs to be loaded explicitly. 456 // a branch, thus it needs to be loaded explicitly.
456 JumpTarget loaded(this); 457 JumpTarget loaded(this);
457 if (has_valid_frame()) { 458 if (has_valid_frame()) {
458 loaded.Jump(); // Don't lose the current TOS. 459 loaded.Jump(); // Don't lose the current TOS.
459 } 460 }
460 bool both = true_target.is_linked() && false_target.is_linked(); 461 bool both = true_target.is_linked() && false_target.is_linked();
(...skipping 933 matching lines...) Expand 10 before | Expand all | Expand 10 after
1394 // Restore context and replace function on the stack with the 1395 // Restore context and replace function on the stack with the
1395 // result of the stub invocation. 1396 // result of the stub invocation.
1396 frame_->RestoreContextRegister(); 1397 frame_->RestoreContextRegister();
1397 frame_->SetElementAt(0, &result); 1398 frame_->SetElementAt(0, &result);
1398 } 1399 }
1399 1400
1400 1401
1401 void CodeGenerator::Branch(bool if_true, JumpTarget* target) { 1402 void CodeGenerator::Branch(bool if_true, JumpTarget* target) {
1402 ASSERT(has_cc()); 1403 ASSERT(has_cc());
1403 Condition cc = if_true ? cc_reg_ : NegateCondition(cc_reg_); 1404 Condition cc = if_true ? cc_reg_ : NegateCondition(cc_reg_);
1405 cc_reg_ = no_condition;
1404 target->Branch(cc); 1406 target->Branch(cc);
1405 cc_reg_ = no_condition;
1406 } 1407 }
1407 1408
1408 1409
1409 void CodeGenerator::CheckStack() { 1410 void CodeGenerator::CheckStack() {
1410 if (FLAG_check_stack) { 1411 if (FLAG_check_stack) {
1411 JumpTarget stack_is_ok(this); 1412 JumpTarget stack_is_ok(this);
1412 StackCheckStub stub; 1413 StackCheckStub stub;
1413 ExternalReference stack_guard_limit = 1414 ExternalReference stack_guard_limit =
1414 ExternalReference::address_of_stack_guard_limit(); 1415 ExternalReference::address_of_stack_guard_limit();
1415 __ cmp(esp, Operand::StaticVariable(stack_guard_limit)); 1416 __ cmp(esp, Operand::StaticVariable(stack_guard_limit));
(...skipping 4688 matching lines...) Expand 10 before | Expand all | Expand 10 after
6104 6105
6105 // Slow-case: Go through the JavaScript implementation. 6106 // Slow-case: Go through the JavaScript implementation.
6106 __ bind(&slow); 6107 __ bind(&slow);
6107 __ InvokeBuiltin(Builtins::INSTANCE_OF, JUMP_FUNCTION); 6108 __ InvokeBuiltin(Builtins::INSTANCE_OF, JUMP_FUNCTION);
6108 } 6109 }
6109 6110
6110 6111
6111 #undef __ 6112 #undef __
6112 6113
6113 } } // namespace v8::internal 6114 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/jump-target-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698