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

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

Issue 6647012: Fix memory leaks on x64... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 9 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
« src/x64/lithium-codegen-x64.h ('K') | « src/x64/lithium-codegen-x64.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 if (current_instruction_ < instructions_->length() - 1) { 251 if (current_instruction_ < instructions_->length() - 1) {
252 return instructions_->at(current_instruction_ + 1); 252 return instructions_->at(current_instruction_ + 1);
253 } else { 253 } else {
254 return NULL; 254 return NULL;
255 } 255 }
256 } 256 }
257 257
258 258
259 bool LCodeGen::GenerateJumpTable() { 259 bool LCodeGen::GenerateJumpTable() {
260 for (int i = 0; i < jump_table_.length(); i++) { 260 for (int i = 0; i < jump_table_.length(); i++) {
261 JumpTableEntry* info = jump_table_[i]; 261 JumpTableEntry* info = &jump_table_[i];
262 __ bind(&(info->label_)); 262 __ bind(&(info->label_));
263 __ Jump(info->address_, RelocInfo::RUNTIME_ENTRY); 263 __ Jump(info->address_, RelocInfo::RUNTIME_ENTRY);
264 } 264 }
265 return !is_aborted(); 265 return !is_aborted();
266 } 266 }
267 267
268 268
269 bool LCodeGen::GenerateDeferredCode() { 269 bool LCodeGen::GenerateDeferredCode() {
270 ASSERT(is_generating()); 270 ASSERT(is_generating());
271 for (int i = 0; !is_aborted() && i < deferred_.length(); i++) { 271 for (int i = 0; !is_aborted() && i < deferred_.length(); i++) {
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 Address entry = Deoptimizer::GetDeoptimizationEntry(id, Deoptimizer::EAGER); 531 Address entry = Deoptimizer::GetDeoptimizationEntry(id, Deoptimizer::EAGER);
532 ASSERT(entry != NULL); 532 ASSERT(entry != NULL);
533 if (entry == NULL) { 533 if (entry == NULL) {
534 Abort("bailout was not prepared"); 534 Abort("bailout was not prepared");
535 return; 535 return;
536 } 536 }
537 537
538 if (cc == no_condition) { 538 if (cc == no_condition) {
539 __ Jump(entry, RelocInfo::RUNTIME_ENTRY); 539 __ Jump(entry, RelocInfo::RUNTIME_ENTRY);
540 } else { 540 } else {
541 JumpTableEntry* jump_info = NULL;
542 // We often have several deopts to the same entry, reuse the last 541 // We often have several deopts to the same entry, reuse the last
543 // jump entry if this is the case. 542 // jump entry if this is the case.
544 if (jump_table_.length() > 0 && 543 if (jump_table_.is_empty() ||
545 jump_table_[jump_table_.length() - 1]->address_ == entry) { 544 jump_table_.last().address_ != entry) {
546 jump_info = jump_table_[jump_table_.length() - 1]; 545 jump_table_.Add(entry);
Lasse Reichstein 2011/03/09 09:57:07 If the JumpTableEntry constructor was explicit, th
547 } else {
548 jump_info = new JumpTableEntry(entry);
549 jump_table_.Add(jump_info);
550 } 546 }
551 __ j(cc, &jump_info->label_); 547 __ j(cc, &jump_table_.last().label_);
552 } 548 }
553 } 549 }
554 550
555 551
556 void LCodeGen::PopulateDeoptimizationData(Handle<Code> code) { 552 void LCodeGen::PopulateDeoptimizationData(Handle<Code> code) {
557 int length = deoptimizations_.length(); 553 int length = deoptimizations_.length();
558 if (length == 0) return; 554 if (length == 0) return;
559 ASSERT(FLAG_deopt); 555 ASSERT(FLAG_deopt);
560 Handle<DeoptimizationInputData> data = 556 Handle<DeoptimizationInputData> data =
561 Factory::NewDeoptimizationInputData(length, TENURED); 557 Factory::NewDeoptimizationInputData(length, TENURED);
(...skipping 3096 matching lines...) Expand 10 before | Expand all | Expand 10 after
3658 RegisterEnvironmentForDeoptimization(environment); 3654 RegisterEnvironmentForDeoptimization(environment);
3659 ASSERT(osr_pc_offset_ == -1); 3655 ASSERT(osr_pc_offset_ == -1);
3660 osr_pc_offset_ = masm()->pc_offset(); 3656 osr_pc_offset_ = masm()->pc_offset();
3661 } 3657 }
3662 3658
3663 #undef __ 3659 #undef __
3664 3660
3665 } } // namespace v8::internal 3661 } } // namespace v8::internal
3666 3662
3667 #endif // V8_TARGET_ARCH_X64 3663 #endif // V8_TARGET_ARCH_X64
OLDNEW
« src/x64/lithium-codegen-x64.h ('K') | « src/x64/lithium-codegen-x64.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698