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/runtime.cc

Issue 77293003: Addressed perf regression in Browsermark2.0 array blur test (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Reduced 10% to 3% degrade, removed special case. Created 7 years 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
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 536 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 547
548 literals->set(literals_index, *site); 548 literals->set(literals_index, *site);
549 } else { 549 } else {
550 site = Handle<AllocationSite>::cast(literal_site); 550 site = Handle<AllocationSite>::cast(literal_site);
551 } 551 }
552 552
553 return site; 553 return site;
554 } 554 }
555 555
556 556
557 static MaybeObject* CreateArrayLiteralImpl(Isolate* isolate,
558 Handle<FixedArray> literals,
559 int literals_index,
560 Handle<FixedArray> elements,
561 int flags) {
562 Handle<AllocationSite> site = GetLiteralAllocationSite(isolate, literals,
563 literals_index, elements);
564 RETURN_IF_EMPTY_HANDLE(isolate, site);
565
566 bool enable_mementos = (flags & ArrayLiteral::kDisableMementos) == 0;
567 bool is_shallow = (flags & ArrayLiteral::kShallowElements) != 0;
568
569 Handle<JSObject> boilerplate(JSObject::cast(site->transition_info()));
570 AllocationSiteUsageContext usage_context(isolate, site, enable_mementos);
571 usage_context.EnterNewScope();
572 Handle<JSObject> copy = JSObject::DeepCopy(boilerplate, &usage_context,
573 is_shallow);
574 usage_context.ExitScope(site, boilerplate);
575 RETURN_IF_EMPTY_HANDLE(isolate, copy);
576 return *copy;
577 }
578
579
557 RUNTIME_FUNCTION(MaybeObject*, Runtime_CreateArrayLiteral) { 580 RUNTIME_FUNCTION(MaybeObject*, Runtime_CreateArrayLiteral) {
558 HandleScope scope(isolate); 581 HandleScope scope(isolate);
582 ASSERT(args.length() == 4);
583 CONVERT_ARG_HANDLE_CHECKED(FixedArray, literals, 0);
584 CONVERT_SMI_ARG_CHECKED(literals_index, 1);
585 CONVERT_ARG_HANDLE_CHECKED(FixedArray, elements, 2);
586 CONVERT_SMI_ARG_CHECKED(flags, 3);
587
588 return CreateArrayLiteralImpl(isolate, literals, literals_index, elements,
589 flags);
590 }
591
592
593 RUNTIME_FUNCTION(MaybeObject*, Runtime_CreateArrayLiteralStubBailout) {
594 HandleScope scope(isolate);
559 ASSERT(args.length() == 3); 595 ASSERT(args.length() == 3);
560 CONVERT_ARG_HANDLE_CHECKED(FixedArray, literals, 0); 596 CONVERT_ARG_HANDLE_CHECKED(FixedArray, literals, 0);
561 CONVERT_SMI_ARG_CHECKED(literals_index, 1); 597 CONVERT_SMI_ARG_CHECKED(literals_index, 1);
562 CONVERT_ARG_HANDLE_CHECKED(FixedArray, elements, 2); 598 CONVERT_ARG_HANDLE_CHECKED(FixedArray, elements, 2);
563 599
564 Handle<AllocationSite> site = GetLiteralAllocationSite(isolate, literals, 600 return CreateArrayLiteralImpl(isolate, literals, literals_index, elements,
565 literals_index, elements); 601 ArrayLiteral::kShallowElements);
566 RETURN_IF_EMPTY_HANDLE(isolate, site);
567
568 Handle<JSObject> boilerplate(JSObject::cast(site->transition_info()));
569 AllocationSiteUsageContext usage_context(isolate, site, true);
570 usage_context.EnterNewScope();
571 Handle<JSObject> copy = JSObject::DeepCopy(boilerplate, &usage_context);
572 usage_context.ExitScope(site, boilerplate);
573 RETURN_IF_EMPTY_HANDLE(isolate, copy);
574 return *copy;
575 } 602 }
576 603
577 604
578 RUNTIME_FUNCTION(MaybeObject*, Runtime_CreateSymbol) { 605 RUNTIME_FUNCTION(MaybeObject*, Runtime_CreateSymbol) {
579 HandleScope scope(isolate); 606 HandleScope scope(isolate);
580 ASSERT(args.length() == 1); 607 ASSERT(args.length() == 1);
581 Handle<Object> name(args[0], isolate); 608 Handle<Object> name(args[0], isolate);
582 RUNTIME_ASSERT(name->IsString() || name->IsUndefined()); 609 RUNTIME_ASSERT(name->IsString() || name->IsUndefined());
583 Symbol* symbol; 610 Symbol* symbol;
584 MaybeObject* maybe = isolate->heap()->AllocateSymbol(); 611 MaybeObject* maybe = isolate->heap()->AllocateSymbol();
(...skipping 14332 matching lines...) Expand 10 before | Expand all | Expand 10 after
14917 // Handle last resort GC and make sure to allow future allocations 14944 // Handle last resort GC and make sure to allow future allocations
14918 // to grow the heap without causing GCs (if possible). 14945 // to grow the heap without causing GCs (if possible).
14919 isolate->counters()->gc_last_resort_from_js()->Increment(); 14946 isolate->counters()->gc_last_resort_from_js()->Increment();
14920 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, 14947 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags,
14921 "Runtime::PerformGC"); 14948 "Runtime::PerformGC");
14922 } 14949 }
14923 } 14950 }
14924 14951
14925 14952
14926 } } // namespace v8::internal 14953 } } // namespace v8::internal
OLDNEW
« src/objects.h ('K') | « src/runtime.h ('k') | test/mjsunit/array-literal-feedback.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698