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

Side by Side Diff: src/arm/codegen-arm.cc

Issue 3151002: Refactor and correct IS_SPEC_OBJECT macro (bringing bleeding edge r5087 to 2.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/2.2/
Patch Set: Created 10 years, 4 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/arm/codegen-arm.h ('k') | src/arm/full-codegen-arm.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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 4743 matching lines...) Expand 10 before | Expand all | Expand 10 after
4754 false_target()->Branch(ne); 4754 false_target()->Branch(ne);
4755 4755
4756 __ ldrb(possible_object, FieldMemOperand(map_reg, Map::kInstanceTypeOffset)); 4756 __ ldrb(possible_object, FieldMemOperand(map_reg, Map::kInstanceTypeOffset));
4757 __ cmp(possible_object, Operand(FIRST_JS_OBJECT_TYPE)); 4757 __ cmp(possible_object, Operand(FIRST_JS_OBJECT_TYPE));
4758 false_target()->Branch(lt); 4758 false_target()->Branch(lt);
4759 __ cmp(possible_object, Operand(LAST_JS_OBJECT_TYPE)); 4759 __ cmp(possible_object, Operand(LAST_JS_OBJECT_TYPE));
4760 cc_reg_ = le; 4760 cc_reg_ = le;
4761 } 4761 }
4762 4762
4763 4763
4764 void CodeGenerator::GenerateIsSpecObject(ZoneList<Expression*>* args) {
4765 // This generates a fast version of:
4766 // (typeof(arg) === 'object' || %_ClassOf(arg) == 'RegExp' ||
4767 // typeof(arg) == function).
4768 // It includes undetectable objects (as opposed to IsObject).
4769 ASSERT(args->length() == 1);
4770 Load(args->at(0));
4771 Register value = frame_->PopToRegister();
4772 __ tst(value, Operand(kSmiTagMask));
4773 false_target()->Branch(eq);
4774 // Check that this is an object.
4775 __ ldr(value, FieldMemOperand(value, HeapObject::kMapOffset));
4776 __ ldrb(value, FieldMemOperand(value, Map::kInstanceTypeOffset));
4777 __ cmp(value, Operand(FIRST_JS_OBJECT_TYPE));
4778 cc_reg_ = ge;
4779 }
4780
4781
4764 void CodeGenerator::GenerateIsFunction(ZoneList<Expression*>* args) { 4782 void CodeGenerator::GenerateIsFunction(ZoneList<Expression*>* args) {
4765 // This generates a fast version of: 4783 // This generates a fast version of:
4766 // (%_ClassOf(arg) === 'Function') 4784 // (%_ClassOf(arg) === 'Function')
4767 ASSERT(args->length() == 1); 4785 ASSERT(args->length() == 1);
4768 Load(args->at(0)); 4786 Load(args->at(0));
4769 Register possible_function = frame_->PopToRegister(); 4787 Register possible_function = frame_->PopToRegister();
4770 __ tst(possible_function, Operand(kSmiTagMask)); 4788 __ tst(possible_function, Operand(kSmiTagMask));
4771 false_target()->Branch(eq); 4789 false_target()->Branch(eq);
4772 Register map_reg = VirtualFrame::scratch0(); 4790 Register map_reg = VirtualFrame::scratch0();
4773 Register scratch = VirtualFrame::scratch1(); 4791 Register scratch = VirtualFrame::scratch1();
(...skipping 6465 matching lines...) Expand 10 before | Expand all | Expand 10 after
11239 __ bind(&string_add_runtime); 11257 __ bind(&string_add_runtime);
11240 __ TailCallRuntime(Runtime::kStringAdd, 2, 1); 11258 __ TailCallRuntime(Runtime::kStringAdd, 2, 1);
11241 } 11259 }
11242 11260
11243 11261
11244 #undef __ 11262 #undef __
11245 11263
11246 } } // namespace v8::internal 11264 } } // namespace v8::internal
11247 11265
11248 #endif // V8_TARGET_ARCH_ARM 11266 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/codegen-arm.h ('k') | src/arm/full-codegen-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698