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

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

Issue 10543094: Eliminate redundant smi checks (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Final review feedback Created 8 years, 6 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/ia32/macro-assembler-ia32.cc ('k') | src/x64/lithium-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 2371 matching lines...) Expand 10 before | Expand all | Expand 10 after
2382 // Load the result. 2382 // Load the result.
2383 __ movq(result, 2383 __ movq(result,
2384 BuildFastArrayOperand(instr->elements(), 2384 BuildFastArrayOperand(instr->elements(),
2385 instr->key(), 2385 instr->key(),
2386 FAST_ELEMENTS, 2386 FAST_ELEMENTS,
2387 FixedArray::kHeaderSize - kHeapObjectTag, 2387 FixedArray::kHeaderSize - kHeapObjectTag,
2388 instr->additional_index())); 2388 instr->additional_index()));
2389 2389
2390 // Check for the hole value. 2390 // Check for the hole value.
2391 if (instr->hydrogen()->RequiresHoleCheck()) { 2391 if (instr->hydrogen()->RequiresHoleCheck()) {
2392 __ CompareRoot(result, Heap::kTheHoleValueRootIndex); 2392 if (IsFastSmiElementsKind(instr->hydrogen()->elements_kind())) {
2393 DeoptimizeIf(equal, instr->environment()); 2393 Condition smi = __ CheckSmi(result);
2394 DeoptimizeIf(NegateCondition(smi), instr->environment());
2395 } else {
2396 __ CompareRoot(result, Heap::kTheHoleValueRootIndex);
2397 DeoptimizeIf(equal, instr->environment());
2398 }
2394 } 2399 }
2395 } 2400 }
2396 2401
2397 2402
2398 void LCodeGen::DoLoadKeyedFastDoubleElement( 2403 void LCodeGen::DoLoadKeyedFastDoubleElement(
2399 LLoadKeyedFastDoubleElement* instr) { 2404 LLoadKeyedFastDoubleElement* instr) {
2400 XMMRegister result(ToDoubleRegister(instr->result())); 2405 XMMRegister result(ToDoubleRegister(instr->result()));
2401 2406
2402 if (instr->hydrogen()->IsDehoisted() && !instr->key()->IsConstantOperand()) { 2407 if (instr->hydrogen()->IsDehoisted() && !instr->key()->IsConstantOperand()) {
2403 // Sign extend key because it could be a 32 bit negative value 2408 // Sign extend key because it could be a 32 bit negative value
(...skipping 1379 matching lines...) Expand 10 before | Expand all | Expand 10 after
3783 __ Integer32ToSmi(input, input); 3788 __ Integer32ToSmi(input, input);
3784 } 3789 }
3785 3790
3786 3791
3787 void LCodeGen::DoSmiUntag(LSmiUntag* instr) { 3792 void LCodeGen::DoSmiUntag(LSmiUntag* instr) {
3788 ASSERT(instr->InputAt(0)->Equals(instr->result())); 3793 ASSERT(instr->InputAt(0)->Equals(instr->result()));
3789 Register input = ToRegister(instr->InputAt(0)); 3794 Register input = ToRegister(instr->InputAt(0));
3790 if (instr->needs_check()) { 3795 if (instr->needs_check()) {
3791 Condition is_smi = __ CheckSmi(input); 3796 Condition is_smi = __ CheckSmi(input);
3792 DeoptimizeIf(NegateCondition(is_smi), instr->environment()); 3797 DeoptimizeIf(NegateCondition(is_smi), instr->environment());
3798 } else {
3799 if (FLAG_debug_code) {
3800 __ AbortIfNotSmi(input);
3801 }
3793 } 3802 }
3794 __ SmiToInteger32(input, input); 3803 __ SmiToInteger32(input, input);
3795 } 3804 }
3796 3805
3797 3806
3798 void LCodeGen::EmitNumberUntagD(Register input_reg, 3807 void LCodeGen::EmitNumberUntagD(Register input_reg,
3799 XMMRegister result_reg, 3808 XMMRegister result_reg,
3800 bool deoptimize_on_undefined, 3809 bool deoptimize_on_undefined,
3801 bool deoptimize_on_minus_zero, 3810 bool deoptimize_on_minus_zero,
3802 LEnvironment* env) { 3811 LEnvironment* env) {
(...skipping 1093 matching lines...) Expand 10 before | Expand all | Expand 10 after
4896 FixedArray::kHeaderSize - kPointerSize)); 4905 FixedArray::kHeaderSize - kPointerSize));
4897 __ bind(&done); 4906 __ bind(&done);
4898 } 4907 }
4899 4908
4900 4909
4901 #undef __ 4910 #undef __
4902 4911
4903 } } // namespace v8::internal 4912 } } // namespace v8::internal
4904 4913
4905 #endif // V8_TARGET_ARCH_X64 4914 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/ia32/macro-assembler-ia32.cc ('k') | src/x64/lithium-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698