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

Side by Side Diff: src/objects.cc

Issue 14403015: Disallow dereferencing deferred handles when generating optimized code. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: addressed comments Created 7 years, 8 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/isolate.cc ('k') | src/x64/assembler-x64.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 9037 matching lines...) Expand 10 before | Expand all | Expand 10 after
9048 9048
9049 // unbox handles and relocate 9049 // unbox handles and relocate
9050 intptr_t delta = instruction_start() - desc.buffer; 9050 intptr_t delta = instruction_start() - desc.buffer;
9051 int mode_mask = RelocInfo::kCodeTargetMask | 9051 int mode_mask = RelocInfo::kCodeTargetMask |
9052 RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT) | 9052 RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT) |
9053 RelocInfo::ModeMask(RelocInfo::GLOBAL_PROPERTY_CELL) | 9053 RelocInfo::ModeMask(RelocInfo::GLOBAL_PROPERTY_CELL) |
9054 RelocInfo::ModeMask(RelocInfo::RUNTIME_ENTRY) | 9054 RelocInfo::ModeMask(RelocInfo::RUNTIME_ENTRY) |
9055 RelocInfo::kApplyMask; 9055 RelocInfo::kApplyMask;
9056 // Needed to find target_object and runtime_entry on X64 9056 // Needed to find target_object and runtime_entry on X64
9057 Assembler* origin = desc.origin; 9057 Assembler* origin = desc.origin;
9058 ALLOW_HANDLE_DEREF(GetIsolate(), "embedding raw addresses into code");
9058 for (RelocIterator it(this, mode_mask); !it.done(); it.next()) { 9059 for (RelocIterator it(this, mode_mask); !it.done(); it.next()) {
9059 RelocInfo::Mode mode = it.rinfo()->rmode(); 9060 RelocInfo::Mode mode = it.rinfo()->rmode();
9060 if (mode == RelocInfo::EMBEDDED_OBJECT) { 9061 if (mode == RelocInfo::EMBEDDED_OBJECT) {
9061 Handle<Object> p = it.rinfo()->target_object_handle(origin); 9062 Handle<Object> p = it.rinfo()->target_object_handle(origin);
9062 it.rinfo()->set_target_object(*p, SKIP_WRITE_BARRIER); 9063 it.rinfo()->set_target_object(*p, SKIP_WRITE_BARRIER);
9063 } else if (mode == RelocInfo::GLOBAL_PROPERTY_CELL) { 9064 } else if (mode == RelocInfo::GLOBAL_PROPERTY_CELL) {
9064 Handle<JSGlobalPropertyCell> cell = it.rinfo()->target_cell_handle(); 9065 Handle<JSGlobalPropertyCell> cell = it.rinfo()->target_cell_handle();
9065 it.rinfo()->set_target_cell(*cell, SKIP_WRITE_BARRIER); 9066 it.rinfo()->set_target_cell(*cell, SKIP_WRITE_BARRIER);
9066 } else if (RelocInfo::IsCodeTarget(mode)) { 9067 } else if (RelocInfo::IsCodeTarget(mode)) {
9067 // rewrite code handles in inline cache targets to direct 9068 // rewrite code handles in inline cache targets to direct
(...skipping 5437 matching lines...) Expand 10 before | Expand all | Expand 10 after
14505 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); 14506 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER);
14506 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); 14507 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER);
14507 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); 14508 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER);
14508 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); 14509 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER);
14509 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); 14510 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER);
14510 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); 14511 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER);
14511 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); 14512 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER);
14512 } 14513 }
14513 14514
14514 } } // namespace v8::internal 14515 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/isolate.cc ('k') | src/x64/assembler-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698