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

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

Issue 9415006: Merged r10719 into 3.7 branch. (Closed) Base URL: https://v8.googlecode.com/svn/branches/3.7
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/ia32/assembler-ia32.cc ('k') | src/version.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 1845 matching lines...) Expand 10 before | Expand all | Expand 10 after
1856 STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE); 1856 STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE);
1857 __ CmpObjectType(input, FIRST_SPEC_OBJECT_TYPE, temp); 1857 __ CmpObjectType(input, FIRST_SPEC_OBJECT_TYPE, temp);
1858 __ j(below, is_false); 1858 __ j(below, is_false);
1859 __ j(equal, is_true); 1859 __ j(equal, is_true);
1860 __ CmpInstanceType(temp, LAST_SPEC_OBJECT_TYPE); 1860 __ CmpInstanceType(temp, LAST_SPEC_OBJECT_TYPE);
1861 __ j(equal, is_true); 1861 __ j(equal, is_true);
1862 } else { 1862 } else {
1863 // Faster code path to avoid two compares: subtract lower bound from the 1863 // Faster code path to avoid two compares: subtract lower bound from the
1864 // actual type and do a signed compare with the width of the type range. 1864 // actual type and do a signed compare with the width of the type range.
1865 __ mov(temp, FieldOperand(input, HeapObject::kMapOffset)); 1865 __ mov(temp, FieldOperand(input, HeapObject::kMapOffset));
1866 __ mov(temp2, FieldOperand(temp, Map::kInstanceTypeOffset)); 1866 __ movzx_b(temp2, FieldOperand(temp, Map::kInstanceTypeOffset));
1867 __ sub(Operand(temp2), Immediate(FIRST_NONCALLABLE_SPEC_OBJECT_TYPE)); 1867 __ sub(Operand(temp2), Immediate(FIRST_NONCALLABLE_SPEC_OBJECT_TYPE));
1868 __ cmpb(Operand(temp2), 1868 __ cmp(Operand(temp2), Immediate(LAST_NONCALLABLE_SPEC_OBJECT_TYPE -
1869 static_cast<int8_t>(LAST_NONCALLABLE_SPEC_OBJECT_TYPE - 1869 FIRST_NONCALLABLE_SPEC_OBJECT_TYPE));
1870 FIRST_NONCALLABLE_SPEC_OBJECT_TYPE));
1871 __ j(above, is_false); 1870 __ j(above, is_false);
1872 } 1871 }
1873 1872
1874 // Now we are in the FIRST-LAST_NONCALLABLE_SPEC_OBJECT_TYPE range. 1873 // Now we are in the FIRST-LAST_NONCALLABLE_SPEC_OBJECT_TYPE range.
1875 // Check if the constructor in the map is a function. 1874 // Check if the constructor in the map is a function.
1876 __ mov(temp, FieldOperand(temp, Map::kConstructorOffset)); 1875 __ mov(temp, FieldOperand(temp, Map::kConstructorOffset));
1877 // Objects with a non-function constructor have class 'Object'. 1876 // Objects with a non-function constructor have class 'Object'.
1878 __ CmpObjectType(temp, JS_FUNCTION_TYPE, temp2); 1877 __ CmpObjectType(temp, JS_FUNCTION_TYPE, temp2);
1879 if (class_name->IsEqualTo(CStrVector("Object"))) { 1878 if (class_name->IsEqualTo(CStrVector("Object"))) {
1880 __ j(not_equal, is_true); 1879 __ j(not_equal, is_true);
(...skipping 2117 matching lines...) Expand 10 before | Expand all | Expand 10 after
3998 uint8_t tag; 3997 uint8_t tag;
3999 instr->hydrogen()->GetCheckMaskAndTag(&mask, &tag); 3998 instr->hydrogen()->GetCheckMaskAndTag(&mask, &tag);
4000 3999
4001 if (IsPowerOf2(mask)) { 4000 if (IsPowerOf2(mask)) {
4002 ASSERT(tag == 0 || IsPowerOf2(tag)); 4001 ASSERT(tag == 0 || IsPowerOf2(tag));
4003 __ test_b(FieldOperand(temp, Map::kInstanceTypeOffset), mask); 4002 __ test_b(FieldOperand(temp, Map::kInstanceTypeOffset), mask);
4004 DeoptimizeIf(tag == 0 ? not_zero : zero, instr->environment()); 4003 DeoptimizeIf(tag == 0 ? not_zero : zero, instr->environment());
4005 } else { 4004 } else {
4006 __ movzx_b(temp, FieldOperand(temp, Map::kInstanceTypeOffset)); 4005 __ movzx_b(temp, FieldOperand(temp, Map::kInstanceTypeOffset));
4007 __ and_(temp, mask); 4006 __ and_(temp, mask);
4008 __ cmpb(Operand(temp), tag); 4007 __ cmp(temp, tag);
4009 DeoptimizeIf(not_equal, instr->environment()); 4008 DeoptimizeIf(not_equal, instr->environment());
4010 } 4009 }
4011 } 4010 }
4012 } 4011 }
4013 4012
4014 4013
4015 void LCodeGen::DoCheckFunction(LCheckFunction* instr) { 4014 void LCodeGen::DoCheckFunction(LCheckFunction* instr) {
4016 Handle<JSFunction> target = instr->hydrogen()->target(); 4015 Handle<JSFunction> target = instr->hydrogen()->target();
4017 if (isolate()->heap()->InNewSpace(*target)) { 4016 if (isolate()->heap()->InNewSpace(*target)) {
4018 Register reg = ToRegister(instr->value()); 4017 Register reg = ToRegister(instr->value());
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after
4620 this, pointers, Safepoint::kLazyDeopt); 4619 this, pointers, Safepoint::kLazyDeopt);
4621 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator); 4620 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator);
4622 } 4621 }
4623 4622
4624 4623
4625 #undef __ 4624 #undef __
4626 4625
4627 } } // namespace v8::internal 4626 } } // namespace v8::internal
4628 4627
4629 #endif // V8_TARGET_ARCH_IA32 4628 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/assembler-ia32.cc ('k') | src/version.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698