OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 jsfunction_candidates_head_ = function; | 240 jsfunction_candidates_head_ = function; |
241 } | 241 } |
242 | 242 |
243 void ProcessCandidates() { | 243 void ProcessCandidates() { |
244 ProcessSharedFunctionInfoCandidates(); | 244 ProcessSharedFunctionInfoCandidates(); |
245 ProcessJSFunctionCandidates(); | 245 ProcessJSFunctionCandidates(); |
246 } | 246 } |
247 | 247 |
248 private: | 248 private: |
249 void ProcessJSFunctionCandidates() { | 249 void ProcessJSFunctionCandidates() { |
250 Code* lazy_compile = isolate_->builtins()->builtin(Builtins::LazyCompile); | 250 Code* lazy_compile = isolate_->builtins()->builtin(Builtins::kLazyCompile); |
251 | 251 |
252 JSFunction* candidate = jsfunction_candidates_head_; | 252 JSFunction* candidate = jsfunction_candidates_head_; |
253 JSFunction* next_candidate; | 253 JSFunction* next_candidate; |
254 while (candidate != NULL) { | 254 while (candidate != NULL) { |
255 next_candidate = GetNextCandidate(candidate); | 255 next_candidate = GetNextCandidate(candidate); |
256 | 256 |
257 SharedFunctionInfo* shared = candidate->unchecked_shared(); | 257 SharedFunctionInfo* shared = candidate->unchecked_shared(); |
258 | 258 |
259 Code* code = shared->unchecked_code(); | 259 Code* code = shared->unchecked_code(); |
260 if (!code->IsMarked()) { | 260 if (!code->IsMarked()) { |
261 shared->set_code(lazy_compile); | 261 shared->set_code(lazy_compile); |
262 candidate->set_code(lazy_compile); | 262 candidate->set_code(lazy_compile); |
263 } else { | 263 } else { |
264 candidate->set_code(shared->unchecked_code()); | 264 candidate->set_code(shared->unchecked_code()); |
265 } | 265 } |
266 | 266 |
267 candidate = next_candidate; | 267 candidate = next_candidate; |
268 } | 268 } |
269 | 269 |
270 jsfunction_candidates_head_ = NULL; | 270 jsfunction_candidates_head_ = NULL; |
271 } | 271 } |
272 | 272 |
273 | 273 |
274 void ProcessSharedFunctionInfoCandidates() { | 274 void ProcessSharedFunctionInfoCandidates() { |
275 Code* lazy_compile = isolate_->builtins()->builtin(Builtins::LazyCompile); | 275 Code* lazy_compile = isolate_->builtins()->builtin(Builtins::kLazyCompile); |
276 | 276 |
277 SharedFunctionInfo* candidate = shared_function_info_candidates_head_; | 277 SharedFunctionInfo* candidate = shared_function_info_candidates_head_; |
278 SharedFunctionInfo* next_candidate; | 278 SharedFunctionInfo* next_candidate; |
279 while (candidate != NULL) { | 279 while (candidate != NULL) { |
280 next_candidate = GetNextCandidate(candidate); | 280 next_candidate = GetNextCandidate(candidate); |
281 SetNextCandidate(candidate, NULL); | 281 SetNextCandidate(candidate, NULL); |
282 | 282 |
283 Code* code = candidate->unchecked_code(); | 283 Code* code = candidate->unchecked_code(); |
284 if (!code->IsMarked()) { | 284 if (!code->IsMarked()) { |
285 candidate->set_code(lazy_compile); | 285 candidate->set_code(lazy_compile); |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
563 | 563 |
564 inline static bool HasSourceCode(SharedFunctionInfo* info) { | 564 inline static bool HasSourceCode(SharedFunctionInfo* info) { |
565 Object* undefined = HEAP->raw_unchecked_undefined_value(); | 565 Object* undefined = HEAP->raw_unchecked_undefined_value(); |
566 return (info->script() != undefined) && | 566 return (info->script() != undefined) && |
567 (reinterpret_cast<Script*>(info->script())->source() != undefined); | 567 (reinterpret_cast<Script*>(info->script())->source() != undefined); |
568 } | 568 } |
569 | 569 |
570 | 570 |
571 inline static bool IsCompiled(JSFunction* function) { | 571 inline static bool IsCompiled(JSFunction* function) { |
572 return function->unchecked_code() != | 572 return function->unchecked_code() != |
573 Isolate::Current()->builtins()->builtin(Builtins::LazyCompile); | 573 Isolate::Current()->builtins()->builtin(Builtins::kLazyCompile); |
574 } | 574 } |
575 | 575 |
576 inline static bool IsCompiled(SharedFunctionInfo* function) { | 576 inline static bool IsCompiled(SharedFunctionInfo* function) { |
577 return function->unchecked_code() != | 577 return function->unchecked_code() != |
578 Isolate::Current()->builtins()->builtin(Builtins::LazyCompile); | 578 Isolate::Current()->builtins()->builtin(Builtins::kLazyCompile); |
579 } | 579 } |
580 | 580 |
581 inline static bool IsFlushable(JSFunction* function) { | 581 inline static bool IsFlushable(JSFunction* function) { |
582 SharedFunctionInfo* shared_info = function->unchecked_shared(); | 582 SharedFunctionInfo* shared_info = function->unchecked_shared(); |
583 | 583 |
584 // Code is either on stack, in compilation cache or referenced | 584 // Code is either on stack, in compilation cache or referenced |
585 // by optimized version of function. | 585 // by optimized version of function. |
586 if (function->unchecked_code()->IsMarked()) { | 586 if (function->unchecked_code()->IsMarked()) { |
587 shared_info->set_code_age(0); | 587 shared_info->set_code_age(0); |
588 return false; | 588 return false; |
(...skipping 2478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3067 } | 3067 } |
3068 | 3068 |
3069 | 3069 |
3070 void MarkCompactCollector::Initialize() { | 3070 void MarkCompactCollector::Initialize() { |
3071 StaticPointersToNewGenUpdatingVisitor::Initialize(); | 3071 StaticPointersToNewGenUpdatingVisitor::Initialize(); |
3072 StaticMarkingVisitor::Initialize(); | 3072 StaticMarkingVisitor::Initialize(); |
3073 } | 3073 } |
3074 | 3074 |
3075 | 3075 |
3076 } } // namespace v8::internal | 3076 } } // namespace v8::internal |
OLD | NEW |