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

Side by Side Diff: src/ia32/lithium-codegen-ia32.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 4182 matching lines...) Expand 10 before | Expand all | Expand 10 after
4193 __ test_b(FieldOperand(input, Map::kBitFieldOffset), 4193 __ test_b(FieldOperand(input, Map::kBitFieldOffset),
4194 1 << Map::kIsUndetectable); 4194 1 << Map::kIsUndetectable);
4195 final_branch_condition = zero; 4195 final_branch_condition = zero;
4196 4196
4197 } else if (type_name->Equals(heap()->boolean_symbol())) { 4197 } else if (type_name->Equals(heap()->boolean_symbol())) {
4198 __ cmp(input, factory()->true_value()); 4198 __ cmp(input, factory()->true_value());
4199 __ j(equal, true_label); 4199 __ j(equal, true_label);
4200 __ cmp(input, factory()->false_value()); 4200 __ cmp(input, factory()->false_value());
4201 final_branch_condition = equal; 4201 final_branch_condition = equal;
4202 4202
4203 } else if (FLAG_harmony_typeof && type_name->Equals(heap()->null_symbol())) {
4204 __ cmp(input, factory()->null_value());
4205 final_branch_condition = equal;
4206
4203 } else if (type_name->Equals(heap()->undefined_symbol())) { 4207 } else if (type_name->Equals(heap()->undefined_symbol())) {
4204 __ cmp(input, factory()->undefined_value()); 4208 __ cmp(input, factory()->undefined_value());
4205 __ j(equal, true_label); 4209 __ j(equal, true_label);
4206 __ JumpIfSmi(input, false_label); 4210 __ JumpIfSmi(input, false_label);
4207 // Check for undetectable objects => true. 4211 // Check for undetectable objects => true.
4208 __ mov(input, FieldOperand(input, HeapObject::kMapOffset)); 4212 __ mov(input, FieldOperand(input, HeapObject::kMapOffset));
4209 __ test_b(FieldOperand(input, Map::kBitFieldOffset), 4213 __ test_b(FieldOperand(input, Map::kBitFieldOffset),
4210 1 << Map::kIsUndetectable); 4214 1 << Map::kIsUndetectable);
4211 final_branch_condition = not_zero; 4215 final_branch_condition = not_zero;
4212 4216
4213 } else if (type_name->Equals(heap()->function_symbol())) { 4217 } else if (type_name->Equals(heap()->function_symbol())) {
4214 STATIC_ASSERT(LAST_TYPE == LAST_CALLABLE_SPEC_OBJECT_TYPE); 4218 STATIC_ASSERT(LAST_TYPE == LAST_CALLABLE_SPEC_OBJECT_TYPE);
4215 __ JumpIfSmi(input, false_label); 4219 __ JumpIfSmi(input, false_label);
4216 __ CmpObjectType(input, FIRST_CALLABLE_SPEC_OBJECT_TYPE, input); 4220 __ CmpObjectType(input, FIRST_CALLABLE_SPEC_OBJECT_TYPE, input);
4217 final_branch_condition = above_equal; 4221 final_branch_condition = above_equal;
4218 4222
4219 } else if (type_name->Equals(heap()->object_symbol())) { 4223 } else if (type_name->Equals(heap()->object_symbol())) {
4220 __ JumpIfSmi(input, false_label); 4224 __ JumpIfSmi(input, false_label);
4221 __ cmp(input, factory()->null_value()); 4225 if (!FLAG_harmony_typeof) {
4222 __ j(equal, true_label); 4226 __ cmp(input, factory()->null_value());
4227 __ j(equal, true_label);
4228 }
4223 __ CmpObjectType(input, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, input); 4229 __ CmpObjectType(input, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, input);
4224 __ j(below, false_label); 4230 __ j(below, false_label);
4225 __ CmpInstanceType(input, LAST_NONCALLABLE_SPEC_OBJECT_TYPE); 4231 __ CmpInstanceType(input, LAST_NONCALLABLE_SPEC_OBJECT_TYPE);
4226 __ j(above, false_label); 4232 __ j(above, false_label);
4227 // Check for undetectable objects => false. 4233 // Check for undetectable objects => false.
4228 __ test_b(FieldOperand(input, Map::kBitFieldOffset), 4234 __ test_b(FieldOperand(input, Map::kBitFieldOffset),
4229 1 << Map::kIsUndetectable); 4235 1 << Map::kIsUndetectable);
4230 final_branch_condition = zero; 4236 final_branch_condition = zero;
4231 4237
4232 } else { 4238 } else {
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
4399 env->deoptimization_index()); 4405 env->deoptimization_index());
4400 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator); 4406 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator);
4401 } 4407 }
4402 4408
4403 4409
4404 #undef __ 4410 #undef __
4405 4411
4406 } } // namespace v8::internal 4412 } } // namespace v8::internal
4407 4413
4408 #endif // V8_TARGET_ARCH_IA32 4414 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/full-codegen-ia32.cc ('k') | src/runtime.cc » ('j') | src/runtime.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698