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

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

Issue 9418005: Ensure using byte registers for byte instructions on ia32 and x64. (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/assembler-x64.cc ('k') | test/mjsunit/regress/regress-1945.js » ('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 1775 matching lines...) Expand 10 before | Expand all | Expand 10 after
1786 STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE); 1786 STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE);
1787 __ CmpObjectType(input, FIRST_SPEC_OBJECT_TYPE, temp); 1787 __ CmpObjectType(input, FIRST_SPEC_OBJECT_TYPE, temp);
1788 __ j(below, is_false); 1788 __ j(below, is_false);
1789 __ j(equal, is_true); 1789 __ j(equal, is_true);
1790 __ CmpInstanceType(temp, LAST_SPEC_OBJECT_TYPE); 1790 __ CmpInstanceType(temp, LAST_SPEC_OBJECT_TYPE);
1791 __ j(equal, is_true); 1791 __ j(equal, is_true);
1792 } else { 1792 } else {
1793 // Faster code path to avoid two compares: subtract lower bound from the 1793 // Faster code path to avoid two compares: subtract lower bound from the
1794 // actual type and do a signed compare with the width of the type range. 1794 // actual type and do a signed compare with the width of the type range.
1795 __ movq(temp, FieldOperand(input, HeapObject::kMapOffset)); 1795 __ movq(temp, FieldOperand(input, HeapObject::kMapOffset));
1796 __ movq(temp2, FieldOperand(temp, Map::kInstanceTypeOffset)); 1796 __ movzxbl(temp2, FieldOperand(temp, Map::kInstanceTypeOffset));
1797 __ subb(temp2, Immediate(FIRST_NONCALLABLE_SPEC_OBJECT_TYPE)); 1797 __ subq(temp2, Immediate(FIRST_NONCALLABLE_SPEC_OBJECT_TYPE));
1798 __ cmpb(temp2, 1798 __ cmpq(temp2, Immediate(LAST_NONCALLABLE_SPEC_OBJECT_TYPE -
1799 Immediate(static_cast<int8_t>(LAST_NONCALLABLE_SPEC_OBJECT_TYPE - 1799 FIRST_NONCALLABLE_SPEC_OBJECT_TYPE));
1800 FIRST_NONCALLABLE_SPEC_OBJECT_TYPE)));
1801 __ j(above, is_false); 1800 __ j(above, is_false);
1802 } 1801 }
1803 1802
1804 // Now we are in the FIRST-LAST_NONCALLABLE_SPEC_OBJECT_TYPE range. 1803 // Now we are in the FIRST-LAST_NONCALLABLE_SPEC_OBJECT_TYPE range.
1805 // Check if the constructor in the map is a function. 1804 // Check if the constructor in the map is a function.
1806 __ movq(temp, FieldOperand(temp, Map::kConstructorOffset)); 1805 __ movq(temp, FieldOperand(temp, Map::kConstructorOffset));
1807 1806
1808 // Objects with a non-function constructor have class 'Object'. 1807 // Objects with a non-function constructor have class 'Object'.
1809 __ CmpObjectType(temp, JS_FUNCTION_TYPE, kScratchRegister); 1808 __ CmpObjectType(temp, JS_FUNCTION_TYPE, kScratchRegister);
1810 if (class_name->IsEqualTo(CStrVector("Object"))) { 1809 if (class_name->IsEqualTo(CStrVector("Object"))) {
(...skipping 2601 matching lines...) Expand 10 before | Expand all | Expand 10 after
4412 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); 4411 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt);
4413 ASSERT(osr_pc_offset_ == -1); 4412 ASSERT(osr_pc_offset_ == -1);
4414 osr_pc_offset_ = masm()->pc_offset(); 4413 osr_pc_offset_ = masm()->pc_offset();
4415 } 4414 }
4416 4415
4417 #undef __ 4416 #undef __
4418 4417
4419 } } // namespace v8::internal 4418 } } // namespace v8::internal
4420 4419
4421 #endif // V8_TARGET_ARCH_X64 4420 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/assembler-x64.cc ('k') | test/mjsunit/regress/regress-1945.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698