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

Side by Side Diff: src/crankshaft/x64/lithium-codegen-x64.cc

Issue 1980463002: Fix %FunctionGetName and %_ClassOf for bound functions. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix %_ClassOf instead Created 4 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
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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_X64 5 #if V8_TARGET_ARCH_X64
6 6
7 #include "src/crankshaft/x64/lithium-codegen-x64.h" 7 #include "src/crankshaft/x64/lithium-codegen-x64.h"
8 8
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/code-factory.h" 10 #include "src/code-factory.h"
(...skipping 2363 matching lines...) Expand 10 before | Expand all | Expand 10 after
2374 Handle<String> class_name, 2374 Handle<String> class_name,
2375 Register input, 2375 Register input,
2376 Register temp, 2376 Register temp,
2377 Register temp2) { 2377 Register temp2) {
2378 DCHECK(!input.is(temp)); 2378 DCHECK(!input.is(temp));
2379 DCHECK(!input.is(temp2)); 2379 DCHECK(!input.is(temp2));
2380 DCHECK(!temp.is(temp2)); 2380 DCHECK(!temp.is(temp2));
2381 2381
2382 __ JumpIfSmi(input, is_false); 2382 __ JumpIfSmi(input, is_false);
2383 2383
2384 __ CmpObjectType(input, JS_FUNCTION_TYPE, temp); 2384 __ CmpObjectType(input, FIRST_FUNCTION_TYPE, temp);
2385 STATIC_ASSERT(LAST_FUNCTION_TYPE == LAST_TYPE);
2385 if (String::Equals(isolate()->factory()->Function_string(), class_name)) { 2386 if (String::Equals(isolate()->factory()->Function_string(), class_name)) {
2386 __ j(equal, is_true); 2387 __ j(above_equal, is_true);
2387 } else { 2388 } else {
2388 __ j(equal, is_false); 2389 __ j(above_equal, is_false);
2389 } 2390 }
2390 2391
2391 // Check if the constructor in the map is a function. 2392 // Check if the constructor in the map is a function.
2392 __ GetMapConstructor(temp, temp, kScratchRegister); 2393 __ GetMapConstructor(temp, temp, kScratchRegister);
2393 2394
2394 // Objects with a non-function constructor have class 'Object'. 2395 // Objects with a non-function constructor have class 'Object'.
2395 __ CmpInstanceType(kScratchRegister, JS_FUNCTION_TYPE); 2396 __ CmpInstanceType(kScratchRegister, JS_FUNCTION_TYPE);
2396 if (String::Equals(class_name, isolate()->factory()->Object_string())) { 2397 if (String::Equals(class_name, isolate()->factory()->Object_string())) {
2397 __ j(not_equal, is_true); 2398 __ j(not_equal, is_true);
2398 } else { 2399 } else {
(...skipping 3234 matching lines...) Expand 10 before | Expand all | Expand 10 after
5633 __ bind(deferred->exit()); 5634 __ bind(deferred->exit());
5634 __ bind(&done); 5635 __ bind(&done);
5635 } 5636 }
5636 5637
5637 #undef __ 5638 #undef __
5638 5639
5639 } // namespace internal 5640 } // namespace internal
5640 } // namespace v8 5641 } // namespace v8
5641 5642
5642 #endif // V8_TARGET_ARCH_X64 5643 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/crankshaft/mips64/lithium-codegen-mips64.cc ('k') | src/full-codegen/arm/full-codegen-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698