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

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

Issue 15779004: Fix embedded new-space pointer in LCmpObjectEqAndBranch. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « src/ia32/macro-assembler-ia32.cc ('k') | src/x64/macro-assembler-x64.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 2064 matching lines...) Expand 10 before | Expand all | Expand 10 after
2075 } 2075 }
2076 } 2076 }
2077 2077
2078 2078
2079 void LCodeGen::DoCmpObjectEqAndBranch(LCmpObjectEqAndBranch* instr) { 2079 void LCodeGen::DoCmpObjectEqAndBranch(LCmpObjectEqAndBranch* instr) {
2080 Register left = ToRegister(instr->left()); 2080 Register left = ToRegister(instr->left());
2081 int false_block = chunk_->LookupDestination(instr->false_block_id()); 2081 int false_block = chunk_->LookupDestination(instr->false_block_id());
2082 int true_block = chunk_->LookupDestination(instr->true_block_id()); 2082 int true_block = chunk_->LookupDestination(instr->true_block_id());
2083 2083
2084 if (instr->right()->IsConstantOperand()) { 2084 if (instr->right()->IsConstantOperand()) {
2085 __ Cmp(left, ToHandle(LConstantOperand::cast(instr->right()))); 2085 Handle<Object> right = ToHandle(LConstantOperand::cast(instr->right()));
2086 __ CmpObject(left, right);
2086 } else { 2087 } else {
2087 __ cmpq(left, ToRegister(instr->right())); 2088 Register right = ToRegister(instr->right());
2089 __ cmpq(left, right);
2088 } 2090 }
2089 EmitBranch(true_block, false_block, equal); 2091 EmitBranch(true_block, false_block, equal);
2090 } 2092 }
2091 2093
2092 2094
2093 void LCodeGen::DoCmpConstantEqAndBranch(LCmpConstantEqAndBranch* instr) { 2095 void LCodeGen::DoCmpConstantEqAndBranch(LCmpConstantEqAndBranch* instr) {
2094 Register left = ToRegister(instr->left()); 2096 Register left = ToRegister(instr->left());
2095 int true_block = chunk_->LookupDestination(instr->true_block_id()); 2097 int true_block = chunk_->LookupDestination(instr->true_block_id());
2096 int false_block = chunk_->LookupDestination(instr->false_block_id()); 2098 int false_block = chunk_->LookupDestination(instr->false_block_id());
2097 2099
(...skipping 2848 matching lines...) Expand 10 before | Expand all | Expand 10 after
4946 __ cmpb(kScratchRegister, Immediate(tag)); 4948 __ cmpb(kScratchRegister, Immediate(tag));
4947 DeoptimizeIf(not_equal, instr->environment()); 4949 DeoptimizeIf(not_equal, instr->environment());
4948 } 4950 }
4949 } 4951 }
4950 } 4952 }
4951 4953
4952 4954
4953 void LCodeGen::DoCheckFunction(LCheckFunction* instr) { 4955 void LCodeGen::DoCheckFunction(LCheckFunction* instr) {
4954 Register reg = ToRegister(instr->value()); 4956 Register reg = ToRegister(instr->value());
4955 Handle<JSFunction> target = instr->hydrogen()->target(); 4957 Handle<JSFunction> target = instr->hydrogen()->target();
4956 ALLOW_HANDLE_DEREF(isolate(), "using raw address"); 4958 __ CmpHeapObject(reg, target);
mvstanton 2013/05/23 13:09:14 Nice that you could refactor this code...how about
Michael Starzinger 2013/05/23 13:13:51 As discussed offline: Yes, I agree, ia32 should us
4957 if (isolate()->heap()->InNewSpace(*target)) {
4958 Handle<JSGlobalPropertyCell> cell =
4959 isolate()->factory()->NewJSGlobalPropertyCell(target);
4960 __ movq(kScratchRegister, cell, RelocInfo::GLOBAL_PROPERTY_CELL);
4961 __ cmpq(reg, Operand(kScratchRegister, 0));
4962 } else {
4963 __ Cmp(reg, target);
4964 }
4965 DeoptimizeIf(not_equal, instr->environment()); 4959 DeoptimizeIf(not_equal, instr->environment());
4966 } 4960 }
4967 4961
4968 4962
4969 void LCodeGen::DoCheckMapCommon(Register reg, 4963 void LCodeGen::DoCheckMapCommon(Register reg,
4970 Handle<Map> map, 4964 Handle<Map> map,
4971 LInstruction* instr) { 4965 LInstruction* instr) {
4972 Label success; 4966 Label success;
4973 __ CompareMap(reg, map, &success); 4967 __ CompareMap(reg, map, &success);
4974 DeoptimizeIf(not_equal, instr->environment()); 4968 DeoptimizeIf(not_equal, instr->environment());
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after
5668 FixedArray::kHeaderSize - kPointerSize)); 5662 FixedArray::kHeaderSize - kPointerSize));
5669 __ bind(&done); 5663 __ bind(&done);
5670 } 5664 }
5671 5665
5672 5666
5673 #undef __ 5667 #undef __
5674 5668
5675 } } // namespace v8::internal 5669 } } // namespace v8::internal
5676 5670
5677 #endif // V8_TARGET_ARCH_X64 5671 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/ia32/macro-assembler-ia32.cc ('k') | src/x64/macro-assembler-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698