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

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

Issue 9417009: Merged r10719 into 3.8 branch. (Closed) Base URL: https://v8.googlecode.com/svn/branches/3.8
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 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 1851 matching lines...) Expand 10 before | Expand all | Expand 10 after
1862 STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE); 1862 STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE);
1863 __ CmpObjectType(input, FIRST_SPEC_OBJECT_TYPE, temp); 1863 __ CmpObjectType(input, FIRST_SPEC_OBJECT_TYPE, temp);
1864 __ j(below, is_false); 1864 __ j(below, is_false);
1865 __ j(equal, is_true); 1865 __ j(equal, is_true);
1866 __ CmpInstanceType(temp, LAST_SPEC_OBJECT_TYPE); 1866 __ CmpInstanceType(temp, LAST_SPEC_OBJECT_TYPE);
1867 __ j(equal, is_true); 1867 __ j(equal, is_true);
1868 } else { 1868 } else {
1869 // Faster code path to avoid two compares: subtract lower bound from the 1869 // Faster code path to avoid two compares: subtract lower bound from the
1870 // actual type and do a signed compare with the width of the type range. 1870 // actual type and do a signed compare with the width of the type range.
1871 __ mov(temp, FieldOperand(input, HeapObject::kMapOffset)); 1871 __ mov(temp, FieldOperand(input, HeapObject::kMapOffset));
1872 __ mov(temp2, FieldOperand(temp, Map::kInstanceTypeOffset)); 1872 __ movzx_b(temp2, FieldOperand(temp, Map::kInstanceTypeOffset));
1873 __ sub(Operand(temp2), Immediate(FIRST_NONCALLABLE_SPEC_OBJECT_TYPE)); 1873 __ sub(Operand(temp2), Immediate(FIRST_NONCALLABLE_SPEC_OBJECT_TYPE));
1874 __ cmpb(Operand(temp2), 1874 __ cmp(Operand(temp2), Immediate(LAST_NONCALLABLE_SPEC_OBJECT_TYPE -
1875 static_cast<int8_t>(LAST_NONCALLABLE_SPEC_OBJECT_TYPE - 1875 FIRST_NONCALLABLE_SPEC_OBJECT_TYPE));
1876 FIRST_NONCALLABLE_SPEC_OBJECT_TYPE));
1877 __ j(above, is_false); 1876 __ j(above, is_false);
1878 } 1877 }
1879 1878
1880 // Now we are in the FIRST-LAST_NONCALLABLE_SPEC_OBJECT_TYPE range. 1879 // Now we are in the FIRST-LAST_NONCALLABLE_SPEC_OBJECT_TYPE range.
1881 // Check if the constructor in the map is a function. 1880 // Check if the constructor in the map is a function.
1882 __ mov(temp, FieldOperand(temp, Map::kConstructorOffset)); 1881 __ mov(temp, FieldOperand(temp, Map::kConstructorOffset));
1883 // Objects with a non-function constructor have class 'Object'. 1882 // Objects with a non-function constructor have class 'Object'.
1884 __ CmpObjectType(temp, JS_FUNCTION_TYPE, temp2); 1883 __ CmpObjectType(temp, JS_FUNCTION_TYPE, temp2);
1885 if (class_name->IsEqualTo(CStrVector("Object"))) { 1884 if (class_name->IsEqualTo(CStrVector("Object"))) {
1886 __ j(not_equal, is_true); 1885 __ j(not_equal, is_true);
(...skipping 2177 matching lines...) Expand 10 before | Expand all | Expand 10 after
4064 uint8_t tag; 4063 uint8_t tag;
4065 instr->hydrogen()->GetCheckMaskAndTag(&mask, &tag); 4064 instr->hydrogen()->GetCheckMaskAndTag(&mask, &tag);
4066 4065
4067 if (IsPowerOf2(mask)) { 4066 if (IsPowerOf2(mask)) {
4068 ASSERT(tag == 0 || IsPowerOf2(tag)); 4067 ASSERT(tag == 0 || IsPowerOf2(tag));
4069 __ test_b(FieldOperand(temp, Map::kInstanceTypeOffset), mask); 4068 __ test_b(FieldOperand(temp, Map::kInstanceTypeOffset), mask);
4070 DeoptimizeIf(tag == 0 ? not_zero : zero, instr->environment()); 4069 DeoptimizeIf(tag == 0 ? not_zero : zero, instr->environment());
4071 } else { 4070 } else {
4072 __ movzx_b(temp, FieldOperand(temp, Map::kInstanceTypeOffset)); 4071 __ movzx_b(temp, FieldOperand(temp, Map::kInstanceTypeOffset));
4073 __ and_(temp, mask); 4072 __ and_(temp, mask);
4074 __ cmpb(Operand(temp), tag); 4073 __ cmp(temp, tag);
4075 DeoptimizeIf(not_equal, instr->environment()); 4074 DeoptimizeIf(not_equal, instr->environment());
4076 } 4075 }
4077 } 4076 }
4078 } 4077 }
4079 4078
4080 4079
4081 void LCodeGen::DoCheckFunction(LCheckFunction* instr) { 4080 void LCodeGen::DoCheckFunction(LCheckFunction* instr) {
4082 Handle<JSFunction> target = instr->hydrogen()->target(); 4081 Handle<JSFunction> target = instr->hydrogen()->target();
4083 if (isolate()->heap()->InNewSpace(*target)) { 4082 if (isolate()->heap()->InNewSpace(*target)) {
4084 Register reg = ToRegister(instr->value()); 4083 Register reg = ToRegister(instr->value());
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after
4681 this, pointers, Safepoint::kLazyDeopt); 4680 this, pointers, Safepoint::kLazyDeopt);
4682 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator); 4681 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator);
4683 } 4682 }
4684 4683
4685 4684
4686 #undef __ 4685 #undef __
4687 4686
4688 } } // namespace v8::internal 4687 } } // namespace v8::internal
4689 4688
4690 #endif // V8_TARGET_ARCH_IA32 4689 #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