| OLD | NEW |
| 1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 1351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1362 // reading it from the builtins object. NOTE: We should be able to | 1362 // reading it from the builtins object. NOTE: We should be able to |
| 1363 // reduce this to two instructions by putting the function table in | 1363 // reduce this to two instructions by putting the function table in |
| 1364 // the global object instead of the "builtins" object and by using a | 1364 // the global object instead of the "builtins" object and by using a |
| 1365 // real register for the function. | 1365 // real register for the function. |
| 1366 mov(edx, Operand(esi, Context::SlotOffset(Context::GLOBAL_INDEX))); | 1366 mov(edx, Operand(esi, Context::SlotOffset(Context::GLOBAL_INDEX))); |
| 1367 mov(edx, FieldOperand(edx, GlobalObject::kBuiltinsOffset)); | 1367 mov(edx, FieldOperand(edx, GlobalObject::kBuiltinsOffset)); |
| 1368 int builtins_offset = | 1368 int builtins_offset = |
| 1369 JSBuiltinsObject::kJSBuiltinsOffset + (id * kPointerSize); | 1369 JSBuiltinsObject::kJSBuiltinsOffset + (id * kPointerSize); |
| 1370 mov(edi, FieldOperand(edx, builtins_offset)); | 1370 mov(edi, FieldOperand(edx, builtins_offset)); |
| 1371 | 1371 |
| 1372 | |
| 1373 return Builtins::GetCode(id, resolved); | 1372 return Builtins::GetCode(id, resolved); |
| 1374 } | 1373 } |
| 1375 | 1374 |
| 1376 | 1375 |
| 1377 void MacroAssembler::LoadContext(Register dst, int context_chain_length) { | 1376 void MacroAssembler::LoadContext(Register dst, int context_chain_length) { |
| 1378 if (context_chain_length > 0) { | 1377 if (context_chain_length > 0) { |
| 1379 // Move up the chain of contexts to the context containing the slot. | 1378 // Move up the chain of contexts to the context containing the slot. |
| 1380 mov(dst, Operand(esi, Context::SlotOffset(Context::CLOSURE_INDEX))); | 1379 mov(dst, Operand(esi, Context::SlotOffset(Context::CLOSURE_INDEX))); |
| 1381 // Load the function context (which is the incoming, outer context). | 1380 // Load the function context (which is the incoming, outer context). |
| 1382 mov(dst, FieldOperand(dst, JSFunction::kContextOffset)); | 1381 mov(dst, FieldOperand(dst, JSFunction::kContextOffset)); |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1498 // Indicate that code has changed. | 1497 // Indicate that code has changed. |
| 1499 CPU::FlushICache(address_, size_); | 1498 CPU::FlushICache(address_, size_); |
| 1500 | 1499 |
| 1501 // Check that the code was patched as expected. | 1500 // Check that the code was patched as expected. |
| 1502 ASSERT(masm_.pc_ == address_ + size_); | 1501 ASSERT(masm_.pc_ == address_ + size_); |
| 1503 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); | 1502 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); |
| 1504 } | 1503 } |
| 1505 | 1504 |
| 1506 | 1505 |
| 1507 } } // namespace v8::internal | 1506 } } // namespace v8::internal |
| OLD | NEW |