Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(43)

Side by Side Diff: src/ia32/assembler-ia32.cc

Issue 6824078: Move most of the incremental marking write barrier to generated code. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/gc/
Patch Set: '' Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 1994-2006 Sun Microsystems Inc. 1 // Copyright (c) 1994-2006 Sun Microsystems Inc.
2 // All Rights Reserved. 2 // All Rights Reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions 5 // modification, are permitted provided that the following conditions
6 // are met: 6 // are met:
7 // 7 //
8 // - Redistributions of source code must retain the above copyright notice, 8 // - Redistributions of source code must retain the above copyright notice,
9 // this list of conditions and the following disclaimer. 9 // this list of conditions and the following disclaimer.
10 // 10 //
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 set_sib(scale, index, ebp); 276 set_sib(scale, index, ebp);
277 set_dispr(disp, rmode); 277 set_dispr(disp, rmode);
278 } 278 }
279 279
280 280
281 bool Operand::is_reg(Register reg) const { 281 bool Operand::is_reg(Register reg) const {
282 return ((buf_[0] & 0xF8) == 0xC0) // addressing mode is register only. 282 return ((buf_[0] & 0xF8) == 0xC0) // addressing mode is register only.
283 && ((buf_[0] & 0x07) == reg.code()); // register codes match. 283 && ((buf_[0] & 0x07) == reg.code()); // register codes match.
284 } 284 }
285 285
286
287 bool Operand::is_reg_only() const {
288 return (buf_[0] & 0xF8) == 0xC0; // Addressing mode is register only.
289 }
290
291
292 Register Operand::reg() const {
293 ASSERT(is_reg_only());
294 return Register::from_code(buf_[0] & 0x07);
295 }
296
297
286 // ----------------------------------------------------------------------------- 298 // -----------------------------------------------------------------------------
287 // Implementation of Assembler. 299 // Implementation of Assembler.
288 300
289 // Emit a single byte. Must always be inlined. 301 // Emit a single byte. Must always be inlined.
290 #define EMIT(x) \ 302 #define EMIT(x) \
291 *pc_++ = (x) 303 *pc_++ = (x)
292 304
293 305
294 #ifdef GENERATED_CODE_COVERAGE 306 #ifdef GENERATED_CODE_COVERAGE
295 static void InitCoverageLog(); 307 static void InitCoverageLog();
(...skipping 1070 matching lines...) Expand 10 before | Expand all | Expand 10 after
1366 void Assembler::test(const Operand& op, const Immediate& imm) { 1378 void Assembler::test(const Operand& op, const Immediate& imm) {
1367 EnsureSpace ensure_space(this); 1379 EnsureSpace ensure_space(this);
1368 last_pc_ = pc_; 1380 last_pc_ = pc_;
1369 EMIT(0xF7); 1381 EMIT(0xF7);
1370 emit_operand(eax, op); 1382 emit_operand(eax, op);
1371 emit(imm); 1383 emit(imm);
1372 } 1384 }
1373 1385
1374 1386
1375 void Assembler::test_b(const Operand& op, uint8_t imm8) { 1387 void Assembler::test_b(const Operand& op, uint8_t imm8) {
1388 if (op.is_reg_only() && op.reg().code() >= 4) {
1389 test(op, Immediate(imm8));
1390 return;
1391 }
1376 EnsureSpace ensure_space(this); 1392 EnsureSpace ensure_space(this);
1377 last_pc_ = pc_; 1393 last_pc_ = pc_;
1378 EMIT(0xF6); 1394 EMIT(0xF6);
1379 emit_operand(eax, op); 1395 emit_operand(eax, op);
1380 EMIT(imm8); 1396 EMIT(imm8);
1381 } 1397 }
1382 1398
1383 1399
1384 void Assembler::xor_(Register dst, int32_t imm32) { 1400 void Assembler::xor_(Register dst, int32_t imm32) {
1385 EnsureSpace ensure_space(this); 1401 EnsureSpace ensure_space(this);
(...skipping 1406 matching lines...) Expand 10 before | Expand all | Expand 10 after
2792 fprintf(coverage_log, "%s\n", file_line); 2808 fprintf(coverage_log, "%s\n", file_line);
2793 fflush(coverage_log); 2809 fflush(coverage_log);
2794 } 2810 }
2795 } 2811 }
2796 2812
2797 #endif 2813 #endif
2798 2814
2799 } } // namespace v8::internal 2815 } } // namespace v8::internal
2800 2816
2801 #endif // V8_TARGET_ARCH_IA32 2817 #endif // V8_TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698