Chromium Code Reviews| 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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 198 if (!f->is_compiled()) { | 198 if (!f->is_compiled()) { |
| 199 // Do lazy compilation and check for stack overflows. | 199 // Do lazy compilation and check for stack overflows. |
| 200 if (!CompileLazy(f, CLEAR_EXCEPTION)) { | 200 if (!CompileLazy(f, CLEAR_EXCEPTION)) { |
| 201 Clear(); | 201 Clear(); |
| 202 return false; | 202 return false; |
| 203 } | 203 } |
| 204 } | 204 } |
| 205 Code* code = Code::cast(code_[i]); | 205 Code* code = Code::cast(code_[i]); |
| 206 Address pc = code->instruction_start() + pc_[i]; | 206 Address pc = code->instruction_start() + pc_[i]; |
| 207 bool is_pc_relative = Bootstrapper::FixupFlagsIsPCRelative::decode(flags); | 207 bool is_pc_relative = Bootstrapper::FixupFlagsIsPCRelative::decode(flags); |
| 208 if (is_pc_relative) { | 208 bool use_code_object = Bootstrapper::FixupFlagsUseCodeObject::decode(flags); |
| 209 | |
| 210 if (use_code_object) { | |
| 211 if (is_pc_relative) { | |
| 212 Assembler::set_target_address_at( | |
| 213 pc, reinterpret_cast<Address>(f->code())); | |
| 214 } else { | |
| 215 *reinterpret_cast<Object**>(pc) = f->code(); | |
| 216 } | |
| 217 } else { | |
| 218 ASSERT(is_pc_relative); | |
|
iposva
2008/11/10 22:38:57
Please add a comment why this assert is necessary.
Feng Qian
2008/11/11 18:36:40
As we discussed, current IA32 and ARM can only hav
| |
| 209 Assembler::set_target_address_at(pc, f->code()->instruction_start()); | 219 Assembler::set_target_address_at(pc, f->code()->instruction_start()); |
| 210 } else { | |
| 211 *reinterpret_cast<Object**>(pc) = f->code(); | |
| 212 } | 220 } |
| 221 | |
| 213 LOG(StringEvent("resolved", name)); | 222 LOG(StringEvent("resolved", name)); |
| 214 } | 223 } |
| 215 Clear(); | 224 Clear(); |
| 216 | 225 |
| 217 // TODO(1240818): We should probably try to avoid doing this for all | 226 // TODO(1240818): We should probably try to avoid doing this for all |
| 218 // the V8 builtin JS files. It should only happen after running | 227 // the V8 builtin JS files. It should only happen after running |
| 219 // runtime.js - just like there shouldn't be any fixups left after | 228 // runtime.js - just like there shouldn't be any fixups left after |
| 220 // that. | 229 // that. |
| 221 for (int i = 0; i < Builtins::NumberOfJavaScriptBuiltins(); i++) { | 230 for (int i = 0; i < Builtins::NumberOfJavaScriptBuiltins(); i++) { |
| 222 Builtins::JavaScript id = static_cast<Builtins::JavaScript>(i); | 231 Builtins::JavaScript id = static_cast<Builtins::JavaScript>(i); |
| (...skipping 1225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1448 if (!ConfigureGlobalObjects(global_template)) return; | 1457 if (!ConfigureGlobalObjects(global_template)) return; |
| 1449 | 1458 |
| 1450 if (!InstallExtensions(extensions)) return; | 1459 if (!InstallExtensions(extensions)) return; |
| 1451 | 1460 |
| 1452 if (!InstallSpecialObjects()) return; | 1461 if (!InstallSpecialObjects()) return; |
| 1453 | 1462 |
| 1454 result_ = global_context_; | 1463 result_ = global_context_; |
| 1455 } | 1464 } |
| 1456 | 1465 |
| 1457 } } // namespace v8::internal | 1466 } } // namespace v8::internal |
| OLD | NEW |