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

Side by Side Diff: src/x64/fast-codegen-x64.cc

Issue 435020: Fast-compiler: Add stack limit checks to back edges of while, do-while and for. (Closed)
Patch Set: Created 11 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
OLDNEW
1 // Copyright 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 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 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 __ pop(Operand(rbp, SlotOffset(var->slot()))); 375 __ pop(Operand(rbp, SlotOffset(var->slot())));
376 } 376 }
377 break; 377 break;
378 case Slot::CONTEXT: 378 case Slot::CONTEXT:
379 // The variable in the decl always resides in the current context. 379 // The variable in the decl always resides in the current context.
380 ASSERT(function_->scope()->ContextChainLength(slot->var()->scope()) == 0); 380 ASSERT(function_->scope()->ContextChainLength(slot->var()->scope()) == 0);
381 if (decl->mode() == Variable::CONST) { 381 if (decl->mode() == Variable::CONST) {
382 __ Move(rax, Factory::the_hole_value()); 382 __ Move(rax, Factory::the_hole_value());
383 if (FLAG_debug_code) { 383 if (FLAG_debug_code) {
384 // Check if we have the correct context pointer. 384 // Check if we have the correct context pointer.
385 __ movq(rbx, CodeGenerator::ContextOperand( 385 __ movq(rbx, CodeGenerator::ContextOperand(rsi,
386 rsi, Context::FCONTEXT_INDEX)); 386 Context::FCONTEXT_INDEX));
387 __ cmpq(rbx, rsi); 387 __ cmpq(rbx, rsi);
388 __ Check(equal, "Unexpected declaration in current context."); 388 __ Check(equal, "Unexpected declaration in current context.");
389 } 389 }
390 __ movq(CodeGenerator::ContextOperand(rsi, slot->index()), rax); 390 __ movq(CodeGenerator::ContextOperand(rsi, slot->index()), rax);
391 // No write barrier since the_hole_value is in old space. 391 // No write barrier since the_hole_value is in old space.
392 ASSERT(Heap::InNewSpace(*Factory::the_hole_value())); 392 ASSERT(!Heap::InNewSpace(*Factory::the_hole_value()));
Lasse Reichstein 2009/11/24 14:21:36 I can't see how we could have been hitting this at
fschneider 2009/11/25 01:02:59 Thanks for fixing this along the way. I'm not sure
Lasse Reichstein 2009/11/25 08:56:26 Since the code isn't hit at all now, it's an easy
393 } else if (decl->fun() != NULL) { 393 } else if (decl->fun() != NULL) {
394 Visit(decl->fun()); 394 Visit(decl->fun());
395 __ pop(rax); 395 __ pop(rax);
396 if (FLAG_debug_code) { 396 if (FLAG_debug_code) {
397 // Check if we have the correct context pointer. 397 // Check if we have the correct context pointer.
398 __ movq(rbx, CodeGenerator::ContextOperand( 398 __ movq(rbx, CodeGenerator::ContextOperand(rsi,
399 rsi, Context::FCONTEXT_INDEX)); 399 Context::FCONTEXT_INDEX));
400 __ cmpq(rbx, rsi); 400 __ cmpq(rbx, rsi);
401 __ Check(equal, "Unexpected declaration in current context."); 401 __ Check(equal, "Unexpected declaration in current context.");
402 } 402 }
403 __ movq(CodeGenerator::ContextOperand(rsi, slot->index()), rax); 403 __ movq(CodeGenerator::ContextOperand(rsi, slot->index()), rax);
404 int offset = FixedArray::kHeaderSize + slot->index() * kPointerSize; 404 int offset = Context::SlotOffset(slot->index());
405 __ RecordWrite(rsi, offset, rax, rcx); 405 __ RecordWrite(rsi, offset, rax, rcx);
406 } 406 }
407 break; 407 break;
408 default: 408 default:
409 UNREACHABLE(); 409 UNREACHABLE();
410 } 410 }
411 } 411 }
412 412
413 413
414 void FastCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) { 414 void FastCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) {
(...skipping 1133 matching lines...) Expand 10 before | Expand all | Expand 10 after
1548 true_label_ = saved_true; 1548 true_label_ = saved_true;
1549 false_label_ = saved_false; 1549 false_label_ = saved_false;
1550 // Convert current context to test context: End post-test code. 1550 // Convert current context to test context: End post-test code.
1551 } 1551 }
1552 1552
1553 1553
1554 #undef __ 1554 #undef __
1555 1555
1556 1556
1557 } } // namespace v8::internal 1557 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698