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

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

Issue 7598030: Implement Harmony semantics for typeof null (behind a flag). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 4 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
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 4377 matching lines...) Expand 10 before | Expand all | Expand 10 after
4388 __ ldrb(ip, FieldMemOperand(input, Map::kBitFieldOffset)); 4388 __ ldrb(ip, FieldMemOperand(input, Map::kBitFieldOffset));
4389 __ tst(ip, Operand(1 << Map::kIsUndetectable)); 4389 __ tst(ip, Operand(1 << Map::kIsUndetectable));
4390 final_branch_condition = eq; 4390 final_branch_condition = eq;
4391 4391
4392 } else if (type_name->Equals(heap()->boolean_symbol())) { 4392 } else if (type_name->Equals(heap()->boolean_symbol())) {
4393 __ CompareRoot(input, Heap::kTrueValueRootIndex); 4393 __ CompareRoot(input, Heap::kTrueValueRootIndex);
4394 __ b(eq, true_label); 4394 __ b(eq, true_label);
4395 __ CompareRoot(input, Heap::kFalseValueRootIndex); 4395 __ CompareRoot(input, Heap::kFalseValueRootIndex);
4396 final_branch_condition = eq; 4396 final_branch_condition = eq;
4397 4397
4398 } else if (FLAG_harmony_typeof && type_name->Equals(heap()->null_symbol())) {
4399 __ CompareRoot(input, Heap::kNullValueRootIndex);
4400 final_branch_condition = eq;
4401
4398 } else if (type_name->Equals(heap()->undefined_symbol())) { 4402 } else if (type_name->Equals(heap()->undefined_symbol())) {
4399 __ CompareRoot(input, Heap::kUndefinedValueRootIndex); 4403 __ CompareRoot(input, Heap::kUndefinedValueRootIndex);
4400 __ b(eq, true_label); 4404 __ b(eq, true_label);
4401 __ JumpIfSmi(input, false_label); 4405 __ JumpIfSmi(input, false_label);
4402 // Check for undetectable objects => true. 4406 // Check for undetectable objects => true.
4403 __ ldr(input, FieldMemOperand(input, HeapObject::kMapOffset)); 4407 __ ldr(input, FieldMemOperand(input, HeapObject::kMapOffset));
4404 __ ldrb(ip, FieldMemOperand(input, Map::kBitFieldOffset)); 4408 __ ldrb(ip, FieldMemOperand(input, Map::kBitFieldOffset));
4405 __ tst(ip, Operand(1 << Map::kIsUndetectable)); 4409 __ tst(ip, Operand(1 << Map::kIsUndetectable));
4406 final_branch_condition = ne; 4410 final_branch_condition = ne;
4407 4411
4408 } else if (type_name->Equals(heap()->function_symbol())) { 4412 } else if (type_name->Equals(heap()->function_symbol())) {
4409 __ JumpIfSmi(input, false_label); 4413 __ JumpIfSmi(input, false_label);
4410 __ CompareObjectType(input, input, scratch, 4414 __ CompareObjectType(input, input, scratch,
4411 FIRST_CALLABLE_SPEC_OBJECT_TYPE); 4415 FIRST_CALLABLE_SPEC_OBJECT_TYPE);
4412 final_branch_condition = ge; 4416 final_branch_condition = ge;
4413 4417
4414 } else if (type_name->Equals(heap()->object_symbol())) { 4418 } else if (type_name->Equals(heap()->object_symbol())) {
4415 __ JumpIfSmi(input, false_label); 4419 __ JumpIfSmi(input, false_label);
4416 __ CompareRoot(input, Heap::kNullValueRootIndex); 4420 if (!FLAG_harmony_typeof) {
4417 __ b(eq, true_label); 4421 __ CompareRoot(input, Heap::kNullValueRootIndex);
4422 __ b(eq, true_label);
4423 }
4418 __ CompareObjectType(input, input, scratch, 4424 __ CompareObjectType(input, input, scratch,
4419 FIRST_NONCALLABLE_SPEC_OBJECT_TYPE); 4425 FIRST_NONCALLABLE_SPEC_OBJECT_TYPE);
4420 __ b(lt, false_label); 4426 __ b(lt, false_label);
4421 __ CompareInstanceType(input, scratch, LAST_NONCALLABLE_SPEC_OBJECT_TYPE); 4427 __ CompareInstanceType(input, scratch, LAST_NONCALLABLE_SPEC_OBJECT_TYPE);
4422 __ b(gt, false_label); 4428 __ b(gt, false_label);
4423 // Check for undetectable objects => false. 4429 // Check for undetectable objects => false.
4424 __ ldrb(ip, FieldMemOperand(input, Map::kBitFieldOffset)); 4430 __ ldrb(ip, FieldMemOperand(input, Map::kBitFieldOffset));
4425 __ tst(ip, Operand(1 << Map::kIsUndetectable)); 4431 __ tst(ip, Operand(1 << Map::kIsUndetectable));
4426 final_branch_condition = eq; 4432 final_branch_condition = eq;
4427 4433
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
4571 ASSERT(osr_pc_offset_ == -1); 4577 ASSERT(osr_pc_offset_ == -1);
4572 osr_pc_offset_ = masm()->pc_offset(); 4578 osr_pc_offset_ = masm()->pc_offset();
4573 } 4579 }
4574 4580
4575 4581
4576 4582
4577 4583
4578 #undef __ 4584 #undef __
4579 4585
4580 } } // namespace v8::internal 4586 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/full-codegen-arm.cc ('k') | src/flag-definitions.h » ('j') | src/runtime.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698