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

Side by Side Diff: src/compiler.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/code.h ('k') | src/factory.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 // 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 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 return SetLastStatus(SUCCEEDED); 418 return SetLastStatus(SUCCEEDED);
419 } 419 }
420 420
421 421
422 OptimizingCompiler::Status OptimizingCompiler::GenerateAndInstallCode() { 422 OptimizingCompiler::Status OptimizingCompiler::GenerateAndInstallCode() {
423 ASSERT(last_status() == SUCCEEDED); 423 ASSERT(last_status() == SUCCEEDED);
424 { // Scope for timer. 424 { // Scope for timer.
425 Timer timer(this, &time_taken_to_codegen_); 425 Timer timer(this, &time_taken_to_codegen_);
426 ASSERT(chunk_ != NULL); 426 ASSERT(chunk_ != NULL);
427 ASSERT(graph_ != NULL); 427 ASSERT(graph_ != NULL);
428 // Deferred handles reference objects that were accessible during
429 // graph creation. To make sure that we don't encounter inconsistencies
430 // between graph creation and code generation, we disallow accessing
431 // objects through deferred handles during the latter, with exceptions.
432 HandleDereferenceGuard no_deref_deferred(
433 isolate(), HandleDereferenceGuard::DISALLOW_DEFERRED);
428 Handle<Code> optimized_code = chunk_->Codegen(); 434 Handle<Code> optimized_code = chunk_->Codegen();
429 if (optimized_code.is_null()) { 435 if (optimized_code.is_null()) {
430 info()->set_bailout_reason("code generation failed"); 436 info()->set_bailout_reason("code generation failed");
431 return AbortOptimization(); 437 return AbortOptimization();
432 } 438 }
433 info()->SetCode(optimized_code); 439 info()->SetCode(optimized_code);
434 } 440 }
435 RecordOptimizationStats(); 441 RecordOptimizationStats();
436 return SetLastStatus(SUCCEEDED); 442 return SetLastStatus(SUCCEEDED);
437 } 443 }
(...skipping 727 matching lines...) Expand 10 before | Expand all | Expand 10 after
1165 } 1171 }
1166 } 1172 }
1167 1173
1168 GDBJIT(AddCode(Handle<String>(shared->DebugName()), 1174 GDBJIT(AddCode(Handle<String>(shared->DebugName()),
1169 Handle<Script>(info->script()), 1175 Handle<Script>(info->script()),
1170 Handle<Code>(info->code()), 1176 Handle<Code>(info->code()),
1171 info)); 1177 info));
1172 } 1178 }
1173 1179
1174 } } // namespace v8::internal 1180 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/code.h ('k') | src/factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698