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

Side by Side Diff: src/ia32/full-codegen-ia32.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/ia32/codegen-ia32.cc ('k') | src/macros.py » ('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 1967 matching lines...) Expand 10 before | Expand all | Expand 10 after
1978 __ cmp(ecx, FIRST_JS_OBJECT_TYPE); 1978 __ cmp(ecx, FIRST_JS_OBJECT_TYPE);
1979 __ j(below, if_false); 1979 __ j(below, if_false);
1980 __ cmp(ecx, LAST_JS_OBJECT_TYPE); 1980 __ cmp(ecx, LAST_JS_OBJECT_TYPE);
1981 __ j(below_equal, if_true); 1981 __ j(below_equal, if_true);
1982 __ jmp(if_false); 1982 __ jmp(if_false);
1983 1983
1984 Apply(context_, if_true, if_false); 1984 Apply(context_, if_true, if_false);
1985 } 1985 }
1986 1986
1987 1987
1988 void FullCodeGenerator::EmitIsSpecObject(ZoneList<Expression*>* args) {
1989 ASSERT(args->length() == 1);
1990
1991 VisitForValue(args->at(0), kAccumulator);
1992
1993 Label materialize_true, materialize_false;
1994 Label* if_true = NULL;
1995 Label* if_false = NULL;
1996 PrepareTest(&materialize_true, &materialize_false, &if_true, &if_false);
1997
1998 __ test(eax, Immediate(kSmiTagMask));
1999 __ j(equal, if_false);
2000 __ CmpObjectType(eax, FIRST_JS_OBJECT_TYPE, ebx);
2001 __ j(above_equal, if_true);
2002 __ jmp(if_false);
2003
2004 Apply(context_, if_true, if_false);
2005 }
2006
2007
1988 void FullCodeGenerator::EmitIsUndetectableObject(ZoneList<Expression*>* args) { 2008 void FullCodeGenerator::EmitIsUndetectableObject(ZoneList<Expression*>* args) {
1989 ASSERT(args->length() == 1); 2009 ASSERT(args->length() == 1);
1990 2010
1991 VisitForValue(args->at(0), kAccumulator); 2011 VisitForValue(args->at(0), kAccumulator);
1992 2012
1993 Label materialize_true, materialize_false; 2013 Label materialize_true, materialize_false;
1994 Label* if_true = NULL; 2014 Label* if_true = NULL;
1995 Label* if_false = NULL; 2015 Label* if_false = NULL;
1996 PrepareTest(&materialize_true, &materialize_false, &if_true, &if_false); 2016 PrepareTest(&materialize_true, &materialize_false, &if_true, &if_false);
1997 2017
(...skipping 1254 matching lines...) Expand 10 before | Expand all | Expand 10 after
3252 // And return. 3272 // And return.
3253 __ ret(0); 3273 __ ret(0);
3254 } 3274 }
3255 3275
3256 3276
3257 #undef __ 3277 #undef __
3258 3278
3259 } } // namespace v8::internal 3279 } } // namespace v8::internal
3260 3280
3261 #endif // V8_TARGET_ARCH_IA32 3281 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/codegen-ia32.cc ('k') | src/macros.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698