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

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

Issue 1130283002: [strong] Disallow implicit conversions for comparison (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: cl feedback Created 5 years, 7 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
« no previous file with comments | « src/x64/code-stubs-x64.cc ('k') | src/x64/lithium-codegen-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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_X64 7 #if V8_TARGET_ARCH_X64
8 8
9 #include "src/code-factory.h" 9 #include "src/code-factory.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 1000 matching lines...) Expand 10 before | Expand all | Expand 10 after
1011 1011
1012 __ cmpp(rdx, rax); 1012 __ cmpp(rdx, rax);
1013 __ j(not_equal, &next_test); 1013 __ j(not_equal, &next_test);
1014 __ Drop(1); // Switch value is no longer needed. 1014 __ Drop(1); // Switch value is no longer needed.
1015 __ jmp(clause->body_target()); 1015 __ jmp(clause->body_target());
1016 __ bind(&slow_case); 1016 __ bind(&slow_case);
1017 } 1017 }
1018 1018
1019 // Record position before stub call for type feedback. 1019 // Record position before stub call for type feedback.
1020 SetSourcePosition(clause->position()); 1020 SetSourcePosition(clause->position());
1021 Handle<Code> ic = 1021 Handle<Code> ic = CodeFactory::CompareIC(isolate(), Token::EQ_STRICT,
1022 CodeFactory::CompareIC(isolate(), Token::EQ_STRICT).code(); 1022 language_mode()).code();
1023 CallIC(ic, clause->CompareId()); 1023 CallIC(ic, clause->CompareId());
1024 patch_site.EmitPatchInfo(); 1024 patch_site.EmitPatchInfo();
1025 1025
1026 Label skip; 1026 Label skip;
1027 __ jmp(&skip, Label::kNear); 1027 __ jmp(&skip, Label::kNear);
1028 PrepareForBailout(clause, TOS_REG); 1028 PrepareForBailout(clause, TOS_REG);
1029 __ CompareRoot(rax, Heap::kTrueValueRootIndex); 1029 __ CompareRoot(rax, Heap::kTrueValueRootIndex);
1030 __ j(not_equal, &next_test); 1030 __ j(not_equal, &next_test);
1031 __ Drop(1); 1031 __ Drop(1);
1032 __ jmp(clause->body_target()); 1032 __ jmp(clause->body_target());
(...skipping 4138 matching lines...) Expand 10 before | Expand all | Expand 10 after
5171 __ movp(rcx, rdx); 5171 __ movp(rcx, rdx);
5172 __ orp(rcx, rax); 5172 __ orp(rcx, rax);
5173 patch_site.EmitJumpIfNotSmi(rcx, &slow_case, Label::kNear); 5173 patch_site.EmitJumpIfNotSmi(rcx, &slow_case, Label::kNear);
5174 __ cmpp(rdx, rax); 5174 __ cmpp(rdx, rax);
5175 Split(cc, if_true, if_false, NULL); 5175 Split(cc, if_true, if_false, NULL);
5176 __ bind(&slow_case); 5176 __ bind(&slow_case);
5177 } 5177 }
5178 5178
5179 // Record position and call the compare IC. 5179 // Record position and call the compare IC.
5180 SetSourcePosition(expr->position()); 5180 SetSourcePosition(expr->position());
5181 Handle<Code> ic = CodeFactory::CompareIC(isolate(), op).code(); 5181 Handle<Code> ic =
5182 CodeFactory::CompareIC(isolate(), op, language_mode()).code();
5182 CallIC(ic, expr->CompareOperationFeedbackId()); 5183 CallIC(ic, expr->CompareOperationFeedbackId());
5183 patch_site.EmitPatchInfo(); 5184 patch_site.EmitPatchInfo();
5184 5185
5185 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); 5186 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false);
5186 __ testp(rax, rax); 5187 __ testp(rax, rax);
5187 Split(cc, if_true, if_false, fall_through); 5188 Split(cc, if_true, if_false, fall_through);
5188 } 5189 }
5189 } 5190 }
5190 5191
5191 // Convert the result of the comparison into one expected for this 5192 // Convert the result of the comparison into one expected for this
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
5392 DCHECK_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), 5393 DCHECK_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(),
5393 Assembler::target_address_at(call_target_address, 5394 Assembler::target_address_at(call_target_address,
5394 unoptimized_code)); 5395 unoptimized_code));
5395 return OSR_AFTER_STACK_CHECK; 5396 return OSR_AFTER_STACK_CHECK;
5396 } 5397 }
5397 5398
5398 5399
5399 } } // namespace v8::internal 5400 } } // namespace v8::internal
5400 5401
5401 #endif // V8_TARGET_ARCH_X64 5402 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/code-stubs-x64.cc ('k') | src/x64/lithium-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698