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

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

Issue 10878047: Revert to code state of 3.13.1 plus r12350 (Closed) Base URL: https://v8.googlecode.com/svn/trunk
Patch Set: Created 8 years, 4 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/mips/deoptimizer-mips.cc ('k') | src/mips/lithium-codegen-mips.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 1304 matching lines...) Expand 10 before | Expand all | Expand 10 after
1315 if (!s->outer_scope_calls_non_strict_eval() || s->is_eval_scope()) break; 1315 if (!s->outer_scope_calls_non_strict_eval() || s->is_eval_scope()) break;
1316 s = s->outer_scope(); 1316 s = s->outer_scope();
1317 } 1317 }
1318 1318
1319 if (s->is_eval_scope()) { 1319 if (s->is_eval_scope()) {
1320 Label loop, fast; 1320 Label loop, fast;
1321 if (!current.is(next)) { 1321 if (!current.is(next)) {
1322 __ Move(next, current); 1322 __ Move(next, current);
1323 } 1323 }
1324 __ bind(&loop); 1324 __ bind(&loop);
1325 // Terminate at native context. 1325 // Terminate at global context.
1326 __ lw(temp, FieldMemOperand(next, HeapObject::kMapOffset)); 1326 __ lw(temp, FieldMemOperand(next, HeapObject::kMapOffset));
1327 __ LoadRoot(t0, Heap::kNativeContextMapRootIndex); 1327 __ LoadRoot(t0, Heap::kGlobalContextMapRootIndex);
1328 __ Branch(&fast, eq, temp, Operand(t0)); 1328 __ Branch(&fast, eq, temp, Operand(t0));
1329 // Check that extension is NULL. 1329 // Check that extension is NULL.
1330 __ lw(temp, ContextOperand(next, Context::EXTENSION_INDEX)); 1330 __ lw(temp, ContextOperand(next, Context::EXTENSION_INDEX));
1331 __ Branch(slow, ne, temp, Operand(zero_reg)); 1331 __ Branch(slow, ne, temp, Operand(zero_reg));
1332 // Load next context in chain. 1332 // Load next context in chain.
1333 __ lw(next, ContextOperand(next, Context::PREVIOUS_INDEX)); 1333 __ lw(next, ContextOperand(next, Context::PREVIOUS_INDEX));
1334 __ Branch(&loop); 1334 __ Branch(&loop);
1335 __ bind(&fast); 1335 __ bind(&fast);
1336 } 1336 }
1337 1337
(...skipping 1443 matching lines...) Expand 10 before | Expand all | Expand 10 after
2781 __ Branch(if_false, eq, a3, Operand(t2)); 2781 __ Branch(if_false, eq, a3, Operand(t2));
2782 __ Addu(t0, t0, Operand(kPointerSize)); 2782 __ Addu(t0, t0, Operand(kPointerSize));
2783 __ bind(&entry); 2783 __ bind(&entry);
2784 __ Branch(&loop, ne, t0, Operand(a2)); 2784 __ Branch(&loop, ne, t0, Operand(a2));
2785 2785
2786 // If a valueOf property is not found on the object check that it's 2786 // If a valueOf property is not found on the object check that it's
2787 // prototype is the un-modified String prototype. If not result is false. 2787 // prototype is the un-modified String prototype. If not result is false.
2788 __ lw(a2, FieldMemOperand(a1, Map::kPrototypeOffset)); 2788 __ lw(a2, FieldMemOperand(a1, Map::kPrototypeOffset));
2789 __ JumpIfSmi(a2, if_false); 2789 __ JumpIfSmi(a2, if_false);
2790 __ lw(a2, FieldMemOperand(a2, HeapObject::kMapOffset)); 2790 __ lw(a2, FieldMemOperand(a2, HeapObject::kMapOffset));
2791 __ lw(a3, ContextOperand(cp, Context::GLOBAL_OBJECT_INDEX)); 2791 __ lw(a3, ContextOperand(cp, Context::GLOBAL_INDEX));
2792 __ lw(a3, FieldMemOperand(a3, GlobalObject::kNativeContextOffset)); 2792 __ lw(a3, FieldMemOperand(a3, GlobalObject::kGlobalContextOffset));
2793 __ lw(a3, ContextOperand(a3, Context::STRING_FUNCTION_PROTOTYPE_MAP_INDEX)); 2793 __ lw(a3, ContextOperand(a3, Context::STRING_FUNCTION_PROTOTYPE_MAP_INDEX));
2794 __ Branch(if_false, ne, a2, Operand(a3)); 2794 __ Branch(if_false, ne, a2, Operand(a3));
2795 2795
2796 // Set the bit in the map to indicate that it has been checked safe for 2796 // Set the bit in the map to indicate that it has been checked safe for
2797 // default valueOf and set true result. 2797 // default valueOf and set true result.
2798 __ lbu(a2, FieldMemOperand(a1, Map::kBitField2Offset)); 2798 __ lbu(a2, FieldMemOperand(a1, Map::kBitField2Offset));
2799 __ Or(a2, a2, Operand(1 << Map::kStringWrapperSafeForDefaultValueOf)); 2799 __ Or(a2, a2, Operand(1 << Map::kStringWrapperSafeForDefaultValueOf));
2800 __ sb(a2, FieldMemOperand(a1, Map::kBitField2Offset)); 2800 __ sb(a2, FieldMemOperand(a1, Map::kBitField2Offset));
2801 __ jmp(if_true); 2801 __ jmp(if_true);
2802 2802
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
3062 __ CallRuntime(Runtime::kNumberAlloc, 0); 3062 __ CallRuntime(Runtime::kNumberAlloc, 0);
3063 __ mov(s0, v0); // Save result in s0, so it is saved thru CFunc call. 3063 __ mov(s0, v0); // Save result in s0, so it is saved thru CFunc call.
3064 3064
3065 __ bind(&heapnumber_allocated); 3065 __ bind(&heapnumber_allocated);
3066 3066
3067 // Convert 32 random bits in v0 to 0.(32 random bits) in a double 3067 // Convert 32 random bits in v0 to 0.(32 random bits) in a double
3068 // by computing: 3068 // by computing:
3069 // ( 1.(20 0s)(32 random bits) x 2^20 ) - (1.0 x 2^20)). 3069 // ( 1.(20 0s)(32 random bits) x 2^20 ) - (1.0 x 2^20)).
3070 if (CpuFeatures::IsSupported(FPU)) { 3070 if (CpuFeatures::IsSupported(FPU)) {
3071 __ PrepareCallCFunction(1, a0); 3071 __ PrepareCallCFunction(1, a0);
3072 __ lw(a0, ContextOperand(cp, Context::GLOBAL_OBJECT_INDEX)); 3072 __ lw(a0, ContextOperand(cp, Context::GLOBAL_INDEX));
3073 __ lw(a0, FieldMemOperand(a0, GlobalObject::kNativeContextOffset)); 3073 __ lw(a0, FieldMemOperand(a0, GlobalObject::kGlobalContextOffset));
3074 __ CallCFunction(ExternalReference::random_uint32_function(isolate()), 1); 3074 __ CallCFunction(ExternalReference::random_uint32_function(isolate()), 1);
3075 3075
3076 CpuFeatures::Scope scope(FPU); 3076 CpuFeatures::Scope scope(FPU);
3077 // 0x41300000 is the top half of 1.0 x 2^20 as a double. 3077 // 0x41300000 is the top half of 1.0 x 2^20 as a double.
3078 __ li(a1, Operand(0x41300000)); 3078 __ li(a1, Operand(0x41300000));
3079 // Move 0x41300000xxxxxxxx (x = random bits in v0) to FPU. 3079 // Move 0x41300000xxxxxxxx (x = random bits in v0) to FPU.
3080 __ Move(f12, v0, a1); 3080 __ Move(f12, v0, a1);
3081 // Move 0x4130000000000000 to FPU. 3081 // Move 0x4130000000000000 to FPU.
3082 __ Move(f14, zero_reg, a1); 3082 __ Move(f14, zero_reg, a1);
3083 // Subtract and store the result in the heap number. 3083 // Subtract and store the result in the heap number.
3084 __ sub_d(f0, f12, f14); 3084 __ sub_d(f0, f12, f14);
3085 __ sdc1(f0, FieldMemOperand(s0, HeapNumber::kValueOffset)); 3085 __ sdc1(f0, FieldMemOperand(s0, HeapNumber::kValueOffset));
3086 __ mov(v0, s0); 3086 __ mov(v0, s0);
3087 } else { 3087 } else {
3088 __ PrepareCallCFunction(2, a0); 3088 __ PrepareCallCFunction(2, a0);
3089 __ mov(a0, s0); 3089 __ mov(a0, s0);
3090 __ lw(a1, ContextOperand(cp, Context::GLOBAL_OBJECT_INDEX)); 3090 __ lw(a1, ContextOperand(cp, Context::GLOBAL_INDEX));
3091 __ lw(a1, FieldMemOperand(a1, GlobalObject::kNativeContextOffset)); 3091 __ lw(a1, FieldMemOperand(a1, GlobalObject::kGlobalContextOffset));
3092 __ CallCFunction( 3092 __ CallCFunction(
3093 ExternalReference::fill_heap_number_with_random_function(isolate()), 2); 3093 ExternalReference::fill_heap_number_with_random_function(isolate()), 2);
3094 } 3094 }
3095 3095
3096 context()->Plug(v0); 3096 context()->Plug(v0);
3097 } 3097 }
3098 3098
3099 3099
3100 void FullCodeGenerator::EmitSubString(CallRuntime* expr) { 3100 void FullCodeGenerator::EmitSubString(CallRuntime* expr) {
3101 // Load the arguments on the stack and call the stub. 3101 // Load the arguments on the stack and call the stub.
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
3496 3496
3497 3497
3498 void FullCodeGenerator::EmitGetFromCache(CallRuntime* expr) { 3498 void FullCodeGenerator::EmitGetFromCache(CallRuntime* expr) {
3499 ZoneList<Expression*>* args = expr->arguments(); 3499 ZoneList<Expression*>* args = expr->arguments();
3500 ASSERT_EQ(2, args->length()); 3500 ASSERT_EQ(2, args->length());
3501 3501
3502 ASSERT_NE(NULL, args->at(0)->AsLiteral()); 3502 ASSERT_NE(NULL, args->at(0)->AsLiteral());
3503 int cache_id = Smi::cast(*(args->at(0)->AsLiteral()->handle()))->value(); 3503 int cache_id = Smi::cast(*(args->at(0)->AsLiteral()->handle()))->value();
3504 3504
3505 Handle<FixedArray> jsfunction_result_caches( 3505 Handle<FixedArray> jsfunction_result_caches(
3506 isolate()->native_context()->jsfunction_result_caches()); 3506 isolate()->global_context()->jsfunction_result_caches());
3507 if (jsfunction_result_caches->length() <= cache_id) { 3507 if (jsfunction_result_caches->length() <= cache_id) {
3508 __ Abort("Attempt to use undefined cache."); 3508 __ Abort("Attempt to use undefined cache.");
3509 __ LoadRoot(v0, Heap::kUndefinedValueRootIndex); 3509 __ LoadRoot(v0, Heap::kUndefinedValueRootIndex);
3510 context()->Plug(v0); 3510 context()->Plug(v0);
3511 return; 3511 return;
3512 } 3512 }
3513 3513
3514 VisitForAccumulatorValue(args->at(1)); 3514 VisitForAccumulatorValue(args->at(1));
3515 3515
3516 Register key = v0; 3516 Register key = v0;
3517 Register cache = a1; 3517 Register cache = a1;
3518 __ lw(cache, ContextOperand(cp, Context::GLOBAL_OBJECT_INDEX)); 3518 __ lw(cache, ContextOperand(cp, Context::GLOBAL_INDEX));
3519 __ lw(cache, FieldMemOperand(cache, GlobalObject::kNativeContextOffset)); 3519 __ lw(cache, FieldMemOperand(cache, GlobalObject::kGlobalContextOffset));
3520 __ lw(cache, 3520 __ lw(cache,
3521 ContextOperand( 3521 ContextOperand(
3522 cache, Context::JSFUNCTION_RESULT_CACHES_INDEX)); 3522 cache, Context::JSFUNCTION_RESULT_CACHES_INDEX));
3523 __ lw(cache, 3523 __ lw(cache,
3524 FieldMemOperand(cache, FixedArray::OffsetOfElementAt(cache_id))); 3524 FieldMemOperand(cache, FixedArray::OffsetOfElementAt(cache_id)));
3525 3525
3526 3526
3527 Label done, not_found; 3527 Label done, not_found;
3528 STATIC_ASSERT(kSmiTag == 0 && kSmiTagSize == 1); 3528 STATIC_ASSERT(kSmiTag == 0 && kSmiTagSize == 1);
3529 __ lw(a2, FieldMemOperand(cache, JSFunctionResultCache::kFingerOffset)); 3529 __ lw(a2, FieldMemOperand(cache, JSFunctionResultCache::kFingerOffset));
(...skipping 958 matching lines...) Expand 10 before | Expand all | Expand 10 after
4488 4488
4489 void FullCodeGenerator::LoadContextField(Register dst, int context_index) { 4489 void FullCodeGenerator::LoadContextField(Register dst, int context_index) {
4490 __ lw(dst, ContextOperand(cp, context_index)); 4490 __ lw(dst, ContextOperand(cp, context_index));
4491 } 4491 }
4492 4492
4493 4493
4494 void FullCodeGenerator::PushFunctionArgumentForContextAllocation() { 4494 void FullCodeGenerator::PushFunctionArgumentForContextAllocation() {
4495 Scope* declaration_scope = scope()->DeclarationScope(); 4495 Scope* declaration_scope = scope()->DeclarationScope();
4496 if (declaration_scope->is_global_scope() || 4496 if (declaration_scope->is_global_scope() ||
4497 declaration_scope->is_module_scope()) { 4497 declaration_scope->is_module_scope()) {
4498 // Contexts nested in the native context have a canonical empty function 4498 // Contexts nested in the global context have a canonical empty function
4499 // as their closure, not the anonymous closure containing the global 4499 // as their closure, not the anonymous closure containing the global
4500 // code. Pass a smi sentinel and let the runtime look up the empty 4500 // code. Pass a smi sentinel and let the runtime look up the empty
4501 // function. 4501 // function.
4502 __ li(at, Operand(Smi::FromInt(0))); 4502 __ li(at, Operand(Smi::FromInt(0)));
4503 } else if (declaration_scope->is_eval_scope()) { 4503 } else if (declaration_scope->is_eval_scope()) {
4504 // Contexts created by a call to eval have the same closure as the 4504 // Contexts created by a call to eval have the same closure as the
4505 // context calling eval, not the anonymous closure containing the eval 4505 // context calling eval, not the anonymous closure containing the eval
4506 // code. Fetch it from the context. 4506 // code. Fetch it from the context.
4507 __ lw(at, ContextOperand(cp, Context::CLOSURE_INDEX)); 4507 __ lw(at, ContextOperand(cp, Context::CLOSURE_INDEX));
4508 } else { 4508 } else {
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
4611 *context_length = 0; 4611 *context_length = 0;
4612 return previous_; 4612 return previous_;
4613 } 4613 }
4614 4614
4615 4615
4616 #undef __ 4616 #undef __
4617 4617
4618 } } // namespace v8::internal 4618 } } // namespace v8::internal
4619 4619
4620 #endif // V8_TARGET_ARCH_MIPS 4620 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/mips/deoptimizer-mips.cc ('k') | src/mips/lithium-codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698