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

Side by Side Diff: src/objects.cc

Issue 21340002: Generate a custom OSR entrypoint for OSR compiles on all platforms, and transition to optimized cod… (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 4 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
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 9272 matching lines...) Expand 10 before | Expand all | Expand 10 after
9283 PrintName(); 9283 PrintName();
9284 PrintF(" for parallel recompilation.\n"); 9284 PrintF(" for parallel recompilation.\n");
9285 } 9285 }
9286 set_code_no_write_barrier( 9286 set_code_no_write_barrier(
9287 GetIsolate()->builtins()->builtin(Builtins::kInRecompileQueue)); 9287 GetIsolate()->builtins()->builtin(Builtins::kInRecompileQueue));
9288 // No write barrier required, since the builtin is part of the root set. 9288 // No write barrier required, since the builtin is part of the root set.
9289 } 9289 }
9290 9290
9291 9291
9292 static bool CompileLazyHelper(CompilationInfo* info, 9292 static bool CompileLazyHelper(CompilationInfo* info,
9293 ClearExceptionFlag flag) { 9293 ClearExceptionFlag flag,
9294 bool install) {
Michael Starzinger 2013/07/31 14:55:50 The boolean flag is obsolete, see comments in "com
9294 // Compile the source information to a code object. 9295 // Compile the source information to a code object.
9295 ASSERT(info->IsOptimizing() || !info->shared_info()->is_compiled()); 9296 ASSERT(info->IsOptimizing() || !info->shared_info()->is_compiled());
9296 ASSERT(!info->isolate()->has_pending_exception()); 9297 ASSERT(!info->isolate()->has_pending_exception());
9297 bool result = Compiler::CompileLazy(info); 9298 bool result = Compiler::CompileLazy(info, install);
9298 ASSERT(result != Isolate::Current()->has_pending_exception()); 9299 ASSERT(result != Isolate::Current()->has_pending_exception());
9299 if (!result && flag == CLEAR_EXCEPTION) { 9300 if (!result && flag == CLEAR_EXCEPTION) {
9300 info->isolate()->clear_pending_exception(); 9301 info->isolate()->clear_pending_exception();
9301 } 9302 }
9302 return result; 9303 return result;
9303 } 9304 }
9304 9305
9305 9306
9306 bool SharedFunctionInfo::CompileLazy(Handle<SharedFunctionInfo> shared, 9307 bool SharedFunctionInfo::CompileLazy(Handle<SharedFunctionInfo> shared,
9307 ClearExceptionFlag flag) { 9308 ClearExceptionFlag flag) {
9308 ASSERT(shared->allows_lazy_compilation_without_context()); 9309 ASSERT(shared->allows_lazy_compilation_without_context());
9309 CompilationInfoWithZone info(shared); 9310 CompilationInfoWithZone info(shared);
9310 return CompileLazyHelper(&info, flag); 9311 return CompileLazyHelper(&info, flag, true);
9311 } 9312 }
9312 9313
9313 9314
9314 void SharedFunctionInfo::AddToOptimizedCodeMap( 9315 void SharedFunctionInfo::AddToOptimizedCodeMap(
9315 Handle<SharedFunctionInfo> shared, 9316 Handle<SharedFunctionInfo> shared,
9316 Handle<Context> native_context, 9317 Handle<Context> native_context,
9317 Handle<Code> code, 9318 Handle<Code> code,
9318 Handle<FixedArray> literals) { 9319 Handle<FixedArray> literals) {
9319 CALL_HEAP_FUNCTION_VOID( 9320 CALL_HEAP_FUNCTION_VOID(
9320 shared->GetIsolate(), 9321 shared->GetIsolate(),
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
9450 9451
9451 9452
9452 bool JSFunction::CompileLazy(Handle<JSFunction> function, 9453 bool JSFunction::CompileLazy(Handle<JSFunction> function,
9453 ClearExceptionFlag flag) { 9454 ClearExceptionFlag flag) {
9454 bool result = true; 9455 bool result = true;
9455 if (function->shared()->is_compiled()) { 9456 if (function->shared()->is_compiled()) {
9456 function->ReplaceCode(function->shared()->code()); 9457 function->ReplaceCode(function->shared()->code());
9457 } else { 9458 } else {
9458 ASSERT(function->shared()->allows_lazy_compilation()); 9459 ASSERT(function->shared()->allows_lazy_compilation());
9459 CompilationInfoWithZone info(function); 9460 CompilationInfoWithZone info(function);
9460 result = CompileLazyHelper(&info, flag); 9461 result = CompileLazyHelper(&info, flag, true);
9461 ASSERT(!result || function->is_compiled()); 9462 ASSERT(!result || function->is_compiled());
9462 } 9463 }
9463 return result; 9464 return result;
9464 } 9465 }
9465 9466
9466 9467
9467 bool JSFunction::CompileOptimized(Handle<JSFunction> function, 9468 Handle<Code> JSFunction::CompileOsr(Handle<JSFunction> function,
9468 BailoutId osr_ast_id, 9469 BailoutId osr_ast_id,
9469 ClearExceptionFlag flag) { 9470 ClearExceptionFlag flag) {
9470 CompilationInfoWithZone info(function); 9471 CompilationInfoWithZone info(function);
9471 info.SetOptimizing(osr_ast_id); 9472 info.SetOptimizing(osr_ast_id);
9472 return CompileLazyHelper(&info, flag); 9473 if (CompileLazyHelper(&info, flag, false)) {
9474 return info.code();
9475 } else {
9476 return Handle<Code>::null();
9477 }
9473 } 9478 }
9474 9479
9475 9480
9481 bool JSFunction::CompileOptimized(Handle<JSFunction> function,
9482 ClearExceptionFlag flag) {
9483 CompilationInfoWithZone info(function);
9484 info.SetOptimizing(BailoutId::None());
9485 return CompileLazyHelper(&info, flag, true);
9486 }
9487
9488
9476 bool JSFunction::EnsureCompiled(Handle<JSFunction> function, 9489 bool JSFunction::EnsureCompiled(Handle<JSFunction> function,
9477 ClearExceptionFlag flag) { 9490 ClearExceptionFlag flag) {
9478 return function->is_compiled() || CompileLazy(function, flag); 9491 return function->is_compiled() || CompileLazy(function, flag);
9479 } 9492 }
9480 9493
9481 9494
9482 bool JSFunction::IsInlineable() { 9495 bool JSFunction::IsInlineable() {
9483 if (IsBuiltin()) return false; 9496 if (IsBuiltin()) return false;
9484 SharedFunctionInfo* shared_info = shared(); 9497 SharedFunctionInfo* shared_info = shared();
9485 // Check that the function has a script associated with it. 9498 // Check that the function has a script associated with it.
(...skipping 6486 matching lines...) Expand 10 before | Expand all | Expand 10 after
15972 15985
15973 void PropertyCell::AddDependentCode(Handle<Code> code) { 15986 void PropertyCell::AddDependentCode(Handle<Code> code) {
15974 Handle<DependentCode> codes = DependentCode::Insert( 15987 Handle<DependentCode> codes = DependentCode::Insert(
15975 Handle<DependentCode>(dependent_code()), 15988 Handle<DependentCode>(dependent_code()),
15976 DependentCode::kPropertyCellChangedGroup, code); 15989 DependentCode::kPropertyCellChangedGroup, code);
15977 if (*codes != dependent_code()) set_dependent_code(*codes); 15990 if (*codes != dependent_code()) set_dependent_code(*codes);
15978 } 15991 }
15979 15992
15980 15993
15981 } } // namespace v8::internal 15994 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698