| 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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 ASSERT(f->shared()->formal_parameter_count() == argc); | 194 ASSERT(f->shared()->formal_parameter_count() == argc); |
| 195 if (!f->is_compiled()) { | 195 if (!f->is_compiled()) { |
| 196 // Do lazy compilation and check for stack overflows. | 196 // Do lazy compilation and check for stack overflows. |
| 197 if (!CompileLazy(f, CLEAR_EXCEPTION)) { | 197 if (!CompileLazy(f, CLEAR_EXCEPTION)) { |
| 198 Clear(); | 198 Clear(); |
| 199 return false; | 199 return false; |
| 200 } | 200 } |
| 201 } | 201 } |
| 202 Code* code = Code::cast(code_[i]); | 202 Code* code = Code::cast(code_[i]); |
| 203 Address pc = code->instruction_start() + pc_[i]; | 203 Address pc = code->instruction_start() + pc_[i]; |
| 204 bool is_pc_relative = Bootstrapper::FixupFlagsIsPCRelative::decode(flags); | 204 RelocInfo target(pc, RelocInfo::CODE_TARGET, 0); |
| 205 bool use_code_object = Bootstrapper::FixupFlagsUseCodeObject::decode(flags); | 205 bool use_code_object = Bootstrapper::FixupFlagsUseCodeObject::decode(flags); |
| 206 | |
| 207 if (use_code_object) { | 206 if (use_code_object) { |
| 208 if (is_pc_relative) { | 207 target.set_target_object(f->code()); |
| 209 Assembler::set_target_address_at( | |
| 210 pc, reinterpret_cast<Address>(f->code())); | |
| 211 } else { | |
| 212 *reinterpret_cast<Object**>(pc) = f->code(); | |
| 213 } | |
| 214 } else { | 208 } else { |
| 215 Assembler::set_target_address_at(pc, f->code()->instruction_start()); | 209 target.set_target_address(f->code()->instruction_start()); |
| 216 } | 210 } |
| 217 | |
| 218 LOG(StringEvent("resolved", name)); | 211 LOG(StringEvent("resolved", name)); |
| 219 } | 212 } |
| 220 Clear(); | 213 Clear(); |
| 221 | 214 |
| 222 // TODO(1240818): We should probably try to avoid doing this for all | 215 // TODO(1240818): We should probably try to avoid doing this for all |
| 223 // the V8 builtin JS files. It should only happen after running | 216 // the V8 builtin JS files. It should only happen after running |
| 224 // runtime.js - just like there shouldn't be any fixups left after | 217 // runtime.js - just like there shouldn't be any fixups left after |
| 225 // that. | 218 // that. |
| 226 for (int i = 0; i < Builtins::NumberOfJavaScriptBuiltins(); i++) { | 219 for (int i = 0; i < Builtins::NumberOfJavaScriptBuiltins(); i++) { |
| 227 Builtins::JavaScript id = static_cast<Builtins::JavaScript>(i); | 220 Builtins::JavaScript id = static_cast<Builtins::JavaScript>(i); |
| (...skipping 1378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1606 } | 1599 } |
| 1607 | 1600 |
| 1608 | 1601 |
| 1609 // Restore statics that are thread local. | 1602 // Restore statics that are thread local. |
| 1610 char* Genesis::RestoreState(char* from) { | 1603 char* Genesis::RestoreState(char* from) { |
| 1611 current_ = *reinterpret_cast<Genesis**>(from); | 1604 current_ = *reinterpret_cast<Genesis**>(from); |
| 1612 return from + sizeof(current_); | 1605 return from + sizeof(current_); |
| 1613 } | 1606 } |
| 1614 | 1607 |
| 1615 } } // namespace v8::internal | 1608 } } // namespace v8::internal |
| OLD | NEW |