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

Side by Side Diff: src/builtins.cc

Issue 198253004: Introduce per-isolate assert scopes and API to guard JS execution. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: add missing file Created 6 years, 9 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
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 1629 matching lines...) Expand 10 before | Expand all | Expand 10 after
1640 ASSERT(!masm.has_frame()); 1640 ASSERT(!masm.has_frame());
1641 g(&masm, functions[i].name, functions[i].extra_args); 1641 g(&masm, functions[i].name, functions[i].extra_args);
1642 // Move the code into the object heap. 1642 // Move the code into the object heap.
1643 CodeDesc desc; 1643 CodeDesc desc;
1644 masm.GetCode(&desc); 1644 masm.GetCode(&desc);
1645 Code::Flags flags = functions[i].flags; 1645 Code::Flags flags = functions[i].flags;
1646 Object* code = NULL; 1646 Object* code = NULL;
1647 { 1647 {
1648 // During startup it's OK to always allocate and defer GC to later. 1648 // During startup it's OK to always allocate and defer GC to later.
1649 // This simplifies things because we don't need to retry. 1649 // This simplifies things because we don't need to retry.
1650 AlwaysAllocateScope __scope__; 1650 AlwaysAllocateScope __scope__(isolate);
1651 { MaybeObject* maybe_code = 1651 { MaybeObject* maybe_code =
1652 heap->CreateCode(desc, flags, masm.CodeObject()); 1652 heap->CreateCode(desc, flags, masm.CodeObject());
1653 if (!maybe_code->ToObject(&code)) { 1653 if (!maybe_code->ToObject(&code)) {
1654 v8::internal::V8::FatalProcessOutOfMemory("CreateCode"); 1654 v8::internal::V8::FatalProcessOutOfMemory("CreateCode");
1655 } 1655 }
1656 } 1656 }
1657 } 1657 }
1658 // Log the event and add the code to the builtins array. 1658 // Log the event and add the code to the builtins array.
1659 PROFILE(isolate, 1659 PROFILE(isolate,
1660 CodeCreateEvent(Logger::BUILTIN_TAG, 1660 CodeCreateEvent(Logger::BUILTIN_TAG,
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
1738 } 1738 }
1739 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) 1739 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C)
1740 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) 1740 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A)
1741 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) 1741 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H)
1742 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) 1742 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A)
1743 #undef DEFINE_BUILTIN_ACCESSOR_C 1743 #undef DEFINE_BUILTIN_ACCESSOR_C
1744 #undef DEFINE_BUILTIN_ACCESSOR_A 1744 #undef DEFINE_BUILTIN_ACCESSOR_A
1745 1745
1746 1746
1747 } } // namespace v8::internal 1747 } } // namespace v8::internal
OLDNEW
« include/v8.h ('K') | « src/assert-scope.cc ('k') | src/execution.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698