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

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

Issue 9373022: Streamline throwing in the C entry stub. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 10 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
« no previous file with comments | « 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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 2534 matching lines...) Expand 10 before | Expand all | Expand 10 after
2545 Label skip; 2545 Label skip;
2546 testq(rsi, rsi); 2546 testq(rsi, rsi);
2547 j(zero, &skip, Label::kNear); 2547 j(zero, &skip, Label::kNear);
2548 movq(Operand(rbp, StandardFrameConstants::kContextOffset), rsi); 2548 movq(Operand(rbp, StandardFrameConstants::kContextOffset), rsi);
2549 bind(&skip); 2549 bind(&skip);
2550 2550
2551 JumpToHandlerEntry(); 2551 JumpToHandlerEntry();
2552 } 2552 }
2553 2553
2554 2554
2555 void MacroAssembler::ThrowUncatchable(UncatchableExceptionType type, 2555 void MacroAssembler::ThrowUncatchable(Register value) {
2556 Register value) {
2557 // Adjust this code if not the case. 2556 // Adjust this code if not the case.
2558 STATIC_ASSERT(StackHandlerConstants::kSize == 5 * kPointerSize); 2557 STATIC_ASSERT(StackHandlerConstants::kSize == 5 * kPointerSize);
2559 STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0); 2558 STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0);
2560 STATIC_ASSERT(StackHandlerConstants::kCodeOffset == 1 * kPointerSize); 2559 STATIC_ASSERT(StackHandlerConstants::kCodeOffset == 1 * kPointerSize);
2561 STATIC_ASSERT(StackHandlerConstants::kStateOffset == 2 * kPointerSize); 2560 STATIC_ASSERT(StackHandlerConstants::kStateOffset == 2 * kPointerSize);
2562 STATIC_ASSERT(StackHandlerConstants::kContextOffset == 3 * kPointerSize); 2561 STATIC_ASSERT(StackHandlerConstants::kContextOffset == 3 * kPointerSize);
2563 STATIC_ASSERT(StackHandlerConstants::kFPOffset == 4 * kPointerSize); 2562 STATIC_ASSERT(StackHandlerConstants::kFPOffset == 4 * kPointerSize);
2564 2563
2565 // The exception is expected in rax. 2564 // The exception is expected in rax.
2566 if (type == OUT_OF_MEMORY) { 2565 if (!value.is(rax)) {
2567 // Set external caught exception to false.
2568 ExternalReference external_caught(Isolate::kExternalCaughtExceptionAddress,
2569 isolate());
2570 Set(rax, static_cast<int64_t>(false));
2571 Store(external_caught, rax);
2572
2573 // Set pending exception and rax to out of memory exception.
2574 ExternalReference pending_exception(Isolate::kPendingExceptionAddress,
2575 isolate());
2576 movq(rax, Failure::OutOfMemoryException(), RelocInfo::NONE);
2577 Store(pending_exception, rax);
2578 } else if (!value.is(rax)) {
2579 movq(rax, value); 2566 movq(rax, value);
2580 } 2567 }
2581
2582 // Drop the stack pointer to the top of the top stack handler. 2568 // Drop the stack pointer to the top of the top stack handler.
2583 ExternalReference handler_address(Isolate::kHandlerAddress, isolate()); 2569 ExternalReference handler_address(Isolate::kHandlerAddress, isolate());
2584 Load(rsp, handler_address); 2570 Load(rsp, handler_address);
2585 2571
2586 // Unwind the handlers until the top ENTRY handler is found. 2572 // Unwind the handlers until the top ENTRY handler is found.
2587 Label fetch_next, check_kind; 2573 Label fetch_next, check_kind;
2588 jmp(&check_kind, Label::kNear); 2574 jmp(&check_kind, Label::kNear);
2589 bind(&fetch_next); 2575 bind(&fetch_next);
2590 movq(rsp, Operand(rsp, StackHandlerConstants::kNextOffset)); 2576 movq(rsp, Operand(rsp, StackHandlerConstants::kNextOffset));
2591 2577
(...skipping 1782 matching lines...) Expand 10 before | Expand all | Expand 10 after
4374 4360
4375 and_(bitmap_scratch, Immediate(~Page::kPageAlignmentMask)); 4361 and_(bitmap_scratch, Immediate(~Page::kPageAlignmentMask));
4376 addl(Operand(bitmap_scratch, MemoryChunk::kLiveBytesOffset), length); 4362 addl(Operand(bitmap_scratch, MemoryChunk::kLiveBytesOffset), length);
4377 4363
4378 bind(&done); 4364 bind(&done);
4379 } 4365 }
4380 4366
4381 } } // namespace v8::internal 4367 } } // namespace v8::internal
4382 4368
4383 #endif // V8_TARGET_ARCH_X64 4369 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/macro-assembler-x64.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698