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

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

Issue 6930006: Make RegExp objects not callable. (Closed)
Patch Set: Address review comments Created 9 years, 7 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
« no previous file with comments | « src/execution.cc ('k') | src/objects.h » ('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 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 4263 matching lines...) Expand 10 before | Expand all | Expand 10 after
4274 __ j(equal, true_label); 4274 __ j(equal, true_label);
4275 __ JumpIfSmi(input, false_label); 4275 __ JumpIfSmi(input, false_label);
4276 // Check for undetectable objects => true. 4276 // Check for undetectable objects => true.
4277 __ mov(input, FieldOperand(input, HeapObject::kMapOffset)); 4277 __ mov(input, FieldOperand(input, HeapObject::kMapOffset));
4278 __ test_b(FieldOperand(input, Map::kBitFieldOffset), 4278 __ test_b(FieldOperand(input, Map::kBitFieldOffset),
4279 1 << Map::kIsUndetectable); 4279 1 << Map::kIsUndetectable);
4280 final_branch_condition = not_zero; 4280 final_branch_condition = not_zero;
4281 4281
4282 } else if (type_name->Equals(heap()->function_symbol())) { 4282 } else if (type_name->Equals(heap()->function_symbol())) {
4283 __ JumpIfSmi(input, false_label); 4283 __ JumpIfSmi(input, false_label);
4284 __ CmpObjectType(input, JS_FUNCTION_TYPE, input); 4284 __ CmpObjectType(input, FIRST_FUNCTION_CLASS_TYPE, input);
4285 __ j(equal, true_label); 4285 final_branch_condition = above_equal;
4286 // Regular expressions => 'function' (they are callable).
4287 __ CmpInstanceType(input, JS_REGEXP_TYPE);
4288 final_branch_condition = equal;
4289 4286
4290 } else if (type_name->Equals(heap()->object_symbol())) { 4287 } else if (type_name->Equals(heap()->object_symbol())) {
4291 __ JumpIfSmi(input, false_label); 4288 __ JumpIfSmi(input, false_label);
4292 __ cmp(input, factory()->null_value()); 4289 __ cmp(input, factory()->null_value());
4293 __ j(equal, true_label); 4290 __ j(equal, true_label);
4294 // Regular expressions => 'function', not 'object'.
4295 __ CmpObjectType(input, FIRST_JS_OBJECT_TYPE, input); 4291 __ CmpObjectType(input, FIRST_JS_OBJECT_TYPE, input);
4296 __ j(below, false_label); 4292 __ j(below, false_label);
4297 __ CmpInstanceType(input, FIRST_FUNCTION_CLASS_TYPE); 4293 __ CmpInstanceType(input, FIRST_FUNCTION_CLASS_TYPE);
4298 __ j(above_equal, false_label); 4294 __ j(above_equal, false_label);
4299 // Check for undetectable objects => false. 4295 // Check for undetectable objects => false.
4300 __ test_b(FieldOperand(input, Map::kBitFieldOffset), 4296 __ test_b(FieldOperand(input, Map::kBitFieldOffset),
4301 1 << Map::kIsUndetectable); 4297 1 << Map::kIsUndetectable);
4302 final_branch_condition = zero; 4298 final_branch_condition = zero;
4303 4299
4304 } else { 4300 } else {
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
4452 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); 4448 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset));
4453 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator); 4449 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator);
4454 } 4450 }
4455 4451
4456 4452
4457 #undef __ 4453 #undef __
4458 4454
4459 } } // namespace v8::internal 4455 } } // namespace v8::internal
4460 4456
4461 #endif // V8_TARGET_ARCH_IA32 4457 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/execution.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698