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

Side by Side Diff: src/arm/codegen-arm.cc

Issue 1731002: Don't share function result caches between contexts. (Closed)
Patch Set: Review fixes Created 10 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
« no previous file with comments | « no previous file | src/ia32/codegen-ia32.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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 4442 matching lines...) Expand 10 before | Expand all | Expand 10 after
4453 int cache_id = Smi::cast(*(args->at(0)->AsLiteral()->handle()))->value(); 4453 int cache_id = Smi::cast(*(args->at(0)->AsLiteral()->handle()))->value();
4454 4454
4455 Handle<FixedArray> jsfunction_result_caches( 4455 Handle<FixedArray> jsfunction_result_caches(
4456 Top::global_context()->jsfunction_result_caches()); 4456 Top::global_context()->jsfunction_result_caches());
4457 if (jsfunction_result_caches->length() <= cache_id) { 4457 if (jsfunction_result_caches->length() <= cache_id) {
4458 __ Abort("Attempt to use undefined cache."); 4458 __ Abort("Attempt to use undefined cache.");
4459 __ LoadRoot(r0, Heap::kUndefinedValueRootIndex); 4459 __ LoadRoot(r0, Heap::kUndefinedValueRootIndex);
4460 frame_->EmitPush(r0); 4460 frame_->EmitPush(r0);
4461 return; 4461 return;
4462 } 4462 }
4463 Handle<FixedArray> cache_obj(
4464 FixedArray::cast(jsfunction_result_caches->get(cache_id)));
4465 4463
4466 Load(args->at(1)); 4464 Load(args->at(1));
4467 frame_->EmitPop(r2); 4465 frame_->EmitPop(r2);
4468 4466
4467 __ ldr(r1, ContextOperand(cp, Context::GLOBAL_INDEX));
4468 __ ldr(r1, FieldMemOperand(r1, GlobalObject::kGlobalContextOffset));
4469 __ ldr(r1, ContextOperand(r1, Context::JSFUNCTION_RESULT_CACHES_INDEX));
4470 __ ldr(r1, FieldMemOperand(r1, FixedArray::OffsetOfElementAt(cache_id)));
4471
4469 DeferredSearchCache* deferred = new DeferredSearchCache(r0, r1, r2); 4472 DeferredSearchCache* deferred = new DeferredSearchCache(r0, r1, r2);
4470 4473
4471 const int kFingerOffset = 4474 const int kFingerOffset =
4472 FixedArray::OffsetOfElementAt(JSFunctionResultCache::kFingerIndex); 4475 FixedArray::OffsetOfElementAt(JSFunctionResultCache::kFingerIndex);
4473 ASSERT(kSmiTag == 0 && kSmiTagSize == 1); 4476 ASSERT(kSmiTag == 0 && kSmiTagSize == 1);
4474 __ mov(r1, Operand(cache_obj));
4475 __ ldr(r0, FieldMemOperand(r1, kFingerOffset)); 4477 __ ldr(r0, FieldMemOperand(r1, kFingerOffset));
4476 // r0 now holds finger offset as a smi. 4478 // r0 now holds finger offset as a smi.
4477 __ add(r3, r1, Operand(FixedArray::kHeaderSize - kHeapObjectTag)); 4479 __ add(r3, r1, Operand(FixedArray::kHeaderSize - kHeapObjectTag));
4478 // r3 now points to the start of fixed array elements. 4480 // r3 now points to the start of fixed array elements.
4479 __ ldr(r0, MemOperand(r3, r0, LSL, kPointerSizeLog2 - kSmiTagSize, PreIndex)); 4481 __ ldr(r0, MemOperand(r3, r0, LSL, kPointerSizeLog2 - kSmiTagSize, PreIndex));
4480 // Note side effect of PreIndex: r3 now points to the key of the pair. 4482 // Note side effect of PreIndex: r3 now points to the key of the pair.
4481 __ cmp(r2, r0); 4483 __ cmp(r2, r0);
4482 deferred->Branch(ne); 4484 deferred->Branch(ne);
4483 4485
4484 __ ldr(r0, MemOperand(r3, kPointerSize)); 4486 __ ldr(r0, MemOperand(r3, kPointerSize));
(...skipping 4852 matching lines...) Expand 10 before | Expand all | Expand 10 after
9337 9339
9338 // Just jump to runtime to add the two strings. 9340 // Just jump to runtime to add the two strings.
9339 __ bind(&string_add_runtime); 9341 __ bind(&string_add_runtime);
9340 __ TailCallRuntime(Runtime::kStringAdd, 2, 1); 9342 __ TailCallRuntime(Runtime::kStringAdd, 2, 1);
9341 } 9343 }
9342 9344
9343 9345
9344 #undef __ 9346 #undef __
9345 9347
9346 } } // namespace v8::internal 9348 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/ia32/codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698