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 1291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1302 if (flags == CALL_JS) { | 1302 if (flags == CALL_JS) { |
1303 Call(r2); | 1303 Call(r2); |
1304 } else { | 1304 } else { |
1305 ASSERT(flags == JUMP_JS); | 1305 ASSERT(flags == JUMP_JS); |
1306 Jump(r2); | 1306 Jump(r2); |
1307 } | 1307 } |
1308 } | 1308 } |
1309 | 1309 |
1310 | 1310 |
1311 void MacroAssembler::GetBuiltinEntry(Register target, Builtins::JavaScript id) { | 1311 void MacroAssembler::GetBuiltinEntry(Register target, Builtins::JavaScript id) { |
| 1312 ASSERT(!target.is(r1)); |
| 1313 |
| 1314 // Load the builtins object into target register. |
| 1315 ldr(target, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_INDEX))); |
| 1316 ldr(target, FieldMemOperand(target, GlobalObject::kBuiltinsOffset)); |
| 1317 |
1312 // Load the JavaScript builtin function from the builtins object. | 1318 // Load the JavaScript builtin function from the builtins object. |
1313 ldr(r1, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_INDEX))); | 1319 ldr(r1, FieldMemOperand(target, |
1314 ldr(r1, FieldMemOperand(r1, GlobalObject::kBuiltinsOffset)); | 1320 JSBuiltinsObject::OffsetOfFunctionWithId(id))); |
1315 int builtins_offset = | 1321 |
1316 JSBuiltinsObject::kJSBuiltinsOffset + (id * kPointerSize); | 1322 // Load the code entry point from the builtins object. |
1317 ldr(r1, FieldMemOperand(r1, builtins_offset)); | 1323 ldr(target, FieldMemOperand(target, |
1318 // Load the code entry point from the function into the target register. | 1324 JSBuiltinsObject::OffsetOfCodeWithId(id))); |
1319 ldr(target, FieldMemOperand(r1, JSFunction::kSharedFunctionInfoOffset)); | |
1320 ldr(target, FieldMemOperand(target, SharedFunctionInfo::kCodeOffset)); | |
1321 add(target, target, Operand(Code::kHeaderSize - kHeapObjectTag)); | 1325 add(target, target, Operand(Code::kHeaderSize - kHeapObjectTag)); |
1322 } | 1326 } |
1323 | 1327 |
1324 | 1328 |
1325 void MacroAssembler::SetCounter(StatsCounter* counter, int value, | 1329 void MacroAssembler::SetCounter(StatsCounter* counter, int value, |
1326 Register scratch1, Register scratch2) { | 1330 Register scratch1, Register scratch2) { |
1327 if (FLAG_native_code_counters && counter->Enabled()) { | 1331 if (FLAG_native_code_counters && counter->Enabled()) { |
1328 mov(scratch1, Operand(value)); | 1332 mov(scratch1, Operand(value)); |
1329 mov(scratch2, Operand(ExternalReference(counter))); | 1333 mov(scratch2, Operand(ExternalReference(counter))); |
1330 str(scratch1, MemOperand(scratch2)); | 1334 str(scratch1, MemOperand(scratch2)); |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1624 } | 1628 } |
1625 | 1629 |
1626 | 1630 |
1627 void CodePatcher::Emit(Address addr) { | 1631 void CodePatcher::Emit(Address addr) { |
1628 masm()->emit(reinterpret_cast<Instr>(addr)); | 1632 masm()->emit(reinterpret_cast<Instr>(addr)); |
1629 } | 1633 } |
1630 #endif // ENABLE_DEBUGGER_SUPPORT | 1634 #endif // ENABLE_DEBUGGER_SUPPORT |
1631 | 1635 |
1632 | 1636 |
1633 } } // namespace v8::internal | 1637 } } // namespace v8::internal |
OLD | NEW |