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

Side by Side Diff: src/x64/codegen-x64.cc

Issue 150007: X64: Fix error in running handlers, disable TakeValue optimization for count ... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 5 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 | « no previous file | 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 2272 matching lines...) Expand 10 before | Expand all | Expand 10 after
2283 // TODO(X64): Enable this and the switch back to fast, once they work. 2283 // TODO(X64): Enable this and the switch back to fast, once they work.
2284 // frame_->PushElementAt(target.size() - 1); 2284 // frame_->PushElementAt(target.size() - 1);
2285 // Result ignored = frame_->CallRuntime(Runtime::kToSlowProperties, 1); 2285 // Result ignored = frame_->CallRuntime(Runtime::kToSlowProperties, 1);
2286 } 2286 }
2287 if (node->op() == Token::ASSIGN || 2287 if (node->op() == Token::ASSIGN ||
2288 node->op() == Token::INIT_VAR || 2288 node->op() == Token::INIT_VAR ||
2289 node->op() == Token::INIT_CONST) { 2289 node->op() == Token::INIT_CONST) {
2290 Load(node->value()); 2290 Load(node->value());
2291 2291
2292 } else { 2292 } else {
2293 Literal* literal = node->value()->AsLiteral(); 2293 // Literal* literal = node->value()->AsLiteral();
2294 bool overwrite_value = 2294 bool overwrite_value =
2295 (node->value()->AsBinaryOperation() != NULL && 2295 (node->value()->AsBinaryOperation() != NULL &&
2296 node->value()->AsBinaryOperation()->ResultOverwriteAllowed()); 2296 node->value()->AsBinaryOperation()->ResultOverwriteAllowed());
2297 Variable* right_var = node->value()->AsVariableProxy()->AsVariable(); 2297 // Variable* right_var = node->value()->AsVariableProxy()->AsVariable();
2298 // There are two cases where the target is not read in the right hand 2298 // There are two cases where the target is not read in the right hand
2299 // side, that are easy to test for: the right hand side is a literal, 2299 // side, that are easy to test for: the right hand side is a literal,
2300 // or the right hand side is a different variable. TakeValue invalidates 2300 // or the right hand side is a different variable. TakeValue invalidates
2301 // the target, with an implicit promise that it will be written to again 2301 // the target, with an implicit promise that it will be written to again
2302 // before it is read. 2302 // before it is read.
2303 // TODO(X64): Implement TakeValue optimization. 2303 // TODO(X64): Implement TakeValue optimization.
2304 if (false) { 2304 if (false) {
2305 // if (literal != NULL || (right_var != NULL && right_var != var)) { 2305 // if (literal != NULL || (right_var != NULL && right_var != var)) {
2306 // target.TakeValue(NOT_INSIDE_TYPEOF); 2306 // target.TakeValue(NOT_INSIDE_TYPEOF);
2307 } else { 2307 } else {
(...skipping 3525 matching lines...) Expand 10 before | Expand all | Expand 10 after
5833 5833
5834 // Arguments adaptor case: Read the arguments length from the 5834 // Arguments adaptor case: Read the arguments length from the
5835 // adaptor frame and return it. 5835 // adaptor frame and return it.
5836 __ bind(&adaptor); 5836 __ bind(&adaptor);
5837 __ movq(rax, Operand(rdx, ArgumentsAdaptorFrameConstants::kLengthOffset)); 5837 __ movq(rax, Operand(rdx, ArgumentsAdaptorFrameConstants::kLengthOffset));
5838 __ ret(0); 5838 __ ret(0);
5839 } 5839 }
5840 5840
5841 5841
5842 void CEntryStub::GenerateThrowTOS(MacroAssembler* masm) { 5842 void CEntryStub::GenerateThrowTOS(MacroAssembler* masm) {
5843 // Check that stack should contain frame pointer, code pointer, state and 5843 // Check that stack should contain next handler, frame pointer, state and
5844 // return address in that order. 5844 // return address in that order.
5845 ASSERT_EQ(StackHandlerConstants::kFPOffset + kPointerSize, 5845 ASSERT_EQ(StackHandlerConstants::kFPOffset + kPointerSize,
5846 StackHandlerConstants::kStateOffset); 5846 StackHandlerConstants::kStateOffset);
5847 ASSERT_EQ(StackHandlerConstants::kStateOffset + kPointerSize, 5847 ASSERT_EQ(StackHandlerConstants::kStateOffset + kPointerSize,
5848 StackHandlerConstants::kPCOffset); 5848 StackHandlerConstants::kPCOffset);
5849 5849
5850 ExternalReference handler_address(Top::k_handler_address); 5850 ExternalReference handler_address(Top::k_handler_address);
5851 __ movq(kScratchRegister, handler_address); 5851 __ movq(kScratchRegister, handler_address);
5852 __ movq(rdx, Operand(kScratchRegister, 0)); 5852 __ movq(rsp, Operand(kScratchRegister, 0));
5853 // get next in chain 5853 // get next in chain
5854 __ movq(rcx, Operand(rdx, 0)); 5854 __ pop(rcx);
5855 __ movq(Operand(kScratchRegister, 0), rcx); 5855 __ movq(Operand(kScratchRegister, 0), rcx);
5856 __ movq(rsp, rdx);
5857 __ pop(rbp); // pop frame pointer 5856 __ pop(rbp); // pop frame pointer
5858 __ pop(rdx); // remove code pointer
5859 __ pop(rdx); // remove state 5857 __ pop(rdx); // remove state
5860 5858
5861 // Before returning we restore the context from the frame pointer if not NULL. 5859 // Before returning we restore the context from the frame pointer if not NULL.
5862 // The frame pointer is NULL in the exception handler of a JS entry frame. 5860 // The frame pointer is NULL in the exception handler of a JS entry frame.
5863 __ xor_(rsi, rsi); // tentatively set context pointer to NULL 5861 __ xor_(rsi, rsi); // tentatively set context pointer to NULL
5864 Label skip; 5862 Label skip;
5865 __ cmpq(rbp, Immediate(0)); 5863 __ cmpq(rbp, Immediate(0));
5866 __ j(equal, &skip); 5864 __ j(equal, &skip);
5867 __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); 5865 __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset));
5868 __ bind(&skip); 5866 __ bind(&skip);
5869
5870 __ ret(0); 5867 __ ret(0);
5871 } 5868 }
5872 5869
5873 5870
5874 void CEntryStub::GenerateCore(MacroAssembler* masm, 5871 void CEntryStub::GenerateCore(MacroAssembler* masm,
5875 Label* throw_normal_exception, 5872 Label* throw_normal_exception,
5876 Label* throw_out_of_memory_exception, 5873 Label* throw_out_of_memory_exception,
5877 StackFrame::Type frame_type, 5874 StackFrame::Type frame_type,
5878 bool do_gc, 5875 bool do_gc,
5879 bool always_allocate_scope) { 5876 bool always_allocate_scope) {
(...skipping 913 matching lines...) Expand 10 before | Expand all | Expand 10 after
6793 break; 6790 break;
6794 default: 6791 default:
6795 UNREACHABLE(); 6792 UNREACHABLE();
6796 } 6793 }
6797 } 6794 }
6798 6795
6799 6796
6800 #undef __ 6797 #undef __
6801 6798
6802 } } // namespace v8::internal 6799 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698