OLD | NEW |
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 7448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7459 ASSERT(result != Isolate::Current()->has_pending_exception()); | 7459 ASSERT(result != Isolate::Current()->has_pending_exception()); |
7460 if (!result && flag == CLEAR_EXCEPTION) { | 7460 if (!result && flag == CLEAR_EXCEPTION) { |
7461 info->isolate()->clear_pending_exception(); | 7461 info->isolate()->clear_pending_exception(); |
7462 } | 7462 } |
7463 return result; | 7463 return result; |
7464 } | 7464 } |
7465 | 7465 |
7466 | 7466 |
7467 bool SharedFunctionInfo::CompileLazy(Handle<SharedFunctionInfo> shared, | 7467 bool SharedFunctionInfo::CompileLazy(Handle<SharedFunctionInfo> shared, |
7468 ClearExceptionFlag flag) { | 7468 ClearExceptionFlag flag) { |
7469 CompilationInfo info(shared); | 7469 |
| 7470 Zone zone(shared->GetIsolate()); |
| 7471 CompilationInfo info(shared, &zone); |
| 7472 ZoneScope scope(&zone, DELETE_ON_EXIT); |
7470 return CompileLazyHelper(&info, flag); | 7473 return CompileLazyHelper(&info, flag); |
7471 } | 7474 } |
7472 | 7475 |
7473 | 7476 |
7474 bool JSFunction::CompileLazy(Handle<JSFunction> function, | 7477 bool JSFunction::CompileLazy(Handle<JSFunction> function, |
7475 ClearExceptionFlag flag) { | 7478 ClearExceptionFlag flag) { |
7476 bool result = true; | 7479 bool result = true; |
7477 if (function->shared()->is_compiled()) { | 7480 if (function->shared()->is_compiled()) { |
7478 function->ReplaceCode(function->shared()->code()); | 7481 function->ReplaceCode(function->shared()->code()); |
7479 function->shared()->set_code_age(0); | 7482 function->shared()->set_code_age(0); |
7480 } else { | 7483 } else { |
7481 CompilationInfo info(function); | 7484 Zone zone(function->GetIsolate()); |
| 7485 CompilationInfo info(function, &zone); |
| 7486 ZoneScope scope(&zone, DELETE_ON_EXIT); |
7482 result = CompileLazyHelper(&info, flag); | 7487 result = CompileLazyHelper(&info, flag); |
7483 ASSERT(!result || function->is_compiled()); | 7488 ASSERT(!result || function->is_compiled()); |
7484 } | 7489 } |
7485 return result; | 7490 return result; |
7486 } | 7491 } |
7487 | 7492 |
7488 | 7493 |
7489 bool JSFunction::CompileOptimized(Handle<JSFunction> function, | 7494 bool JSFunction::CompileOptimized(Handle<JSFunction> function, |
7490 int osr_ast_id, | 7495 int osr_ast_id, |
7491 ClearExceptionFlag flag) { | 7496 ClearExceptionFlag flag) { |
7492 CompilationInfo info(function); | 7497 Zone zone(function->GetIsolate()); |
| 7498 CompilationInfo info(function, &zone); |
| 7499 ZoneScope scope(&zone, DELETE_ON_EXIT); |
7493 info.SetOptimizing(osr_ast_id); | 7500 info.SetOptimizing(osr_ast_id); |
7494 return CompileLazyHelper(&info, flag); | 7501 return CompileLazyHelper(&info, flag); |
7495 } | 7502 } |
7496 | 7503 |
7497 | 7504 |
7498 bool JSFunction::IsInlineable() { | 7505 bool JSFunction::IsInlineable() { |
7499 if (IsBuiltin()) return false; | 7506 if (IsBuiltin()) return false; |
7500 SharedFunctionInfo* shared_info = shared(); | 7507 SharedFunctionInfo* shared_info = shared(); |
7501 // Check that the function has a script associated with it. | 7508 // Check that the function has a script associated with it. |
7502 if (!shared_info->script()->IsScript()) return false; | 7509 if (!shared_info->script()->IsScript()) return false; |
(...skipping 5702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13205 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); | 13212 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); |
13206 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); | 13213 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); |
13207 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); | 13214 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); |
13208 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); | 13215 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); |
13209 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); | 13216 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); |
13210 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); | 13217 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); |
13211 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); | 13218 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); |
13212 } | 13219 } |
13213 | 13220 |
13214 } } // namespace v8::internal | 13221 } } // namespace v8::internal |
OLD | NEW |