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 1930 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1941 ReadObject(OLD_DATA_SPACE, Heap::old_data_space(), current++); | 1941 ReadObject(OLD_DATA_SPACE, Heap::old_data_space(), current++); |
1942 break; | 1942 break; |
1943 case OBJECT_SERIALIZATION + OLD_POINTER_SPACE: | 1943 case OBJECT_SERIALIZATION + OLD_POINTER_SPACE: |
1944 ReadObject(OLD_POINTER_SPACE, Heap::old_pointer_space(), current++); | 1944 ReadObject(OLD_POINTER_SPACE, Heap::old_pointer_space(), current++); |
1945 break; | 1945 break; |
1946 case OBJECT_SERIALIZATION + MAP_SPACE: | 1946 case OBJECT_SERIALIZATION + MAP_SPACE: |
1947 ReadObject(MAP_SPACE, Heap::map_space(), current++); | 1947 ReadObject(MAP_SPACE, Heap::map_space(), current++); |
1948 break; | 1948 break; |
1949 case OBJECT_SERIALIZATION + CODE_SPACE: | 1949 case OBJECT_SERIALIZATION + CODE_SPACE: |
1950 ReadObject(CODE_SPACE, Heap::code_space(), current++); | 1950 ReadObject(CODE_SPACE, Heap::code_space(), current++); |
| 1951 Logger::LogCodeObject(current[-1]); |
1951 break; | 1952 break; |
1952 case OBJECT_SERIALIZATION + CELL_SPACE: | 1953 case OBJECT_SERIALIZATION + CELL_SPACE: |
1953 ReadObject(CELL_SPACE, Heap::cell_space(), current++); | 1954 ReadObject(CELL_SPACE, Heap::cell_space(), current++); |
1954 break; | 1955 break; |
1955 case OBJECT_SERIALIZATION + kLargeData: | 1956 case OBJECT_SERIALIZATION + kLargeData: |
1956 ReadObject(kLargeData, Heap::lo_space(), current++); | 1957 ReadObject(kLargeData, Heap::lo_space(), current++); |
1957 break; | 1958 break; |
1958 case OBJECT_SERIALIZATION + kLargeCode: | 1959 case OBJECT_SERIALIZATION + kLargeCode: |
1959 ReadObject(kLargeCode, Heap::lo_space(), current++); | 1960 ReadObject(kLargeCode, Heap::lo_space(), current++); |
| 1961 Logger::LogCodeObject(current[-1]); |
1960 break; | 1962 break; |
1961 case OBJECT_SERIALIZATION + kLargeFixedArray: | 1963 case OBJECT_SERIALIZATION + kLargeFixedArray: |
1962 ReadObject(kLargeFixedArray, Heap::lo_space(), current++); | 1964 ReadObject(kLargeFixedArray, Heap::lo_space(), current++); |
1963 break; | 1965 break; |
1964 case CODE_OBJECT_SERIALIZATION + kLargeCode: { | 1966 case CODE_OBJECT_SERIALIZATION + kLargeCode: { |
1965 Object* new_code_object = NULL; | 1967 Object* new_code_object = NULL; |
1966 ReadObject(kLargeCode, Heap::lo_space(), &new_code_object); | 1968 ReadObject(kLargeCode, Heap::lo_space(), &new_code_object); |
1967 Code* code_object = reinterpret_cast<Code*>(new_code_object); | 1969 Code* code_object = reinterpret_cast<Code*>(new_code_object); |
| 1970 Logger::LogCodeObject(code_object); |
1968 // Setting a branch/call to another code object from code. | 1971 // Setting a branch/call to another code object from code. |
1969 Address location_of_branch_data = reinterpret_cast<Address>(current); | 1972 Address location_of_branch_data = reinterpret_cast<Address>(current); |
1970 Assembler::set_target_at(location_of_branch_data, | 1973 Assembler::set_target_at(location_of_branch_data, |
1971 code_object->instruction_start()); | 1974 code_object->instruction_start()); |
1972 location_of_branch_data += Assembler::kCallTargetSize; | 1975 location_of_branch_data += Assembler::kCallTargetSize; |
1973 current = reinterpret_cast<Object**>(location_of_branch_data); | 1976 current = reinterpret_cast<Object**>(location_of_branch_data); |
1974 break; | 1977 break; |
1975 } | 1978 } |
1976 case CODE_OBJECT_SERIALIZATION + CODE_SPACE: { | 1979 case CODE_OBJECT_SERIALIZATION + CODE_SPACE: { |
1977 Object* new_code_object = NULL; | 1980 Object* new_code_object = NULL; |
1978 ReadObject(CODE_SPACE, Heap::code_space(), &new_code_object); | 1981 ReadObject(CODE_SPACE, Heap::code_space(), &new_code_object); |
1979 Code* code_object = reinterpret_cast<Code*>(new_code_object); | 1982 Code* code_object = reinterpret_cast<Code*>(new_code_object); |
| 1983 Logger::LogCodeObject(code_object); |
1980 // Setting a branch/call to another code object from code. | 1984 // Setting a branch/call to another code object from code. |
1981 Address location_of_branch_data = reinterpret_cast<Address>(current); | 1985 Address location_of_branch_data = reinterpret_cast<Address>(current); |
1982 Assembler::set_target_at(location_of_branch_data, | 1986 Assembler::set_target_at(location_of_branch_data, |
1983 code_object->instruction_start()); | 1987 code_object->instruction_start()); |
1984 location_of_branch_data += Assembler::kCallTargetSize; | 1988 location_of_branch_data += Assembler::kCallTargetSize; |
1985 current = reinterpret_cast<Object**>(location_of_branch_data); | 1989 current = reinterpret_cast<Object**>(location_of_branch_data); |
1986 break; | 1990 break; |
1987 } | 1991 } |
1988 ONE_CASE_PER_SPACE(BACKREF_SERIALIZATION) { | 1992 ONE_CASE_PER_SPACE(BACKREF_SERIALIZATION) { |
1989 // Write a backreference to an object we unpacked earlier. | 1993 // Write a backreference to an object we unpacked earlier. |
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2424 fullness_[space] = RoundUp(fullness_[space], Page::kPageSize); | 2428 fullness_[space] = RoundUp(fullness_[space], Page::kPageSize); |
2425 } | 2429 } |
2426 } | 2430 } |
2427 int allocation_address = fullness_[space]; | 2431 int allocation_address = fullness_[space]; |
2428 fullness_[space] = allocation_address + size; | 2432 fullness_[space] = allocation_address + size; |
2429 return allocation_address; | 2433 return allocation_address; |
2430 } | 2434 } |
2431 | 2435 |
2432 | 2436 |
2433 } } // namespace v8::internal | 2437 } } // namespace v8::internal |
OLD | NEW |