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

Side by Side Diff: src/runtime.cc

Issue 14158006: Capture receiver in generator object (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Rebase on master, fix for ARM Created 7 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 | « src/objects-inl.h ('k') | src/x64/full-codegen-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 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 2395 matching lines...) Expand 10 before | Expand all | Expand 10 after
2406 JSGeneratorObject* generator; 2406 JSGeneratorObject* generator;
2407 if (frame->IsConstructor()) { 2407 if (frame->IsConstructor()) {
2408 generator = JSGeneratorObject::cast(frame->receiver()); 2408 generator = JSGeneratorObject::cast(frame->receiver());
2409 } else { 2409 } else {
2410 MaybeObject* maybe_generator = 2410 MaybeObject* maybe_generator =
2411 isolate->heap()->AllocateJSGeneratorObject(function); 2411 isolate->heap()->AllocateJSGeneratorObject(function);
2412 if (!maybe_generator->To(&generator)) return maybe_generator; 2412 if (!maybe_generator->To(&generator)) return maybe_generator;
2413 } 2413 }
2414 generator->set_function(function); 2414 generator->set_function(function);
2415 generator->set_context(Context::cast(frame->context())); 2415 generator->set_context(Context::cast(frame->context()));
2416 generator->set_receiver(frame->receiver());
2416 generator->set_continuation(0); 2417 generator->set_continuation(0);
2417 generator->set_operand_stack(isolate->heap()->empty_fixed_array()); 2418 generator->set_operand_stack(isolate->heap()->empty_fixed_array());
2418 2419
2419 return generator; 2420 return generator;
2420 } 2421 }
2421 2422
2422 2423
2423 RUNTIME_FUNCTION(MaybeObject*, Runtime_SuspendJSGeneratorObject) { 2424 RUNTIME_FUNCTION(MaybeObject*, Runtime_SuspendJSGeneratorObject) {
2424 HandleScope scope(isolate); 2425 HandleScope scope(isolate);
2425 ASSERT(args.length() == 1); 2426 ASSERT(args.length() == 1);
(...skipping 10924 matching lines...) Expand 10 before | Expand all | Expand 10 after
13350 // Handle last resort GC and make sure to allow future allocations 13351 // Handle last resort GC and make sure to allow future allocations
13351 // to grow the heap without causing GCs (if possible). 13352 // to grow the heap without causing GCs (if possible).
13352 isolate->counters()->gc_last_resort_from_js()->Increment(); 13353 isolate->counters()->gc_last_resort_from_js()->Increment();
13353 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, 13354 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags,
13354 "Runtime::PerformGC"); 13355 "Runtime::PerformGC");
13355 } 13356 }
13356 } 13357 }
13357 13358
13358 13359
13359 } } // namespace v8::internal 13360 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects-inl.h ('k') | src/x64/full-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698