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

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

Issue 2877018: Refactor type checks in v8natives.js and runtime.js.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 5 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 4742 matching lines...) Expand 10 before | Expand all | Expand 10 after
4753 false_target()->Branch(ne); 4753 false_target()->Branch(ne);
4754 4754
4755 __ ldrb(possible_object, FieldMemOperand(map_reg, Map::kInstanceTypeOffset)); 4755 __ ldrb(possible_object, FieldMemOperand(map_reg, Map::kInstanceTypeOffset));
4756 __ cmp(possible_object, Operand(FIRST_JS_OBJECT_TYPE)); 4756 __ cmp(possible_object, Operand(FIRST_JS_OBJECT_TYPE));
4757 false_target()->Branch(lt); 4757 false_target()->Branch(lt);
4758 __ cmp(possible_object, Operand(LAST_JS_OBJECT_TYPE)); 4758 __ cmp(possible_object, Operand(LAST_JS_OBJECT_TYPE));
4759 cc_reg_ = le; 4759 cc_reg_ = le;
4760 } 4760 }
4761 4761
4762 4762
4763 void CodeGenerator::GenerateIsSpecObject(ZoneList<Expression*>* args) {
4764 // This generates a fast version of:
4765 // (typeof(arg) === 'object' || %_ClassOf(arg) == 'RegExp' ||
4766 // typeof(arg) == function).
4767 // It includes undetectable objects (as opposed to IsObject).
4768 ASSERT(args->length() == 1);
4769 Load(args->at(0));
4770 Register value = frame_->PopToRegister();
4771 __ tst(value, Operand(kSmiTagMask));
4772 false_target()->Branch(eq);
4773 // Check that this is an object.
4774 __ ldr(value, FieldMemOperand(value, HeapObject::kMapOffset));
4775 __ ldrb(value, FieldMemOperand(value, Map::kInstanceTypeOffset));
4776 __ cmp(value, Operand(FIRST_JS_OBJECT_TYPE));
4777 cc_reg_ = ge;
4778 }
4779
4780
4763 void CodeGenerator::GenerateIsFunction(ZoneList<Expression*>* args) { 4781 void CodeGenerator::GenerateIsFunction(ZoneList<Expression*>* args) {
4764 // This generates a fast version of: 4782 // This generates a fast version of:
4765 // (%_ClassOf(arg) === 'Function') 4783 // (%_ClassOf(arg) === 'Function')
4766 ASSERT(args->length() == 1); 4784 ASSERT(args->length() == 1);
4767 Load(args->at(0)); 4785 Load(args->at(0));
4768 Register possible_function = frame_->PopToRegister(); 4786 Register possible_function = frame_->PopToRegister();
4769 __ tst(possible_function, Operand(kSmiTagMask)); 4787 __ tst(possible_function, Operand(kSmiTagMask));
4770 false_target()->Branch(eq); 4788 false_target()->Branch(eq);
4771 Register map_reg = VirtualFrame::scratch0(); 4789 Register map_reg = VirtualFrame::scratch0();
4772 Register scratch = VirtualFrame::scratch1(); 4790 Register scratch = VirtualFrame::scratch1();
(...skipping 6465 matching lines...) Expand 10 before | Expand all | Expand 10 after
11238 __ bind(&string_add_runtime); 11256 __ bind(&string_add_runtime);
11239 __ TailCallRuntime(Runtime::kStringAdd, 2, 1); 11257 __ TailCallRuntime(Runtime::kStringAdd, 2, 1);
11240 } 11258 }
11241 11259
11242 11260
11243 #undef __ 11261 #undef __
11244 11262
11245 } } // namespace v8::internal 11263 } } // namespace v8::internal
11246 11264
11247 #endif // V8_TARGET_ARCH_ARM 11265 #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