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

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

Issue 205343013: Introduce andp, notp, orp and xorp for x64 port (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased with bleeding_edge Created 6 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
« no previous file with comments | « src/x64/codegen-x64.cc ('k') | src/x64/ic-x64.cc » ('j') | 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 995 matching lines...) Expand 10 before | Expand all | Expand 10 after
1006 // Compile the label expression. 1006 // Compile the label expression.
1007 VisitForAccumulatorValue(clause->label()); 1007 VisitForAccumulatorValue(clause->label());
1008 1008
1009 // Perform the comparison as if via '==='. 1009 // Perform the comparison as if via '==='.
1010 __ movp(rdx, Operand(rsp, 0)); // Switch value. 1010 __ movp(rdx, Operand(rsp, 0)); // Switch value.
1011 bool inline_smi_code = ShouldInlineSmiCase(Token::EQ_STRICT); 1011 bool inline_smi_code = ShouldInlineSmiCase(Token::EQ_STRICT);
1012 JumpPatchSite patch_site(masm_); 1012 JumpPatchSite patch_site(masm_);
1013 if (inline_smi_code) { 1013 if (inline_smi_code) {
1014 Label slow_case; 1014 Label slow_case;
1015 __ movp(rcx, rdx); 1015 __ movp(rcx, rdx);
1016 __ or_(rcx, rax); 1016 __ orp(rcx, rax);
1017 patch_site.EmitJumpIfNotSmi(rcx, &slow_case, Label::kNear); 1017 patch_site.EmitJumpIfNotSmi(rcx, &slow_case, Label::kNear);
1018 1018
1019 __ cmpp(rdx, rax); 1019 __ cmpp(rdx, rax);
1020 __ j(not_equal, &next_test); 1020 __ j(not_equal, &next_test);
1021 __ Drop(1); // Switch value is no longer needed. 1021 __ Drop(1); // Switch value is no longer needed.
1022 __ jmp(clause->body_target()); 1022 __ jmp(clause->body_target());
1023 __ bind(&slow_case); 1023 __ bind(&slow_case);
1024 } 1024 }
1025 1025
1026 // Record position before stub call for type feedback. 1026 // Record position before stub call for type feedback.
(...skipping 1277 matching lines...) Expand 10 before | Expand all | Expand 10 after
2304 Token::Value op, 2304 Token::Value op,
2305 OverwriteMode mode, 2305 OverwriteMode mode,
2306 Expression* left, 2306 Expression* left,
2307 Expression* right) { 2307 Expression* right) {
2308 // Do combined smi check of the operands. Left operand is on the 2308 // Do combined smi check of the operands. Left operand is on the
2309 // stack (popped into rdx). Right operand is in rax but moved into 2309 // stack (popped into rdx). Right operand is in rax but moved into
2310 // rcx to make the shifts easier. 2310 // rcx to make the shifts easier.
2311 Label done, stub_call, smi_case; 2311 Label done, stub_call, smi_case;
2312 __ Pop(rdx); 2312 __ Pop(rdx);
2313 __ movp(rcx, rax); 2313 __ movp(rcx, rax);
2314 __ or_(rax, rdx); 2314 __ orp(rax, rdx);
2315 JumpPatchSite patch_site(masm_); 2315 JumpPatchSite patch_site(masm_);
2316 patch_site.EmitJumpIfSmi(rax, &smi_case, Label::kNear); 2316 patch_site.EmitJumpIfSmi(rax, &smi_case, Label::kNear);
2317 2317
2318 __ bind(&stub_call); 2318 __ bind(&stub_call);
2319 __ movp(rax, rcx); 2319 __ movp(rax, rcx);
2320 BinaryOpICStub stub(op, mode); 2320 BinaryOpICStub stub(op, mode);
2321 CallIC(stub.GetCode(isolate()), expr->BinaryOperationFeedbackId()); 2321 CallIC(stub.GetCode(isolate()), expr->BinaryOperationFeedbackId());
2322 patch_site.EmitPatchInfo(); 2322 patch_site.EmitPatchInfo();
2323 __ jmp(&done, Label::kNear); 2323 __ jmp(&done, Label::kNear);
2324 2324
(...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after
3049 __ Cmp(rdx, isolate()->factory()->value_of_string()); 3049 __ Cmp(rdx, isolate()->factory()->value_of_string());
3050 __ j(equal, if_false); 3050 __ j(equal, if_false);
3051 __ addp(r8, Immediate(DescriptorArray::kDescriptorSize * kPointerSize)); 3051 __ addp(r8, Immediate(DescriptorArray::kDescriptorSize * kPointerSize));
3052 __ bind(&entry); 3052 __ bind(&entry);
3053 __ cmpp(r8, rcx); 3053 __ cmpp(r8, rcx);
3054 __ j(not_equal, &loop); 3054 __ j(not_equal, &loop);
3055 3055
3056 __ bind(&done); 3056 __ bind(&done);
3057 3057
3058 // Set the bit in the map to indicate that there is no local valueOf field. 3058 // Set the bit in the map to indicate that there is no local valueOf field.
3059 __ or_(FieldOperand(rbx, Map::kBitField2Offset), 3059 __ orp(FieldOperand(rbx, Map::kBitField2Offset),
3060 Immediate(1 << Map::kStringWrapperSafeForDefaultValueOf)); 3060 Immediate(1 << Map::kStringWrapperSafeForDefaultValueOf));
3061 3061
3062 __ bind(&skip_lookup); 3062 __ bind(&skip_lookup);
3063 3063
3064 // If a valueOf property is not found on the object check that its 3064 // If a valueOf property is not found on the object check that its
3065 // prototype is the un-modified String prototype. If not result is false. 3065 // prototype is the un-modified String prototype. If not result is false.
3066 __ movp(rcx, FieldOperand(rbx, Map::kPrototypeOffset)); 3066 __ movp(rcx, FieldOperand(rbx, Map::kPrototypeOffset));
3067 __ testp(rcx, Immediate(kSmiTagMask)); 3067 __ testp(rcx, Immediate(kSmiTagMask));
3068 __ j(zero, if_false); 3068 __ j(zero, if_false);
3069 __ movp(rcx, FieldOperand(rcx, HeapObject::kMapOffset)); 3069 __ movp(rcx, FieldOperand(rcx, HeapObject::kMapOffset));
(...skipping 1581 matching lines...) Expand 10 before | Expand all | Expand 10 after
4651 default: { 4651 default: {
4652 VisitForAccumulatorValue(expr->right()); 4652 VisitForAccumulatorValue(expr->right());
4653 Condition cc = CompareIC::ComputeCondition(op); 4653 Condition cc = CompareIC::ComputeCondition(op);
4654 __ Pop(rdx); 4654 __ Pop(rdx);
4655 4655
4656 bool inline_smi_code = ShouldInlineSmiCase(op); 4656 bool inline_smi_code = ShouldInlineSmiCase(op);
4657 JumpPatchSite patch_site(masm_); 4657 JumpPatchSite patch_site(masm_);
4658 if (inline_smi_code) { 4658 if (inline_smi_code) {
4659 Label slow_case; 4659 Label slow_case;
4660 __ movp(rcx, rdx); 4660 __ movp(rcx, rdx);
4661 __ or_(rcx, rax); 4661 __ orp(rcx, rax);
4662 patch_site.EmitJumpIfNotSmi(rcx, &slow_case, Label::kNear); 4662 patch_site.EmitJumpIfNotSmi(rcx, &slow_case, Label::kNear);
4663 __ cmpp(rdx, rax); 4663 __ cmpp(rdx, rax);
4664 Split(cc, if_true, if_false, NULL); 4664 Split(cc, if_true, if_false, NULL);
4665 __ bind(&slow_case); 4665 __ bind(&slow_case);
4666 } 4666 }
4667 4667
4668 // Record position and call the compare IC. 4668 // Record position and call the compare IC.
4669 SetSourcePosition(expr->position()); 4669 SetSourcePosition(expr->position());
4670 Handle<Code> ic = CompareIC::GetUninitialized(isolate(), op); 4670 Handle<Code> ic = CompareIC::GetUninitialized(isolate(), op);
4671 CallIC(ic, expr->CompareOperationFeedbackId()); 4671 CallIC(ic, expr->CompareOperationFeedbackId());
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
4932 ASSERT_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), 4932 ASSERT_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(),
4933 Assembler::target_address_at(call_target_address, 4933 Assembler::target_address_at(call_target_address,
4934 unoptimized_code)); 4934 unoptimized_code));
4935 return OSR_AFTER_STACK_CHECK; 4935 return OSR_AFTER_STACK_CHECK;
4936 } 4936 }
4937 4937
4938 4938
4939 } } // namespace v8::internal 4939 } } // namespace v8::internal
4940 4940
4941 #endif // V8_TARGET_ARCH_X64 4941 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/codegen-x64.cc ('k') | src/x64/ic-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698