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

Side by Side Diff: src/x64/macro-assembler-x64.cc

Issue 466033: Fast codegen: Working break and continue. (Closed)
Patch Set: Fixed bug in ARM PopTryHandler, merge with head. Created 11 years 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
« src/fast-codegen.cc ('K') | « src/x64/macro-assembler-x64.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2009 the V8 project authors. All rights reserved. 1 // Copyright 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 1327 matching lines...) Expand 10 before | Expand all | Expand 10 after
1338 intptr_t smi = reinterpret_cast<intptr_t>(source); 1338 intptr_t smi = reinterpret_cast<intptr_t>(source);
1339 if (is_int32(smi)) { 1339 if (is_int32(smi)) {
1340 push(Immediate(static_cast<int32_t>(smi))); 1340 push(Immediate(static_cast<int32_t>(smi)));
1341 } else { 1341 } else {
1342 Set(kScratchRegister, smi); 1342 Set(kScratchRegister, smi);
1343 push(kScratchRegister); 1343 push(kScratchRegister);
1344 } 1344 }
1345 } 1345 }
1346 1346
1347 1347
1348 void MacroAssembler::Drop(int stack_elements) {
1349 if (stack_elements > 0) {
1350 addq(rsp, Immediate(stack_elements * kPointerSize));
1351 }
1352 }
1353
1354
1348 void MacroAssembler::Test(const Operand& src, Smi* source) { 1355 void MacroAssembler::Test(const Operand& src, Smi* source) {
1349 intptr_t smi = reinterpret_cast<intptr_t>(source); 1356 intptr_t smi = reinterpret_cast<intptr_t>(source);
1350 if (is_int32(smi)) { 1357 if (is_int32(smi)) {
1351 testl(src, Immediate(static_cast<int32_t>(smi))); 1358 testl(src, Immediate(static_cast<int32_t>(smi)));
1352 } else { 1359 } else {
1353 Move(kScratchRegister, source); 1360 Move(kScratchRegister, source);
1354 testq(src, kScratchRegister); 1361 testq(src, kScratchRegister);
1355 } 1362 }
1356 } 1363 }
1357 1364
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
1424 push(Immediate(0)); // NULL frame pointer. 1431 push(Immediate(0)); // NULL frame pointer.
1425 } 1432 }
1426 // Save the current handler. 1433 // Save the current handler.
1427 movq(kScratchRegister, ExternalReference(Top::k_handler_address)); 1434 movq(kScratchRegister, ExternalReference(Top::k_handler_address));
1428 push(Operand(kScratchRegister, 0)); 1435 push(Operand(kScratchRegister, 0));
1429 // Link this handler. 1436 // Link this handler.
1430 movq(Operand(kScratchRegister, 0), rsp); 1437 movq(Operand(kScratchRegister, 0), rsp);
1431 } 1438 }
1432 1439
1433 1440
1441 void MacroAssembler::PopTryHandler() {
1442 ASSERT_EQ(0, StackHandlerConstants::kNextOffset);
1443 movq(kScratchRegister, ExternalReference(Top::k_handler_address));
1444 pop(Operand(kScratchRegister, 0));
1445 addq(rsp, Immediate(StackHandlerConstants::kSize - kPointerSize));
1446 }
1447
1448
1434 void MacroAssembler::Ret() { 1449 void MacroAssembler::Ret() {
1435 ret(0); 1450 ret(0);
1436 } 1451 }
1437 1452
1438 1453
1439 void MacroAssembler::FCmp() { 1454 void MacroAssembler::FCmp() {
1440 fucomip(); 1455 fucomip();
1441 ffree(0); 1456 ffree(0);
1442 fincstp(); 1457 fincstp();
1443 } 1458 }
(...skipping 939 matching lines...) Expand 10 before | Expand all | Expand 10 after
2383 CodePatcher::~CodePatcher() { 2398 CodePatcher::~CodePatcher() {
2384 // Indicate that code has changed. 2399 // Indicate that code has changed.
2385 CPU::FlushICache(address_, size_); 2400 CPU::FlushICache(address_, size_);
2386 2401
2387 // Check that the code was patched as expected. 2402 // Check that the code was patched as expected.
2388 ASSERT(masm_.pc_ == address_ + size_); 2403 ASSERT(masm_.pc_ == address_ + size_);
2389 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); 2404 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap);
2390 } 2405 }
2391 2406
2392 } } // namespace v8::internal 2407 } } // namespace v8::internal
OLDNEW
« src/fast-codegen.cc ('K') | « src/x64/macro-assembler-x64.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698