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

Side by Side Diff: src/full-codegen/mips64/full-codegen-mips64.cc

Issue 1306303005: Revert of [es5] Class of object is "Function" if object has [[Call]]. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 3 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/full-codegen/mips/full-codegen-mips.cc ('k') | src/full-codegen/x64/full-codegen-x64.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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #if V8_TARGET_ARCH_MIPS64 5 #if V8_TARGET_ARCH_MIPS64
6 6
7 // Note on Mips implementation: 7 // Note on Mips implementation:
8 // 8 //
9 // The result_register() for mips is the 'v0' register, which is defined 9 // The result_register() for mips is the 'v0' register, which is defined
10 // by the ABI to contain function return values. However, the first 10 // by the ABI to contain function return values. However, the first
(...skipping 3669 matching lines...) Expand 10 before | Expand all | Expand 10 after
3680 void FullCodeGenerator::EmitClassOf(CallRuntime* expr) { 3680 void FullCodeGenerator::EmitClassOf(CallRuntime* expr) {
3681 ZoneList<Expression*>* args = expr->arguments(); 3681 ZoneList<Expression*>* args = expr->arguments();
3682 DCHECK(args->length() == 1); 3682 DCHECK(args->length() == 1);
3683 Label done, null, function, non_function_constructor; 3683 Label done, null, function, non_function_constructor;
3684 3684
3685 VisitForAccumulatorValue(args->at(0)); 3685 VisitForAccumulatorValue(args->at(0));
3686 3686
3687 // If the object is a smi, we return null. 3687 // If the object is a smi, we return null.
3688 __ JumpIfSmi(v0, &null); 3688 __ JumpIfSmi(v0, &null);
3689 3689
3690 // If the object is not a receiver, we return null. 3690 // Check that the object is a JS object but take special care of JS
3691 STATIC_ASSERT(LAST_JS_RECEIVER_TYPE == LAST_TYPE); 3691 // functions to make sure they have 'Function' as their class.
3692 // Assume that there are only two callable types, and one of them is at
3693 // either end of the type range for JS object types. Saves extra comparisons.
3694 STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2);
3692 __ GetObjectType(v0, v0, a1); // Map is now in v0. 3695 __ GetObjectType(v0, v0, a1); // Map is now in v0.
3693 __ Branch(&null, lt, a1, Operand(FIRST_JS_RECEIVER_TYPE)); 3696 __ Branch(&null, lt, a1, Operand(FIRST_SPEC_OBJECT_TYPE));
3694 3697
3695 // According to ES5 section 15 Standard Built-in ECMAScript Objects, the 3698 STATIC_ASSERT(FIRST_NONCALLABLE_SPEC_OBJECT_TYPE ==
3696 // [[Class]] of builtin objects is "Function" if a [[Call]] internal 3699 FIRST_SPEC_OBJECT_TYPE + 1);
3697 // method is present. 3700 __ Branch(&function, eq, a1, Operand(FIRST_SPEC_OBJECT_TYPE));
3698 __ lbu(a1, FieldMemOperand(v0, Map::kBitFieldOffset)); 3701
3699 __ And(a1, a1, Operand(1 << Map::kIsCallable)); 3702 STATIC_ASSERT(LAST_NONCALLABLE_SPEC_OBJECT_TYPE ==
3700 __ Branch(&function, ne, a1, Operand(zero_reg)); 3703 LAST_SPEC_OBJECT_TYPE - 1);
3704 __ Branch(&function, eq, a1, Operand(LAST_SPEC_OBJECT_TYPE));
3705 // Assume that there is no larger type.
3706 STATIC_ASSERT(LAST_NONCALLABLE_SPEC_OBJECT_TYPE == LAST_TYPE - 1);
3701 3707
3702 // Check if the constructor in the map is a JS function. 3708 // Check if the constructor in the map is a JS function.
3703 Register instance_type = a2; 3709 Register instance_type = a2;
3704 __ GetMapConstructor(v0, v0, a1, instance_type); 3710 __ GetMapConstructor(v0, v0, a1, instance_type);
3705 __ Branch(&non_function_constructor, ne, instance_type, 3711 __ Branch(&non_function_constructor, ne, instance_type,
3706 Operand(JS_FUNCTION_TYPE)); 3712 Operand(JS_FUNCTION_TYPE));
3707 3713
3708 // v0 now contains the constructor function. Grab the 3714 // v0 now contains the constructor function. Grab the
3709 // instance class name from there. 3715 // instance class name from there.
3710 __ ld(v0, FieldMemOperand(v0, JSFunction::kSharedFunctionInfoOffset)); 3716 __ ld(v0, FieldMemOperand(v0, JSFunction::kSharedFunctionInfoOffset));
(...skipping 1611 matching lines...) Expand 10 before | Expand all | Expand 10 after
5322 reinterpret_cast<uint64_t>( 5328 reinterpret_cast<uint64_t>(
5323 isolate->builtins()->OsrAfterStackCheck()->entry())); 5329 isolate->builtins()->OsrAfterStackCheck()->entry()));
5324 return OSR_AFTER_STACK_CHECK; 5330 return OSR_AFTER_STACK_CHECK;
5325 } 5331 }
5326 5332
5327 5333
5328 } // namespace internal 5334 } // namespace internal
5329 } // namespace v8 5335 } // namespace v8
5330 5336
5331 #endif // V8_TARGET_ARCH_MIPS64 5337 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/full-codegen/mips/full-codegen-mips.cc ('k') | src/full-codegen/x64/full-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698