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

Unified Diff: src/ic-ia32.cc

Issue 39336: Refactored the code for comparing the type of an object with a constant.... Base URL: http://v8.googlecode.com/svn/branches/experimental/global/
Patch Set: Created 11 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: src/ic-ia32.cc
===================================================================
--- src/ic-ia32.cc (revision 1445)
+++ src/ic-ia32.cc (working copy)
@@ -70,8 +70,7 @@
__ j(not_zero, miss_label, not_taken);
// Bail out if we have a JS global object.
- __ movzx_b(r0, FieldOperand(r0, Map::kInstanceTypeOffset));
- __ cmp(r0, JS_GLOBAL_OBJECT_TYPE);
+ __ CmpInstanceType(r0, JS_GLOBAL_OBJECT_TYPE);
__ j(equal, miss_label, not_taken);
// Check that the properties array is a dictionary.
@@ -136,9 +135,7 @@
__ test(value, Immediate(kSmiTagMask));
__ j(zero, &done, not_taken);
// Check if the value is a function.
- __ mov(scratch, FieldOperand(value, HeapObject::kMapOffset));
- __ movzx_b(scratch, FieldOperand(scratch, Map::kInstanceTypeOffset));
- __ cmp(scratch, JS_FUNCTION_TYPE);
+ __ CmpObjectType(value, JS_FUNCTION_TYPE, scratch);
__ j(not_equal, &done, taken);
// Check if the function has been loaded.
__ mov(scratch, FieldOperand(value, JSFunction::kSharedFunctionInfoOffset));
@@ -447,9 +444,7 @@
// Check for number.
__ test(edx, Immediate(kSmiTagMask));
__ j(zero, &number, not_taken);
- __ mov(ebx, FieldOperand(edx, HeapObject::kMapOffset));
- __ movzx_b(ebx, FieldOperand(ebx, Map::kInstanceTypeOffset));
- __ cmp(ebx, HEAP_NUMBER_TYPE);
+ __ CmpObjectType(edx, HEAP_NUMBER_TYPE, ebx);
__ j(not_equal, &non_number, taken);
__ bind(&number);
StubCompiler::GenerateLoadGlobalFunctionPrototype(
@@ -497,9 +492,7 @@
__ j(zero, miss, not_taken);
// Check that the value is a JavaScript function.
- __ mov(edx, FieldOperand(edx, HeapObject::kMapOffset));
- __ movzx_b(edx, FieldOperand(edx, Map::kInstanceTypeOffset));
- __ cmp(edx, JS_FUNCTION_TYPE);
+ __ CmpObjectType(edx, JS_FUNCTION_TYPE, edx);
__ j(not_equal, miss, not_taken);
// Check that the function has been loaded.
« src/builtins-ia32.cc ('K') | « src/codegen-ia32.cc ('k') | src/macro-assembler-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698