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

Unified Diff: src/api.cc

Issue 1268333004: Introduce object visitor to estimate the size of a native context. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix compare Created 5 years, 4 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 | « include/v8.h ('k') | src/context-measure.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index ceadd4ed8b62776d355a0ea96f8efe2702cd444c..7f1000af5f7bc4ac35e936e65742836f223db99a 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -22,6 +22,7 @@
#include "src/bootstrapper.h"
#include "src/code-stubs.h"
#include "src/compiler.h"
+#include "src/context-measure.h"
#include "src/contexts.h"
#include "src/conversions-inl.h"
#include "src/counters.h"
@@ -5577,6 +5578,12 @@ void Context::SetErrorMessageForCodeGenerationFromStrings(Local<String> error) {
}
+size_t Context::EstimatedSize() {
+ return static_cast<size_t>(
+ i::ContextMeasure(*Utils::OpenHandle(this)).Size());
+}
+
+
MaybeLocal<v8::Object> ObjectTemplate::NewInstance(Local<Context> context) {
PREPARE_FOR_EXECUTION(context, "v8::ObjectTemplate::NewInstance()", Object);
auto self = Utils::OpenHandle(this);
« no previous file with comments | « include/v8.h ('k') | src/context-measure.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698