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

Unified Diff: runtime/vm/parser.cc

Issue 10786003: Ensure objects emitted in code are allocated in old space. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: address review comments Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/object_x64_test.cc ('k') | runtime/vm/stub_code_ia32_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
diff --git a/runtime/vm/parser.cc b/runtime/vm/parser.cc
index 8f9301e8067cd5a1a8cb90dce18139723d520b90..fa4ef4d941aa849cb6512095679a512edaa2366c 100644
--- a/runtime/vm/parser.cc
+++ b/runtime/vm/parser.cc
@@ -106,8 +106,14 @@ static RawTypeArguments* NewTypeArguments(const GrowableObjectArray& objs) {
static ThrowNode* GenerateRethrow(intptr_t token_pos, const Object& obj) {
const UnhandledException& excp = UnhandledException::Cast(obj);
- const Instance& exception = Instance::ZoneHandle(excp.exception());
- const Instance& stack_trace = Instance::ZoneHandle(excp.stacktrace());
+ Instance& exception = Instance::ZoneHandle(excp.exception());
+ if (exception.IsNew()) {
+ exception ^= Object::Clone(exception, Heap::kOld);
+ }
+ Instance& stack_trace = Instance::ZoneHandle(excp.stacktrace());
+ if (stack_trace.IsNew()) {
+ stack_trace ^= Object::Clone(stack_trace, Heap::kOld);
+ }
return new ThrowNode(token_pos,
new LiteralNode(token_pos, exception),
new LiteralNode(token_pos, stack_trace));
@@ -7044,7 +7050,7 @@ RawObject* Parser::EvaluateConstConstructorCall(
GrowableArray<const Object*> arg_values(arguments->length() + 2);
Instance& instance = Instance::Handle();
if (!constructor.IsFactory()) {
- instance = Instance::New(type_class);
+ instance = Instance::New(type_class, Heap::kOld);
if (!type_arguments.IsNull()) {
if (!type_arguments.IsInstantiated()) {
ErrorMsg("type must be constant in const constructor");
« no previous file with comments | « runtime/vm/object_x64_test.cc ('k') | runtime/vm/stub_code_ia32_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698