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

Side by Side Diff: src/mips64/full-codegen-mips64.cc

Issue 700513002: Version 3.29.88.12 (merged r24927, r24987, r25060, r24950, r24993) (Closed) Base URL: https://v8.googlecode.com/svn/branches/3.29
Patch Set: Created 6 years, 1 month 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/mips/full-codegen-mips.cc ('k') | src/objects.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_MIPS64 7 #if V8_TARGET_ARCH_MIPS64
8 8
9 // Note on Mips implementation: 9 // Note on Mips implementation:
10 // 10 //
(...skipping 2243 matching lines...) Expand 10 before | Expand all | Expand 10 after
2254 2254
2255 __ bind(&done); 2255 __ bind(&done);
2256 context()->Plug(result_register()); 2256 context()->Plug(result_register());
2257 } 2257 }
2258 2258
2259 2259
2260 void FullCodeGenerator::EmitCreateIteratorResult(bool done) { 2260 void FullCodeGenerator::EmitCreateIteratorResult(bool done) {
2261 Label gc_required; 2261 Label gc_required;
2262 Label allocated; 2262 Label allocated;
2263 2263
2264 Handle<Map> map(isolate()->native_context()->iterator_result_map()); 2264 const int instance_size = 5 * kPointerSize;
2265 DCHECK_EQ(isolate()->native_context()->iterator_result_map()->instance_size(),
2266 instance_size);
2265 2267
2266 __ Allocate(map->instance_size(), v0, a2, a3, &gc_required, TAG_OBJECT); 2268 __ Allocate(instance_size, v0, a2, a3, &gc_required, TAG_OBJECT);
2267 __ jmp(&allocated); 2269 __ jmp(&allocated);
2268 2270
2269 __ bind(&gc_required); 2271 __ bind(&gc_required);
2270 __ Push(Smi::FromInt(map->instance_size())); 2272 __ Push(Smi::FromInt(instance_size));
2271 __ CallRuntime(Runtime::kAllocateInNewSpace, 1); 2273 __ CallRuntime(Runtime::kAllocateInNewSpace, 1);
2272 __ ld(context_register(), 2274 __ ld(context_register(),
2273 MemOperand(fp, StandardFrameConstants::kContextOffset)); 2275 MemOperand(fp, StandardFrameConstants::kContextOffset));
2274 2276
2275 __ bind(&allocated); 2277 __ bind(&allocated);
2276 __ li(a1, Operand(map)); 2278 __ ld(a1, ContextOperand(cp, Context::GLOBAL_OBJECT_INDEX));
2279 __ ld(a1, FieldMemOperand(a1, GlobalObject::kNativeContextOffset));
2280 __ ld(a1, ContextOperand(a1, Context::ITERATOR_RESULT_MAP_INDEX));
2277 __ pop(a2); 2281 __ pop(a2);
2278 __ li(a3, Operand(isolate()->factory()->ToBoolean(done))); 2282 __ li(a3, Operand(isolate()->factory()->ToBoolean(done)));
2279 __ li(a4, Operand(isolate()->factory()->empty_fixed_array())); 2283 __ li(a4, Operand(isolate()->factory()->empty_fixed_array()));
2280 DCHECK_EQ(map->instance_size(), 5 * kPointerSize);
2281 __ sd(a1, FieldMemOperand(v0, HeapObject::kMapOffset)); 2284 __ sd(a1, FieldMemOperand(v0, HeapObject::kMapOffset));
2282 __ sd(a4, FieldMemOperand(v0, JSObject::kPropertiesOffset)); 2285 __ sd(a4, FieldMemOperand(v0, JSObject::kPropertiesOffset));
2283 __ sd(a4, FieldMemOperand(v0, JSObject::kElementsOffset)); 2286 __ sd(a4, FieldMemOperand(v0, JSObject::kElementsOffset));
2284 __ sd(a2, 2287 __ sd(a2,
2285 FieldMemOperand(v0, JSGeneratorObject::kResultValuePropertyOffset)); 2288 FieldMemOperand(v0, JSGeneratorObject::kResultValuePropertyOffset));
2286 __ sd(a3, 2289 __ sd(a3,
2287 FieldMemOperand(v0, JSGeneratorObject::kResultDonePropertyOffset)); 2290 FieldMemOperand(v0, JSGeneratorObject::kResultDonePropertyOffset));
2288 2291
2289 // Only the value field needs a write barrier, as the other values are in the 2292 // Only the value field needs a write barrier, as the other values are in the
2290 // root set. 2293 // root set.
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after
2762 // by the vector above. 2765 // by the vector above.
2763 CallIC(ic); 2766 CallIC(ic);
2764 RecordJSReturnSite(expr); 2767 RecordJSReturnSite(expr);
2765 // Restore context register. 2768 // Restore context register.
2766 __ ld(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); 2769 __ ld(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
2767 context()->DropAndPlug(1, v0); 2770 context()->DropAndPlug(1, v0);
2768 } 2771 }
2769 2772
2770 2773
2771 void FullCodeGenerator::EmitResolvePossiblyDirectEval(int arg_count) { 2774 void FullCodeGenerator::EmitResolvePossiblyDirectEval(int arg_count) {
2772 // a6: copy of the first argument or undefined if it doesn't exist. 2775 // a7: copy of the first argument or undefined if it doesn't exist.
2773 if (arg_count > 0) { 2776 if (arg_count > 0) {
2774 __ ld(a6, MemOperand(sp, arg_count * kPointerSize)); 2777 __ ld(a7, MemOperand(sp, arg_count * kPointerSize));
2775 } else { 2778 } else {
2776 __ LoadRoot(a6, Heap::kUndefinedValueRootIndex); 2779 __ LoadRoot(a7, Heap::kUndefinedValueRootIndex);
2777 } 2780 }
2778 2781
2782 // a6: the receiver of the enclosing function.
2783 __ ld(a6, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
2784
2779 // a5: the receiver of the enclosing function. 2785 // a5: the receiver of the enclosing function.
2780 int receiver_offset = 2 + info_->scope()->num_parameters(); 2786 int receiver_offset = 2 + info_->scope()->num_parameters();
2781 __ ld(a5, MemOperand(fp, receiver_offset * kPointerSize)); 2787 __ ld(a5, MemOperand(fp, receiver_offset * kPointerSize));
2782 2788
2783 // a4: the strict mode. 2789 // a4: the strict mode.
2784 __ li(a4, Operand(Smi::FromInt(strict_mode()))); 2790 __ li(a4, Operand(Smi::FromInt(strict_mode())));
2785 2791
2786 // a1: the start position of the scope the calls resides in. 2792 // a1: the start position of the scope the calls resides in.
2787 __ li(a1, Operand(Smi::FromInt(scope()->start_position()))); 2793 __ li(a1, Operand(Smi::FromInt(scope()->start_position())));
2788 2794
2789 // Do the runtime call. 2795 // Do the runtime call.
2796 __ Push(a7);
2790 __ Push(a6, a5, a4, a1); 2797 __ Push(a6, a5, a4, a1);
2791 __ CallRuntime(Runtime::kResolvePossiblyDirectEval, 5); 2798 __ CallRuntime(Runtime::kResolvePossiblyDirectEval, 6);
2792 } 2799 }
2793 2800
2794 2801
2795 void FullCodeGenerator::VisitCall(Call* expr) { 2802 void FullCodeGenerator::VisitCall(Call* expr) {
2796 #ifdef DEBUG 2803 #ifdef DEBUG
2797 // We want to verify that RecordJSReturnSite gets called on all paths 2804 // We want to verify that RecordJSReturnSite gets called on all paths
2798 // through this function. Avoid early returns. 2805 // through this function. Avoid early returns.
2799 expr->return_is_recorded_ = false; 2806 expr->return_is_recorded_ = false;
2800 #endif 2807 #endif
2801 2808
(...skipping 2159 matching lines...) Expand 10 before | Expand all | Expand 10 after
4961 Assembler::target_address_at(pc_immediate_load_address)) == 4968 Assembler::target_address_at(pc_immediate_load_address)) ==
4962 reinterpret_cast<uint64_t>( 4969 reinterpret_cast<uint64_t>(
4963 isolate->builtins()->OsrAfterStackCheck()->entry())); 4970 isolate->builtins()->OsrAfterStackCheck()->entry()));
4964 return OSR_AFTER_STACK_CHECK; 4971 return OSR_AFTER_STACK_CHECK;
4965 } 4972 }
4966 4973
4967 4974
4968 } } // namespace v8::internal 4975 } } // namespace v8::internal
4969 4976
4970 #endif // V8_TARGET_ARCH_MIPS64 4977 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/mips/full-codegen-mips.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698