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

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

Issue 225823003: Implement handlified String::Equals and Name::Equals. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: refactored StringToDouble Created 6 years, 8 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/full-codegen-arm.cc ('k') | src/arm64/full-codegen-arm64.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 5478 matching lines...) Expand 10 before | Expand all | Expand 10 after
5489 } 5489 }
5490 } 5490 }
5491 5491
5492 5492
5493 Condition LCodeGen::EmitTypeofIs(Label* true_label, 5493 Condition LCodeGen::EmitTypeofIs(Label* true_label,
5494 Label* false_label, 5494 Label* false_label,
5495 Register input, 5495 Register input,
5496 Handle<String> type_name) { 5496 Handle<String> type_name) {
5497 Condition final_branch_condition = kNoCondition; 5497 Condition final_branch_condition = kNoCondition;
5498 Register scratch = scratch0(); 5498 Register scratch = scratch0();
5499 if (type_name->Equals(heap()->number_string())) { 5499 Factory* factory = isolate()->factory();
5500 if (String::Equals(type_name, factory->number_string())) {
5500 __ JumpIfSmi(input, true_label); 5501 __ JumpIfSmi(input, true_label);
5501 __ ldr(scratch, FieldMemOperand(input, HeapObject::kMapOffset)); 5502 __ ldr(scratch, FieldMemOperand(input, HeapObject::kMapOffset));
5502 __ CompareRoot(scratch, Heap::kHeapNumberMapRootIndex); 5503 __ CompareRoot(scratch, Heap::kHeapNumberMapRootIndex);
5503 final_branch_condition = eq; 5504 final_branch_condition = eq;
5504 5505
5505 } else if (type_name->Equals(heap()->string_string())) { 5506 } else if (String::Equals(type_name, factory->string_string())) {
5506 __ JumpIfSmi(input, false_label); 5507 __ JumpIfSmi(input, false_label);
5507 __ CompareObjectType(input, scratch, no_reg, FIRST_NONSTRING_TYPE); 5508 __ CompareObjectType(input, scratch, no_reg, FIRST_NONSTRING_TYPE);
5508 __ b(ge, false_label); 5509 __ b(ge, false_label);
5509 __ ldrb(scratch, FieldMemOperand(scratch, Map::kBitFieldOffset)); 5510 __ ldrb(scratch, FieldMemOperand(scratch, Map::kBitFieldOffset));
5510 __ tst(scratch, Operand(1 << Map::kIsUndetectable)); 5511 __ tst(scratch, Operand(1 << Map::kIsUndetectable));
5511 final_branch_condition = eq; 5512 final_branch_condition = eq;
5512 5513
5513 } else if (type_name->Equals(heap()->symbol_string())) { 5514 } else if (String::Equals(type_name, factory->symbol_string())) {
5514 __ JumpIfSmi(input, false_label); 5515 __ JumpIfSmi(input, false_label);
5515 __ CompareObjectType(input, scratch, no_reg, SYMBOL_TYPE); 5516 __ CompareObjectType(input, scratch, no_reg, SYMBOL_TYPE);
5516 final_branch_condition = eq; 5517 final_branch_condition = eq;
5517 5518
5518 } else if (type_name->Equals(heap()->boolean_string())) { 5519 } else if (String::Equals(type_name, factory->boolean_string())) {
5519 __ CompareRoot(input, Heap::kTrueValueRootIndex); 5520 __ CompareRoot(input, Heap::kTrueValueRootIndex);
5520 __ b(eq, true_label); 5521 __ b(eq, true_label);
5521 __ CompareRoot(input, Heap::kFalseValueRootIndex); 5522 __ CompareRoot(input, Heap::kFalseValueRootIndex);
5522 final_branch_condition = eq; 5523 final_branch_condition = eq;
5523 5524
5524 } else if (FLAG_harmony_typeof && type_name->Equals(heap()->null_string())) { 5525 } else if (FLAG_harmony_typeof &&
5526 String::Equals(type_name, factory->null_string())) {
5525 __ CompareRoot(input, Heap::kNullValueRootIndex); 5527 __ CompareRoot(input, Heap::kNullValueRootIndex);
5526 final_branch_condition = eq; 5528 final_branch_condition = eq;
5527 5529
5528 } else if (type_name->Equals(heap()->undefined_string())) { 5530 } else if (String::Equals(type_name, factory->undefined_string())) {
5529 __ CompareRoot(input, Heap::kUndefinedValueRootIndex); 5531 __ CompareRoot(input, Heap::kUndefinedValueRootIndex);
5530 __ b(eq, true_label); 5532 __ b(eq, true_label);
5531 __ JumpIfSmi(input, false_label); 5533 __ JumpIfSmi(input, false_label);
5532 // Check for undetectable objects => true. 5534 // Check for undetectable objects => true.
5533 __ ldr(scratch, FieldMemOperand(input, HeapObject::kMapOffset)); 5535 __ ldr(scratch, FieldMemOperand(input, HeapObject::kMapOffset));
5534 __ ldrb(scratch, FieldMemOperand(scratch, Map::kBitFieldOffset)); 5536 __ ldrb(scratch, FieldMemOperand(scratch, Map::kBitFieldOffset));
5535 __ tst(scratch, Operand(1 << Map::kIsUndetectable)); 5537 __ tst(scratch, Operand(1 << Map::kIsUndetectable));
5536 final_branch_condition = ne; 5538 final_branch_condition = ne;
5537 5539
5538 } else if (type_name->Equals(heap()->function_string())) { 5540 } else if (String::Equals(type_name, factory->function_string())) {
5539 STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2); 5541 STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2);
5540 Register type_reg = scratch; 5542 Register type_reg = scratch;
5541 __ JumpIfSmi(input, false_label); 5543 __ JumpIfSmi(input, false_label);
5542 __ CompareObjectType(input, scratch, type_reg, JS_FUNCTION_TYPE); 5544 __ CompareObjectType(input, scratch, type_reg, JS_FUNCTION_TYPE);
5543 __ b(eq, true_label); 5545 __ b(eq, true_label);
5544 __ cmp(type_reg, Operand(JS_FUNCTION_PROXY_TYPE)); 5546 __ cmp(type_reg, Operand(JS_FUNCTION_PROXY_TYPE));
5545 final_branch_condition = eq; 5547 final_branch_condition = eq;
5546 5548
5547 } else if (type_name->Equals(heap()->object_string())) { 5549 } else if (String::Equals(type_name, factory->object_string())) {
5548 Register map = scratch; 5550 Register map = scratch;
5549 __ JumpIfSmi(input, false_label); 5551 __ JumpIfSmi(input, false_label);
5550 if (!FLAG_harmony_typeof) { 5552 if (!FLAG_harmony_typeof) {
5551 __ CompareRoot(input, Heap::kNullValueRootIndex); 5553 __ CompareRoot(input, Heap::kNullValueRootIndex);
5552 __ b(eq, true_label); 5554 __ b(eq, true_label);
5553 } 5555 }
5554 __ CheckObjectTypeRange(input, 5556 __ CheckObjectTypeRange(input,
5555 map, 5557 map,
5556 FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, 5558 FIRST_NONCALLABLE_SPEC_OBJECT_TYPE,
5557 LAST_NONCALLABLE_SPEC_OBJECT_TYPE, 5559 LAST_NONCALLABLE_SPEC_OBJECT_TYPE,
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
5862 __ ldr(result, FieldMemOperand(scratch, 5864 __ ldr(result, FieldMemOperand(scratch,
5863 FixedArray::kHeaderSize - kPointerSize)); 5865 FixedArray::kHeaderSize - kPointerSize));
5864 __ bind(deferred->exit()); 5866 __ bind(deferred->exit());
5865 __ bind(&done); 5867 __ bind(&done);
5866 } 5868 }
5867 5869
5868 5870
5869 #undef __ 5871 #undef __
5870 5872
5871 } } // namespace v8::internal 5873 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/full-codegen-arm.cc ('k') | src/arm64/full-codegen-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698