| OLD | NEW |
| 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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 function_= Handle<Object>::null(); | 127 function_= Handle<Object>::null(); |
| 128 } | 128 } |
| 129 | 129 |
| 130 | 130 |
| 131 void PendingListNode::WeakCallback(v8::Persistent<v8::Value>, void* data) { | 131 void PendingListNode::WeakCallback(v8::Persistent<v8::Value>, void* data) { |
| 132 reinterpret_cast<PendingListNode*>(data)->Destroy(); | 132 reinterpret_cast<PendingListNode*>(data)->Destroy(); |
| 133 } | 133 } |
| 134 | 134 |
| 135 | 135 |
| 136 static bool IsOptimizable(JSFunction* function) { | 136 static bool IsOptimizable(JSFunction* function) { |
| 137 if (Heap::InNewSpace(function)) return false; |
| 137 Code* code = function->code(); | 138 Code* code = function->code(); |
| 138 return code->kind() == Code::FUNCTION && code->optimizable(); | 139 return code->kind() == Code::FUNCTION && code->optimizable(); |
| 139 } | 140 } |
| 140 | 141 |
| 141 | 142 |
| 142 static void Optimize(JSFunction* function, bool eager, int delay) { | 143 static void Optimize(JSFunction* function, bool eager, int delay) { |
| 143 ASSERT(IsOptimizable(function)); | 144 ASSERT(IsOptimizable(function)); |
| 144 if (FLAG_trace_opt) { | 145 if (FLAG_trace_opt) { |
| 145 PrintF("[marking (%s) ", eager ? "eagerly" : "lazily"); | 146 PrintF("[marking (%s) ", eager ? "eagerly" : "lazily"); |
| 146 function->PrintName(); | 147 function->PrintName(); |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 if (Top::WaitForJSState()) return true; | 452 if (Top::WaitForJSState()) return true; |
| 452 } | 453 } |
| 453 } | 454 } |
| 454 } | 455 } |
| 455 #endif | 456 #endif |
| 456 return false; | 457 return false; |
| 457 } | 458 } |
| 458 | 459 |
| 459 | 460 |
| 460 } } // namespace v8::internal | 461 } } // namespace v8::internal |
| OLD | NEW |