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

Side by Side Diff: src/arm/full-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/api.cc ('k') | src/arm/lithium-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 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 4507 matching lines...) Expand 10 before | Expand all | Expand 10 after
4518 Label* if_false = NULL; 4518 Label* if_false = NULL;
4519 Label* fall_through = NULL; 4519 Label* fall_through = NULL;
4520 context()->PrepareTest(&materialize_true, &materialize_false, 4520 context()->PrepareTest(&materialize_true, &materialize_false,
4521 &if_true, &if_false, &fall_through); 4521 &if_true, &if_false, &fall_through);
4522 4522
4523 { AccumulatorValueContext context(this); 4523 { AccumulatorValueContext context(this);
4524 VisitForTypeofValue(sub_expr); 4524 VisitForTypeofValue(sub_expr);
4525 } 4525 }
4526 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); 4526 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false);
4527 4527
4528 if (check->Equals(isolate()->heap()->number_string())) { 4528 Factory* factory = isolate()->factory();
4529 if (String::Equals(check, factory->number_string())) {
4529 __ JumpIfSmi(r0, if_true); 4530 __ JumpIfSmi(r0, if_true);
4530 __ ldr(r0, FieldMemOperand(r0, HeapObject::kMapOffset)); 4531 __ ldr(r0, FieldMemOperand(r0, HeapObject::kMapOffset));
4531 __ LoadRoot(ip, Heap::kHeapNumberMapRootIndex); 4532 __ LoadRoot(ip, Heap::kHeapNumberMapRootIndex);
4532 __ cmp(r0, ip); 4533 __ cmp(r0, ip);
4533 Split(eq, if_true, if_false, fall_through); 4534 Split(eq, if_true, if_false, fall_through);
4534 } else if (check->Equals(isolate()->heap()->string_string())) { 4535 } else if (String::Equals(check, factory->string_string())) {
4535 __ JumpIfSmi(r0, if_false); 4536 __ JumpIfSmi(r0, if_false);
4536 // Check for undetectable objects => false. 4537 // Check for undetectable objects => false.
4537 __ CompareObjectType(r0, r0, r1, FIRST_NONSTRING_TYPE); 4538 __ CompareObjectType(r0, r0, r1, FIRST_NONSTRING_TYPE);
4538 __ b(ge, if_false); 4539 __ b(ge, if_false);
4539 __ ldrb(r1, FieldMemOperand(r0, Map::kBitFieldOffset)); 4540 __ ldrb(r1, FieldMemOperand(r0, Map::kBitFieldOffset));
4540 __ tst(r1, Operand(1 << Map::kIsUndetectable)); 4541 __ tst(r1, Operand(1 << Map::kIsUndetectable));
4541 Split(eq, if_true, if_false, fall_through); 4542 Split(eq, if_true, if_false, fall_through);
4542 } else if (check->Equals(isolate()->heap()->symbol_string())) { 4543 } else if (String::Equals(check, factory->symbol_string())) {
4543 __ JumpIfSmi(r0, if_false); 4544 __ JumpIfSmi(r0, if_false);
4544 __ CompareObjectType(r0, r0, r1, SYMBOL_TYPE); 4545 __ CompareObjectType(r0, r0, r1, SYMBOL_TYPE);
4545 Split(eq, if_true, if_false, fall_through); 4546 Split(eq, if_true, if_false, fall_through);
4546 } else if (check->Equals(isolate()->heap()->boolean_string())) { 4547 } else if (String::Equals(check, factory->boolean_string())) {
4547 __ CompareRoot(r0, Heap::kTrueValueRootIndex); 4548 __ CompareRoot(r0, Heap::kTrueValueRootIndex);
4548 __ b(eq, if_true); 4549 __ b(eq, if_true);
4549 __ CompareRoot(r0, Heap::kFalseValueRootIndex); 4550 __ CompareRoot(r0, Heap::kFalseValueRootIndex);
4550 Split(eq, if_true, if_false, fall_through); 4551 Split(eq, if_true, if_false, fall_through);
4551 } else if (FLAG_harmony_typeof && 4552 } else if (FLAG_harmony_typeof &&
4552 check->Equals(isolate()->heap()->null_string())) { 4553 String::Equals(check, factory->null_string())) {
4553 __ CompareRoot(r0, Heap::kNullValueRootIndex); 4554 __ CompareRoot(r0, Heap::kNullValueRootIndex);
4554 Split(eq, if_true, if_false, fall_through); 4555 Split(eq, if_true, if_false, fall_through);
4555 } else if (check->Equals(isolate()->heap()->undefined_string())) { 4556 } else if (String::Equals(check, factory->undefined_string())) {
4556 __ CompareRoot(r0, Heap::kUndefinedValueRootIndex); 4557 __ CompareRoot(r0, Heap::kUndefinedValueRootIndex);
4557 __ b(eq, if_true); 4558 __ b(eq, if_true);
4558 __ JumpIfSmi(r0, if_false); 4559 __ JumpIfSmi(r0, if_false);
4559 // Check for undetectable objects => true. 4560 // Check for undetectable objects => true.
4560 __ ldr(r0, FieldMemOperand(r0, HeapObject::kMapOffset)); 4561 __ ldr(r0, FieldMemOperand(r0, HeapObject::kMapOffset));
4561 __ ldrb(r1, FieldMemOperand(r0, Map::kBitFieldOffset)); 4562 __ ldrb(r1, FieldMemOperand(r0, Map::kBitFieldOffset));
4562 __ tst(r1, Operand(1 << Map::kIsUndetectable)); 4563 __ tst(r1, Operand(1 << Map::kIsUndetectable));
4563 Split(ne, if_true, if_false, fall_through); 4564 Split(ne, if_true, if_false, fall_through);
4564 4565
4565 } else if (check->Equals(isolate()->heap()->function_string())) { 4566 } else if (String::Equals(check, factory->function_string())) {
4566 __ JumpIfSmi(r0, if_false); 4567 __ JumpIfSmi(r0, if_false);
4567 STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2); 4568 STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2);
4568 __ CompareObjectType(r0, r0, r1, JS_FUNCTION_TYPE); 4569 __ CompareObjectType(r0, r0, r1, JS_FUNCTION_TYPE);
4569 __ b(eq, if_true); 4570 __ b(eq, if_true);
4570 __ cmp(r1, Operand(JS_FUNCTION_PROXY_TYPE)); 4571 __ cmp(r1, Operand(JS_FUNCTION_PROXY_TYPE));
4571 Split(eq, if_true, if_false, fall_through); 4572 Split(eq, if_true, if_false, fall_through);
4572 } else if (check->Equals(isolate()->heap()->object_string())) { 4573 } else if (String::Equals(check, factory->object_string())) {
4573 __ JumpIfSmi(r0, if_false); 4574 __ JumpIfSmi(r0, if_false);
4574 if (!FLAG_harmony_typeof) { 4575 if (!FLAG_harmony_typeof) {
4575 __ CompareRoot(r0, Heap::kNullValueRootIndex); 4576 __ CompareRoot(r0, Heap::kNullValueRootIndex);
4576 __ b(eq, if_true); 4577 __ b(eq, if_true);
4577 } 4578 }
4578 // Check for JS objects => true. 4579 // Check for JS objects => true.
4579 __ CompareObjectType(r0, r0, r1, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE); 4580 __ CompareObjectType(r0, r0, r1, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE);
4580 __ b(lt, if_false); 4581 __ b(lt, if_false);
4581 __ CompareInstanceType(r0, r1, LAST_NONCALLABLE_SPEC_OBJECT_TYPE); 4582 __ CompareInstanceType(r0, r1, LAST_NONCALLABLE_SPEC_OBJECT_TYPE);
4582 __ b(gt, if_false); 4583 __ b(gt, if_false);
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
4929 4930
4930 ASSERT(interrupt_address == 4931 ASSERT(interrupt_address ==
4931 isolate->builtins()->OsrAfterStackCheck()->entry()); 4932 isolate->builtins()->OsrAfterStackCheck()->entry());
4932 return OSR_AFTER_STACK_CHECK; 4933 return OSR_AFTER_STACK_CHECK;
4933 } 4934 }
4934 4935
4935 4936
4936 } } // namespace v8::internal 4937 } } // namespace v8::internal
4937 4938
4938 #endif // V8_TARGET_ARCH_ARM 4939 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/api.cc ('k') | src/arm/lithium-codegen-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698