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

Side by Side Diff: src/mips64/full-codegen-mips64.cc

Issue 1150293002: Do not leak message object beyond try-catch. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix memory leak by setting flag Created 5 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
« no previous file with comments | « src/mips/full-codegen-mips.cc ('k') | src/ppc/full-codegen-ppc.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_MIPS64 7 #if V8_TARGET_ARCH_MIPS64
8 8
9 // Note on Mips implementation: 9 // Note on Mips implementation:
10 // 10 //
(...skipping 5338 matching lines...) Expand 10 before | Expand all | Expand 10 after
5349 5349
5350 // Store result register while executing finally block. 5350 // Store result register while executing finally block.
5351 __ push(a1); 5351 __ push(a1);
5352 5352
5353 // Store pending message while executing finally block. 5353 // Store pending message while executing finally block.
5354 ExternalReference pending_message_obj = 5354 ExternalReference pending_message_obj =
5355 ExternalReference::address_of_pending_message_obj(isolate()); 5355 ExternalReference::address_of_pending_message_obj(isolate());
5356 __ li(at, Operand(pending_message_obj)); 5356 __ li(at, Operand(pending_message_obj));
5357 __ ld(a1, MemOperand(at)); 5357 __ ld(a1, MemOperand(at));
5358 __ push(a1); 5358 __ push(a1);
5359
5360 ClearPendingMessage();
5359 } 5361 }
5360 5362
5361 5363
5362 void FullCodeGenerator::ExitFinallyBlock() { 5364 void FullCodeGenerator::ExitFinallyBlock() {
5363 DCHECK(!result_register().is(a1)); 5365 DCHECK(!result_register().is(a1));
5364 // Restore pending message from stack. 5366 // Restore pending message from stack.
5365 __ pop(a1); 5367 __ pop(a1);
5366 ExternalReference pending_message_obj = 5368 ExternalReference pending_message_obj =
5367 ExternalReference::address_of_pending_message_obj(isolate()); 5369 ExternalReference::address_of_pending_message_obj(isolate());
5368 __ li(at, Operand(pending_message_obj)); 5370 __ li(at, Operand(pending_message_obj));
5369 __ sd(a1, MemOperand(at)); 5371 __ sd(a1, MemOperand(at));
5370 5372
5371 // Restore result register from stack. 5373 // Restore result register from stack.
5372 __ pop(a1); 5374 __ pop(a1);
5373 5375
5374 // Uncook return address and return. 5376 // Uncook return address and return.
5375 __ pop(result_register()); 5377 __ pop(result_register());
5376 5378
5377 __ SmiUntag(a1); 5379 __ SmiUntag(a1);
5378 __ Daddu(at, a1, Operand(masm_->CodeObject())); 5380 __ Daddu(at, a1, Operand(masm_->CodeObject()));
5379 __ Jump(at); 5381 __ Jump(at);
5380 } 5382 }
5381 5383
5382 5384
5385 void FullCodeGenerator::ClearPendingMessage() {
5386 DCHECK(!result_register().is(a1));
5387 ExternalReference pending_message_obj =
5388 ExternalReference::address_of_pending_message_obj(isolate());
5389 __ LoadRoot(a1, Heap::kTheHoleValueRootIndex);
5390 __ li(at, Operand(pending_message_obj));
5391 __ sd(a1, MemOperand(at));
5392 }
5393
5394
5383 #undef __ 5395 #undef __
5384 5396
5385 5397
5386 void BackEdgeTable::PatchAt(Code* unoptimized_code, 5398 void BackEdgeTable::PatchAt(Code* unoptimized_code,
5387 Address pc, 5399 Address pc,
5388 BackEdgeState target_state, 5400 BackEdgeState target_state,
5389 Code* replacement_code) { 5401 Code* replacement_code) {
5390 static const int kInstrSize = Assembler::kInstrSize; 5402 static const int kInstrSize = Assembler::kInstrSize;
5391 Address branch_address = pc - 8 * kInstrSize; 5403 Address branch_address = pc - 8 * kInstrSize;
5392 CodePatcher patcher(branch_address, 1); 5404 CodePatcher patcher(branch_address, 1);
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
5459 Assembler::target_address_at(pc_immediate_load_address)) == 5471 Assembler::target_address_at(pc_immediate_load_address)) ==
5460 reinterpret_cast<uint64_t>( 5472 reinterpret_cast<uint64_t>(
5461 isolate->builtins()->OsrAfterStackCheck()->entry())); 5473 isolate->builtins()->OsrAfterStackCheck()->entry()));
5462 return OSR_AFTER_STACK_CHECK; 5474 return OSR_AFTER_STACK_CHECK;
5463 } 5475 }
5464 5476
5465 5477
5466 } } // namespace v8::internal 5478 } } // namespace v8::internal
5467 5479
5468 #endif // V8_TARGET_ARCH_MIPS64 5480 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/mips/full-codegen-mips.cc ('k') | src/ppc/full-codegen-ppc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698