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

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

Issue 6312185: x64: Implement SmiUntag, SmiTag, LoadHeapObject and LoadNamedGeneric (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/x64/lithium-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 1545 matching lines...) Expand 10 before | Expand all | Expand 10 after
1556 if (instr->hydrogen()->is_in_object()) { 1556 if (instr->hydrogen()->is_in_object()) {
1557 __ movq(result, FieldOperand(object, instr->hydrogen()->offset())); 1557 __ movq(result, FieldOperand(object, instr->hydrogen()->offset()));
1558 } else { 1558 } else {
1559 __ movq(result, FieldOperand(object, JSObject::kPropertiesOffset)); 1559 __ movq(result, FieldOperand(object, JSObject::kPropertiesOffset));
1560 __ movq(result, FieldOperand(result, instr->hydrogen()->offset())); 1560 __ movq(result, FieldOperand(result, instr->hydrogen()->offset()));
1561 } 1561 }
1562 } 1562 }
1563 1563
1564 1564
1565 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { 1565 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) {
1566 Abort("Unimplemented: %s", "DoLoadNamedGeneric"); 1566 ASSERT(ToRegister(instr->object()).is(rax));
1567 ASSERT(ToRegister(instr->result()).is(rax));
1568
1569 __ Move(rcx, instr->name());
1570 Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Initialize));
1571 CallCode(ic, RelocInfo::CODE_TARGET, instr);
1567 } 1572 }
1568 1573
1569 1574
1570 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { 1575 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) {
1571 Abort("Unimplemented: %s", "DoLoadFunctionPrototype"); 1576 Abort("Unimplemented: %s", "DoLoadFunctionPrototype");
1572 } 1577 }
1573 1578
1574 1579
1575 void LCodeGen::DoLoadElements(LLoadElements* instr) { 1580 void LCodeGen::DoLoadElements(LLoadElements* instr) {
1576 ASSERT(instr->result()->Equals(instr->InputAt(0))); 1581 ASSERT(instr->result()->Equals(instr->InputAt(0)));
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
1919 RecordSafepointWithRegisters( 1924 RecordSafepointWithRegisters(
1920 instr->pointer_map(), 0, Safepoint::kNoDeoptimizationIndex); 1925 instr->pointer_map(), 0, Safepoint::kNoDeoptimizationIndex);
1921 // Ensure that value in rax survives popping registers. 1926 // Ensure that value in rax survives popping registers.
1922 __ movq(kScratchRegister, rax); 1927 __ movq(kScratchRegister, rax);
1923 __ PopSafepointRegisters(); 1928 __ PopSafepointRegisters();
1924 __ movq(reg, kScratchRegister); 1929 __ movq(reg, kScratchRegister);
1925 } 1930 }
1926 1931
1927 1932
1928 void LCodeGen::DoSmiTag(LSmiTag* instr) { 1933 void LCodeGen::DoSmiTag(LSmiTag* instr) {
1929 Abort("Unimplemented: %s", "DoSmiTag"); 1934 ASSERT(instr->InputAt(0)->Equals(instr->result()));
1935 Register input = ToRegister(instr->InputAt(0));
1936 ASSERT(!instr->hydrogen_value()->CheckFlag(HValue::kCanOverflow));
1937 __ Integer32ToSmi(input, input);
1930 } 1938 }
1931 1939
1932 1940
1933 void LCodeGen::DoSmiUntag(LSmiUntag* instr) { 1941 void LCodeGen::DoSmiUntag(LSmiUntag* instr) {
1934 Abort("Unimplemented: %s", "DoSmiUntag"); 1942 ASSERT(instr->InputAt(0)->Equals(instr->result()));
1943 Register input = ToRegister(instr->InputAt(0));
1944 if (instr->needs_check()) {
1945 Condition is_smi = __ CheckSmi(input);
1946 DeoptimizeIf(NegateCondition(is_smi), instr->environment());
1947 }
1948 __ SmiToInteger32(input, input);
1935 } 1949 }
1936 1950
1937 1951
1938 void LCodeGen::EmitNumberUntagD(Register input_reg, 1952 void LCodeGen::EmitNumberUntagD(Register input_reg,
1939 XMMRegister result_reg, 1953 XMMRegister result_reg,
1940 LEnvironment* env) { 1954 LEnvironment* env) {
1941 NearLabel load_smi, heap_number, done; 1955 NearLabel load_smi, heap_number, done;
1942 1956
1943 // Smi check. 1957 // Smi check.
1944 __ JumpIfSmi(input_reg, &load_smi); 1958 __ JumpIfSmi(input_reg, &load_smi);
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
2103 LOperand* input = instr->InputAt(0); 2117 LOperand* input = instr->InputAt(0);
2104 ASSERT(input->IsRegister()); 2118 ASSERT(input->IsRegister());
2105 Register reg = ToRegister(input); 2119 Register reg = ToRegister(input);
2106 __ Cmp(FieldOperand(reg, HeapObject::kMapOffset), 2120 __ Cmp(FieldOperand(reg, HeapObject::kMapOffset),
2107 instr->hydrogen()->map()); 2121 instr->hydrogen()->map());
2108 DeoptimizeIf(not_equal, instr->environment()); 2122 DeoptimizeIf(not_equal, instr->environment());
2109 } 2123 }
2110 2124
2111 2125
2112 void LCodeGen::LoadHeapObject(Register result, Handle<HeapObject> object) { 2126 void LCodeGen::LoadHeapObject(Register result, Handle<HeapObject> object) {
2113 Abort("Unimplemented: %s", "LoadHeapObject"); 2127 if (Heap::InNewSpace(*object)) {
2128 Handle<JSGlobalPropertyCell> cell =
2129 Factory::NewJSGlobalPropertyCell(object);
2130 __ movq(result, cell, RelocInfo::GLOBAL_PROPERTY_CELL);
2131 __ movq(result, Operand(result, 0));
2132 } else {
2133 __ Move(result, object);
2134 }
2114 } 2135 }
2115 2136
2116 2137
2117 void LCodeGen::DoCheckPrototypeMaps(LCheckPrototypeMaps* instr) { 2138 void LCodeGen::DoCheckPrototypeMaps(LCheckPrototypeMaps* instr) {
2118 Register reg = ToRegister(instr->TempAt(0)); 2139 Register reg = ToRegister(instr->TempAt(0));
2119 2140
2120 Handle<JSObject> holder = instr->holder(); 2141 Handle<JSObject> holder = instr->holder();
2121 Handle<JSObject> current_prototype = instr->prototype(); 2142 Handle<JSObject> current_prototype = instr->prototype();
2122 2143
2123 // Load prototype object. 2144 // Load prototype object.
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
2329 2350
2330 void LCodeGen::DoOsrEntry(LOsrEntry* instr) { 2351 void LCodeGen::DoOsrEntry(LOsrEntry* instr) {
2331 Abort("Unimplemented: %s", "DoOsrEntry"); 2352 Abort("Unimplemented: %s", "DoOsrEntry");
2332 } 2353 }
2333 2354
2334 #undef __ 2355 #undef __
2335 2356
2336 } } // namespace v8::internal 2357 } } // namespace v8::internal
2337 2358
2338 #endif // V8_TARGET_ARCH_X64 2359 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « no previous file | src/x64/lithium-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698