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 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 Object** p = ContextEntriesAddr(code); | 401 Object** p = ContextEntriesAddr(code); |
402 int n; // number of context slots; | 402 int n; // number of context slots; |
403 ReadInt(p, &n); | 403 ReadInt(p, &n); |
404 return n + Context::MIN_CONTEXT_SLOTS; | 404 return n + Context::MIN_CONTEXT_SLOTS; |
405 } | 405 } |
406 return 0; | 406 return 0; |
407 } | 407 } |
408 | 408 |
409 | 409 |
410 template<class Allocator> | 410 template<class Allocator> |
| 411 bool ScopeInfo<Allocator>::HasHeapAllocatedLocals(Code* code) { |
| 412 if (code->sinfo_size() > 0) { |
| 413 Object** p = ContextEntriesAddr(code); |
| 414 int n; // number of context slots; |
| 415 ReadInt(p, &n); |
| 416 return n > 0; |
| 417 } |
| 418 return false; |
| 419 } |
| 420 |
| 421 |
| 422 template<class Allocator> |
411 int ScopeInfo<Allocator>::StackSlotIndex(Code* code, String* name) { | 423 int ScopeInfo<Allocator>::StackSlotIndex(Code* code, String* name) { |
412 ASSERT(name->IsSymbol()); | 424 ASSERT(name->IsSymbol()); |
413 if (code->sinfo_size() > 0) { | 425 if (code->sinfo_size() > 0) { |
414 // Loop below depends on the NULL sentinel after the stack slot names. | 426 // Loop below depends on the NULL sentinel after the stack slot names. |
415 ASSERT(NumberOfStackSlots(code) > 0 || | 427 ASSERT(NumberOfStackSlots(code) > 0 || |
416 *(StackSlotEntriesAddr(code) + 1) == NULL); | 428 *(StackSlotEntriesAddr(code) + 1) == NULL); |
417 // slots start after length entry | 429 // slots start after length entry |
418 Object** p0 = StackSlotEntriesAddr(code) + 1; | 430 Object** p0 = StackSlotEntriesAddr(code) + 1; |
419 Object** p = p0; | 431 Object** p = p0; |
420 while (*p != NULL) { | 432 while (*p != NULL) { |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
640 } | 652 } |
641 #endif // DEBUG | 653 #endif // DEBUG |
642 | 654 |
643 | 655 |
644 // Make sure the classes get instantiated by the template system. | 656 // Make sure the classes get instantiated by the template system. |
645 template class ScopeInfo<FreeStoreAllocationPolicy>; | 657 template class ScopeInfo<FreeStoreAllocationPolicy>; |
646 template class ScopeInfo<PreallocatedStorage>; | 658 template class ScopeInfo<PreallocatedStorage>; |
647 template class ScopeInfo<ZoneListAllocationPolicy>; | 659 template class ScopeInfo<ZoneListAllocationPolicy>; |
648 | 660 |
649 } } // namespace v8::internal | 661 } } // namespace v8::internal |
OLD | NEW |