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

Issue 24302009: Correctly check for AllowHeapAllocation::IsAllowed(). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 2 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 | « no previous file | src/heap-inl.h » ('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 4364 matching lines...) Expand 10 before | Expand all | Expand 10 after
4375 boilerplate = 4375 boilerplate =
4376 isolate()->context()->native_context()-> 4376 isolate()->context()->native_context()->
4377 strict_mode_arguments_boilerplate(); 4377 strict_mode_arguments_boilerplate();
4378 arguments_object_size = kArgumentsObjectSizeStrict; 4378 arguments_object_size = kArgumentsObjectSizeStrict;
4379 } else { 4379 } else {
4380 boilerplate = 4380 boilerplate =
4381 isolate()->context()->native_context()->arguments_boilerplate(); 4381 isolate()->context()->native_context()->arguments_boilerplate();
4382 arguments_object_size = kArgumentsObjectSize; 4382 arguments_object_size = kArgumentsObjectSize;
4383 } 4383 }
4384 4384
4385 // This calls Copy directly rather than using Heap::AllocateRaw so we
4386 // duplicate the check here.
4387 ASSERT(AllowHeapAllocation::IsAllowed() && gc_state_ == NOT_IN_GC);
4388
4389 // Check that the size of the boilerplate matches our 4385 // Check that the size of the boilerplate matches our
4390 // expectations. The ArgumentsAccessStub::GenerateNewObject relies 4386 // expectations. The ArgumentsAccessStub::GenerateNewObject relies
4391 // on the size being a known constant. 4387 // on the size being a known constant.
4392 ASSERT(arguments_object_size == boilerplate->map()->instance_size()); 4388 ASSERT(arguments_object_size == boilerplate->map()->instance_size());
4393 4389
4394 // Do the allocation. 4390 // Do the allocation.
4395 Object* result; 4391 Object* result;
4396 { MaybeObject* maybe_result = 4392 { MaybeObject* maybe_result =
4397 AllocateRaw(arguments_object_size, NEW_SPACE, OLD_POINTER_SPACE); 4393 AllocateRaw(arguments_object_size, NEW_SPACE, OLD_POINTER_SPACE);
4398 if (!maybe_result->ToObject(&result)) return maybe_result; 4394 if (!maybe_result->ToObject(&result)) return maybe_result;
(...skipping 3500 matching lines...) Expand 10 before | Expand all | Expand 10 after
7899 if (FLAG_concurrent_recompilation) { 7895 if (FLAG_concurrent_recompilation) {
7900 heap_->relocation_mutex_->Lock(); 7896 heap_->relocation_mutex_->Lock();
7901 #ifdef DEBUG 7897 #ifdef DEBUG
7902 heap_->relocation_mutex_locked_by_optimizer_thread_ = 7898 heap_->relocation_mutex_locked_by_optimizer_thread_ =
7903 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread(); 7899 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread();
7904 #endif // DEBUG 7900 #endif // DEBUG
7905 } 7901 }
7906 } 7902 }
7907 7903
7908 } } // namespace v8::internal 7904 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/heap-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698