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

Side by Side Diff: src/deoptimizer.cc

Issue 6577036: [Isolates] Merge from bleeding_edge to isolates, revisions 6100-6300. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/isolates/
Patch Set: '' Created 9 years, 10 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/deoptimizer.h ('k') | src/disassembler.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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 addr >= base->GetStartAddress() + 310 addr >= base->GetStartAddress() +
311 (kNumberOfEntries * table_entry_size_)) { 311 (kNumberOfEntries * table_entry_size_)) {
312 return kNotDeoptimizationEntry; 312 return kNotDeoptimizationEntry;
313 } 313 }
314 ASSERT_EQ(0, 314 ASSERT_EQ(0,
315 static_cast<int>(addr - base->GetStartAddress()) % table_entry_size_); 315 static_cast<int>(addr - base->GetStartAddress()) % table_entry_size_);
316 return static_cast<int>(addr - base->GetStartAddress()) / table_entry_size_; 316 return static_cast<int>(addr - base->GetStartAddress()) / table_entry_size_;
317 } 317 }
318 318
319 319
320 unsigned Deoptimizer::GetOutputInfo(DeoptimizationOutputData* data, 320 int Deoptimizer::GetOutputInfo(DeoptimizationOutputData* data,
321 unsigned id, 321 unsigned id,
322 SharedFunctionInfo* shared) { 322 SharedFunctionInfo* shared) {
323 // TODO(kasperl): For now, we do a simple linear search for the PC 323 // TODO(kasperl): For now, we do a simple linear search for the PC
324 // offset associated with the given node id. This should probably be 324 // offset associated with the given node id. This should probably be
325 // changed to a binary search. 325 // changed to a binary search.
326 int length = data->DeoptPoints(); 326 int length = data->DeoptPoints();
327 Smi* smi_id = Smi::FromInt(id); 327 Smi* smi_id = Smi::FromInt(id);
328 for (int i = 0; i < length; i++) { 328 for (int i = 0; i < length; i++) {
329 if (data->AstId(i) == smi_id) { 329 if (data->AstId(i) == smi_id) {
330 return data->PcAndState(i)->value(); 330 return data->PcAndState(i)->value();
331 } 331 }
332 } 332 }
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
620 output_offset); 620 output_offset);
621 literal->ShortPrint(); 621 literal->ShortPrint();
622 PrintF(" ; literal\n"); 622 PrintF(" ; literal\n");
623 } 623 }
624 intptr_t value = reinterpret_cast<intptr_t>(literal); 624 intptr_t value = reinterpret_cast<intptr_t>(literal);
625 output_[frame_index]->SetFrameSlot(output_offset, value); 625 output_[frame_index]->SetFrameSlot(output_offset, value);
626 return; 626 return;
627 } 627 }
628 628
629 case Translation::ARGUMENTS_OBJECT: { 629 case Translation::ARGUMENTS_OBJECT: {
630 // Use the hole value as a sentinel and fill in the arguments object 630 // Use the arguments marker value as a sentinel and fill in the arguments
631 // after the deoptimized frame is built. 631 // object after the deoptimized frame is built.
632 ASSERT(frame_index == 0); // Only supported for first frame. 632 ASSERT(frame_index == 0); // Only supported for first frame.
633 if (FLAG_trace_deopt) { 633 if (FLAG_trace_deopt) {
634 PrintF(" 0x%08" V8PRIxPTR ": [top + %d] <- ", 634 PrintF(" 0x%08" V8PRIxPTR ": [top + %d] <- ",
635 output_[frame_index]->GetTop() + output_offset, 635 output_[frame_index]->GetTop() + output_offset,
636 output_offset); 636 output_offset);
637 isolate_->heap()->the_hole_value()->ShortPrint(); 637 isolate_->heap()->arguments_marker()->ShortPrint();
638 PrintF(" ; arguments object\n"); 638 PrintF(" ; arguments object\n");
639 } 639 }
640 intptr_t value = reinterpret_cast<intptr_t>( 640 intptr_t value = reinterpret_cast<intptr_t>(
641 isolate_->heap()->the_hole_value()); 641 isolate_->heap()->arguments_marker());
642 output_[frame_index]->SetFrameSlot(output_offset, value); 642 output_[frame_index]->SetFrameSlot(output_offset, value);
643 return; 643 return;
644 } 644 }
645 } 645 }
646 } 646 }
647 647
648 648
649 bool Deoptimizer::DoOsrTranslateCommand(TranslationIterator* iterator, 649 bool Deoptimizer::DoOsrTranslateCommand(TranslationIterator* iterator,
650 int* input_offset) { 650 int* input_offset) {
651 disasm::NameConverter converter; 651 disasm::NameConverter converter;
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after
1158 } 1158 }
1159 1159
1160 1160
1161 DeoptimizingCodeListNode::~DeoptimizingCodeListNode() { 1161 DeoptimizingCodeListNode::~DeoptimizingCodeListNode() {
1162 GlobalHandles* global_handles = Isolate::Current()->global_handles(); 1162 GlobalHandles* global_handles = Isolate::Current()->global_handles();
1163 global_handles->Destroy(reinterpret_cast<Object**>(code_.location())); 1163 global_handles->Destroy(reinterpret_cast<Object**>(code_.location()));
1164 } 1164 }
1165 1165
1166 1166
1167 } } // namespace v8::internal 1167 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/deoptimizer.h ('k') | src/disassembler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698