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

Side by Side Diff: src/s390/macro-assembler-s390.cc

Issue 2686723004: [stubs] Port LoadFunctionPrototypeStub to CSA (Closed)
Patch Set: Created 3 years, 10 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/s390/macro-assembler-s390.h ('k') | src/x64/code-stubs-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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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 #include <assert.h> // For assert 5 #include <assert.h> // For assert
6 #include <limits.h> // For LONG_MIN, LONG_MAX. 6 #include <limits.h> // For LONG_MIN, LONG_MAX.
7 7
8 #if V8_TARGET_ARCH_S390 8 #if V8_TARGET_ARCH_S390
9 9
10 #include "src/base/bits.h" 10 #include "src/base/bits.h"
(...skipping 1948 matching lines...) Expand 10 before | Expand all | Expand 10 after
1959 LoadP(result, FieldMemOperand(map, Map::kConstructorOrBackPointerOffset)); 1959 LoadP(result, FieldMemOperand(map, Map::kConstructorOrBackPointerOffset));
1960 bind(&loop); 1960 bind(&loop);
1961 JumpIfSmi(result, &done); 1961 JumpIfSmi(result, &done);
1962 CompareObjectType(result, temp, temp2, MAP_TYPE); 1962 CompareObjectType(result, temp, temp2, MAP_TYPE);
1963 bne(&done); 1963 bne(&done);
1964 LoadP(result, FieldMemOperand(result, Map::kConstructorOrBackPointerOffset)); 1964 LoadP(result, FieldMemOperand(result, Map::kConstructorOrBackPointerOffset));
1965 b(&loop); 1965 b(&loop);
1966 bind(&done); 1966 bind(&done);
1967 } 1967 }
1968 1968
1969 void MacroAssembler::TryGetFunctionPrototype(Register function, Register result,
1970 Register scratch, Label* miss) {
1971 // Get the prototype or initial map from the function.
1972 LoadP(result,
1973 FieldMemOperand(function, JSFunction::kPrototypeOrInitialMapOffset));
1974
1975 // If the prototype or initial map is the hole, don't return it and
1976 // simply miss the cache instead. This will allow us to allocate a
1977 // prototype object on-demand in the runtime system.
1978 CompareRoot(result, Heap::kTheHoleValueRootIndex);
1979 beq(miss);
1980
1981 // If the function does not have an initial map, we're done.
1982 Label done;
1983 CompareObjectType(result, scratch, scratch, MAP_TYPE);
1984 bne(&done, Label::kNear);
1985
1986 // Get the prototype from the initial map.
1987 LoadP(result, FieldMemOperand(result, Map::kPrototypeOffset));
1988
1989 // All done.
1990 bind(&done);
1991 }
1992
1993 void MacroAssembler::CallStub(CodeStub* stub, TypeFeedbackId ast_id, 1969 void MacroAssembler::CallStub(CodeStub* stub, TypeFeedbackId ast_id,
1994 Condition cond) { 1970 Condition cond) {
1995 DCHECK(AllowThisStubCall(stub)); // Stub calls are not allowed in some stubs. 1971 DCHECK(AllowThisStubCall(stub)); // Stub calls are not allowed in some stubs.
1996 Call(stub->GetCode(), RelocInfo::CODE_TARGET, ast_id, cond); 1972 Call(stub->GetCode(), RelocInfo::CODE_TARGET, ast_id, cond);
1997 } 1973 }
1998 1974
1999 void MacroAssembler::TailCallStub(CodeStub* stub, Condition cond) { 1975 void MacroAssembler::TailCallStub(CodeStub* stub, Condition cond) {
2000 Jump(stub->GetCode(), RelocInfo::CODE_TARGET, cond); 1976 Jump(stub->GetCode(), RelocInfo::CODE_TARGET, cond);
2001 } 1977 }
2002 1978
(...skipping 3349 matching lines...) Expand 10 before | Expand all | Expand 10 after
5352 } 5328 }
5353 if (mag.shift > 0) ShiftRightArith(result, result, Operand(mag.shift)); 5329 if (mag.shift > 0) ShiftRightArith(result, result, Operand(mag.shift));
5354 ExtractBit(r0, dividend, 31); 5330 ExtractBit(r0, dividend, 31);
5355 AddP(result, r0); 5331 AddP(result, r0);
5356 } 5332 }
5357 5333
5358 } // namespace internal 5334 } // namespace internal
5359 } // namespace v8 5335 } // namespace v8
5360 5336
5361 #endif // V8_TARGET_ARCH_S390 5337 #endif // V8_TARGET_ARCH_S390
OLDNEW
« no previous file with comments | « src/s390/macro-assembler-s390.h ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698