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

Side by Side Diff: src/x64/code-stubs-x64.cc

Issue 6800014: Bug 1309 non-extensible objects have immutable __Proto__ (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Git Created 9 years, 8 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/x64/assembler-x64.cc ('k') | src/x64/deoptimizer-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 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 1404 matching lines...) Expand 10 before | Expand all | Expand 10 after
1415 case Token::SHR: 1415 case Token::SHR:
1416 __ InvokeBuiltin(Builtins::SHR, JUMP_FUNCTION); 1416 __ InvokeBuiltin(Builtins::SHR, JUMP_FUNCTION);
1417 break; 1417 break;
1418 default: 1418 default:
1419 UNREACHABLE(); 1419 UNREACHABLE();
1420 } 1420 }
1421 } 1421 }
1422 1422
1423 1423
1424 void TypeRecordingBinaryOpStub::GenerateSmiStub(MacroAssembler* masm) { 1424 void TypeRecordingBinaryOpStub::GenerateSmiStub(MacroAssembler* masm) {
1425 Label not_smi; 1425 Label call_runtime;
1426 if (result_type_ == TRBinaryOpIC::UNINITIALIZED ||
1427 result_type_ == TRBinaryOpIC::SMI) {
1428 // Only allow smi results.
1429 GenerateSmiCode(masm, NULL, NO_HEAPNUMBER_RESULTS);
1430 } else {
1431 // Allow heap number result and don't make a transition if a heap number
1432 // cannot be allocated.
1433 GenerateSmiCode(masm, &call_runtime, ALLOW_HEAPNUMBER_RESULTS);
1434 }
1426 1435
1427 GenerateSmiCode(masm, &not_smi, NO_HEAPNUMBER_RESULTS); 1436 // Code falls through if the result is not returned as either a smi or heap
1437 // number.
1438 GenerateTypeTransition(masm);
1428 1439
1429 __ bind(&not_smi); 1440 __ bind(&call_runtime);
1430 GenerateTypeTransition(masm); 1441 GenerateCallRuntimeCode(masm);
1431 } 1442 }
1432 1443
1433 1444
1434 void TypeRecordingBinaryOpStub::GenerateStringStub(MacroAssembler* masm) { 1445 void TypeRecordingBinaryOpStub::GenerateStringStub(MacroAssembler* masm) {
1435 ASSERT(operands_type_ == TRBinaryOpIC::STRING); 1446 ASSERT(operands_type_ == TRBinaryOpIC::STRING);
1436 ASSERT(op_ == Token::ADD); 1447 ASSERT(op_ == Token::ADD);
1437 GenerateStringAddCode(masm); 1448 GenerateStringAddCode(masm);
1438 // Try to add arguments as strings, otherwise, transition to the generic 1449 // Try to add arguments as strings, otherwise, transition to the generic
1439 // TRBinaryOpIC type. 1450 // TRBinaryOpIC type.
1440 GenerateTypeTransition(masm); 1451 GenerateTypeTransition(masm);
(...skipping 1513 matching lines...) Expand 10 before | Expand all | Expand 10 after
2954 GenerateConvertHashCodeToIndex(masm, scratch, mask); 2965 GenerateConvertHashCodeToIndex(masm, scratch, mask);
2955 2966
2956 Register index = scratch; 2967 Register index = scratch;
2957 Register probe = mask; 2968 Register probe = mask;
2958 __ movq(probe, 2969 __ movq(probe,
2959 FieldOperand(number_string_cache, 2970 FieldOperand(number_string_cache,
2960 index, 2971 index,
2961 times_1, 2972 times_1,
2962 FixedArray::kHeaderSize)); 2973 FixedArray::kHeaderSize));
2963 __ JumpIfSmi(probe, not_found); 2974 __ JumpIfSmi(probe, not_found);
2964 ASSERT(CpuFeatures::IsSupported(SSE2));
2965 CpuFeatures::Scope fscope(SSE2);
2966 __ movsd(xmm0, FieldOperand(object, HeapNumber::kValueOffset)); 2975 __ movsd(xmm0, FieldOperand(object, HeapNumber::kValueOffset));
2967 __ movsd(xmm1, FieldOperand(probe, HeapNumber::kValueOffset)); 2976 __ movsd(xmm1, FieldOperand(probe, HeapNumber::kValueOffset));
2968 __ ucomisd(xmm0, xmm1); 2977 __ ucomisd(xmm0, xmm1);
2969 __ j(parity_even, not_found); // Bail out if NaN is involved. 2978 __ j(parity_even, not_found); // Bail out if NaN is involved.
2970 __ j(not_equal, not_found); // The cache did not contain this value. 2979 __ j(not_equal, not_found); // The cache did not contain this value.
2971 __ jmp(&load_result_from_cache); 2980 __ jmp(&load_result_from_cache);
2972 } 2981 }
2973 2982
2974 __ bind(&is_smi); 2983 __ bind(&is_smi);
2975 __ SmiToInteger32(scratch, object); 2984 __ SmiToInteger32(scratch, object);
(...skipping 2149 matching lines...) Expand 10 before | Expand all | Expand 10 after
5125 // Do a tail call to the rewritten stub. 5134 // Do a tail call to the rewritten stub.
5126 __ jmp(rdi); 5135 __ jmp(rdi);
5127 } 5136 }
5128 5137
5129 5138
5130 #undef __ 5139 #undef __
5131 5140
5132 } } // namespace v8::internal 5141 } } // namespace v8::internal
5133 5142
5134 #endif // V8_TARGET_ARCH_X64 5143 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/assembler-x64.cc ('k') | src/x64/deoptimizer-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698