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

Side by Side Diff: src/x64/lithium-codegen-x64.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 3990 matching lines...) Expand 10 before | Expand all | Expand 10 after
4001 __ testb(FieldOperand(input, Map::kBitFieldOffset), 4001 __ testb(FieldOperand(input, Map::kBitFieldOffset),
4002 Immediate(1 << Map::kIsUndetectable)); 4002 Immediate(1 << Map::kIsUndetectable));
4003 final_branch_condition = zero; 4003 final_branch_condition = zero;
4004 4004
4005 } else if (type_name->Equals(heap()->boolean_symbol())) { 4005 } else if (type_name->Equals(heap()->boolean_symbol())) {
4006 __ CompareRoot(input, Heap::kTrueValueRootIndex); 4006 __ CompareRoot(input, Heap::kTrueValueRootIndex);
4007 __ j(equal, true_label); 4007 __ j(equal, true_label);
4008 __ CompareRoot(input, Heap::kFalseValueRootIndex); 4008 __ CompareRoot(input, Heap::kFalseValueRootIndex);
4009 final_branch_condition = equal; 4009 final_branch_condition = equal;
4010 4010
4011 } else if (FLAG_harmony_typeof && type_name->Equals(heap()->null_symbol())) {
4012 __ CompareRoot(input, Heap::kNullValueRootIndex);
4013 final_branch_condition = equal;
4014
4011 } else if (type_name->Equals(heap()->undefined_symbol())) { 4015 } else if (type_name->Equals(heap()->undefined_symbol())) {
4012 __ CompareRoot(input, Heap::kUndefinedValueRootIndex); 4016 __ CompareRoot(input, Heap::kUndefinedValueRootIndex);
4013 __ j(equal, true_label); 4017 __ j(equal, true_label);
4014 __ JumpIfSmi(input, false_label); 4018 __ JumpIfSmi(input, false_label);
4015 // Check for undetectable objects => true. 4019 // Check for undetectable objects => true.
4016 __ movq(input, FieldOperand(input, HeapObject::kMapOffset)); 4020 __ movq(input, FieldOperand(input, HeapObject::kMapOffset));
4017 __ testb(FieldOperand(input, Map::kBitFieldOffset), 4021 __ testb(FieldOperand(input, Map::kBitFieldOffset),
4018 Immediate(1 << Map::kIsUndetectable)); 4022 Immediate(1 << Map::kIsUndetectable));
4019 final_branch_condition = not_zero; 4023 final_branch_condition = not_zero;
4020 4024
4021 } else if (type_name->Equals(heap()->function_symbol())) { 4025 } else if (type_name->Equals(heap()->function_symbol())) {
4022 __ JumpIfSmi(input, false_label); 4026 __ JumpIfSmi(input, false_label);
4023 __ CmpObjectType(input, FIRST_CALLABLE_SPEC_OBJECT_TYPE, input); 4027 __ CmpObjectType(input, FIRST_CALLABLE_SPEC_OBJECT_TYPE, input);
4024 final_branch_condition = above_equal; 4028 final_branch_condition = above_equal;
4025 4029
4026 } else if (type_name->Equals(heap()->object_symbol())) { 4030 } else if (type_name->Equals(heap()->object_symbol())) {
4027 __ JumpIfSmi(input, false_label); 4031 __ JumpIfSmi(input, false_label);
4028 __ CompareRoot(input, Heap::kNullValueRootIndex); 4032 if (!FLAG_harmony_typeof) {
4029 __ j(equal, true_label); 4033 __ CompareRoot(input, Heap::kNullValueRootIndex);
4034 __ j(equal, true_label);
4035 }
4030 __ CmpObjectType(input, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, input); 4036 __ CmpObjectType(input, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, input);
4031 __ j(below, false_label); 4037 __ j(below, false_label);
4032 __ CmpInstanceType(input, LAST_NONCALLABLE_SPEC_OBJECT_TYPE); 4038 __ CmpInstanceType(input, LAST_NONCALLABLE_SPEC_OBJECT_TYPE);
4033 __ j(above, false_label); 4039 __ j(above, false_label);
4034 // Check for undetectable objects => false. 4040 // Check for undetectable objects => false.
4035 __ testb(FieldOperand(input, Map::kBitFieldOffset), 4041 __ testb(FieldOperand(input, Map::kBitFieldOffset),
4036 Immediate(1 << Map::kIsUndetectable)); 4042 Immediate(1 << Map::kIsUndetectable));
4037 final_branch_condition = zero; 4043 final_branch_condition = zero;
4038 4044
4039 } else { 4045 } else {
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
4184 RegisterEnvironmentForDeoptimization(environment); 4190 RegisterEnvironmentForDeoptimization(environment);
4185 ASSERT(osr_pc_offset_ == -1); 4191 ASSERT(osr_pc_offset_ == -1);
4186 osr_pc_offset_ = masm()->pc_offset(); 4192 osr_pc_offset_ = masm()->pc_offset();
4187 } 4193 }
4188 4194
4189 #undef __ 4195 #undef __
4190 4196
4191 } } // namespace v8::internal 4197 } } // namespace v8::internal
4192 4198
4193 #endif // V8_TARGET_ARCH_X64 4199 #endif // V8_TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698