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

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

Issue 10532066: Reimplement dynamic frame alignment for frames that are compiled via OSR or have more than 2 double… (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: don't align frames of recursive functions Created 8 years, 6 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 | « src/ia32/lithium-ia32.h ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 stream->Add(" length "); 361 stream->Add(" length ");
362 length()->PrintTo(stream); 362 length()->PrintTo(stream);
363 363
364 stream->Add(" index "); 364 stream->Add(" index ");
365 index()->PrintTo(stream); 365 index()->PrintTo(stream);
366 } 366 }
367 367
368 368
369 int LChunk::GetNextSpillIndex(bool is_double) { 369 int LChunk::GetNextSpillIndex(bool is_double) {
370 // Skip a slot if for a double-width slot. 370 // Skip a slot if for a double-width slot.
371 if (is_double) spill_slot_count_++; 371 if (is_double) {
372 spill_slot_count_++;
373 spill_slot_count_ |= 1;
374 num_double_slots_++;
375 }
372 return spill_slot_count_++; 376 return spill_slot_count_++;
373 } 377 }
374 378
375 379
376 LOperand* LChunk::GetNextSpillSlot(bool is_double) { 380 LOperand* LChunk::GetNextSpillSlot(bool is_double) {
377 int index = GetNextSpillIndex(is_double); 381 int index = GetNextSpillIndex(is_double);
378 if (is_double) { 382 if (is_double) {
379 return LDoubleStackSlot::Create(index, zone()); 383 return LDoubleStackSlot::Create(index, zone());
380 } else { 384 } else {
381 return LStackSlot::Create(index, zone()); 385 return LStackSlot::Create(index, zone());
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
543 LConstantOperand* operand) const { 547 LConstantOperand* operand) const {
544 return graph_->LookupValue(operand->index())->representation(); 548 return graph_->LookupValue(operand->index())->representation();
545 } 549 }
546 550
547 551
548 LChunk* LChunkBuilder::Build() { 552 LChunk* LChunkBuilder::Build() {
549 ASSERT(is_unused()); 553 ASSERT(is_unused());
550 chunk_ = new(zone()) LChunk(info(), graph()); 554 chunk_ = new(zone()) LChunk(info(), graph());
551 HPhase phase("L_Building chunk", chunk_); 555 HPhase phase("L_Building chunk", chunk_);
552 status_ = BUILDING; 556 status_ = BUILDING;
557
558 // Reserve the first spill slot for the state of dynamic alignment.
559 int alignment_state_index = chunk_->GetNextSpillIndex(false);
560 ASSERT_EQ(alignment_state_index, 0);
561 USE(alignment_state_index);
562
553 const ZoneList<HBasicBlock*>* blocks = graph()->blocks(); 563 const ZoneList<HBasicBlock*>* blocks = graph()->blocks();
554 for (int i = 0; i < blocks->length(); i++) { 564 for (int i = 0; i < blocks->length(); i++) {
555 HBasicBlock* next = NULL; 565 HBasicBlock* next = NULL;
556 if (i < blocks->length() - 1) next = blocks->at(i + 1); 566 if (i < blocks->length() - 1) next = blocks->at(i + 1);
557 DoBasicBlock(blocks->at(i), next); 567 DoBasicBlock(blocks->at(i), next);
558 if (is_aborted()) return NULL; 568 if (is_aborted()) return NULL;
559 } 569 }
560 status_ = DONE; 570 status_ = DONE;
561 return chunk_; 571 return chunk_;
562 } 572 }
(...skipping 1876 matching lines...) Expand 10 before | Expand all | Expand 10 after
2439 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2449 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2440 LOperand* object = UseRegister(instr->object()); 2450 LOperand* object = UseRegister(instr->object());
2441 LOperand* index = UseTempRegister(instr->index()); 2451 LOperand* index = UseTempRegister(instr->index());
2442 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); 2452 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index));
2443 } 2453 }
2444 2454
2445 2455
2446 } } // namespace v8::internal 2456 } } // namespace v8::internal
2447 2457
2448 #endif // V8_TARGET_ARCH_IA32 2458 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/lithium-ia32.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698