Update V8 to version 4.1.0.21
This is a cherry-pick of all commits up to and including the
4.1.0.21 cherry-pick in Chromium.
Original commit message:
Version 4.1.0.21 (cherry-pick)
Merged 206e9136bde0f2b5ae8cb77afbb1e7833e5bd412
Unlink pages from the space page list after evacuation.
BUG=430201
LOG=N
R=jkummerow@chromium.org
Review URL: https://codereview.chromium.org/953813002
Cr-Commit-Position: refs/branch-heads/4.1@{#22}
Cr-Branched-From: 2e08d2a7aa9d65d269d8c57aba82eb38a8cb0a18-refs/heads/candidates@{#25353}
---
FPIIM-449
Change-Id: I8c23c7bbb70772b4858fe8a47b64fa97ee0d1f8c
diff --git a/samples/process.cc b/samples/process.cc
index e5c9b7a..f447970 100644
--- a/samples/process.cc
+++ b/samples/process.cc
@@ -32,10 +32,6 @@
#include <map>
#include <string>
-#ifdef COMPRESS_STARTUP_DATA_BZ2
-#error Using compressed startup data is not supported for this sample
-#endif
-
using namespace std;
using namespace v8;
@@ -116,10 +112,8 @@
const PropertyCallbackInfo<Value>& info);
// Callbacks that access maps
- static void MapGet(Local<String> name,
- const PropertyCallbackInfo<Value>& info);
- static void MapSet(Local<String> name,
- Local<Value> value,
+ static void MapGet(Local<Name> name, const PropertyCallbackInfo<Value>& info);
+ static void MapSet(Local<Name> name, Local<Value> value,
const PropertyCallbackInfo<Value>& info);
// Utility methods for wrapping C++ objects as JavaScript objects,
@@ -359,13 +353,15 @@
}
-void JsHttpRequestProcessor::MapGet(Local<String> name,
+void JsHttpRequestProcessor::MapGet(Local<Name> name,
const PropertyCallbackInfo<Value>& info) {
+ if (name->IsSymbol()) return;
+
// Fetch the map wrapped by this object.
map<string, string>* obj = UnwrapMap(info.Holder());
// Convert the JavaScript string to a std::string.
- string key = ObjectToString(name);
+ string key = ObjectToString(Local<String>::Cast(name));
// Look up the value if it exists using the standard STL ideom.
map<string, string>::iterator iter = obj->find(key);
@@ -381,14 +377,15 @@
}
-void JsHttpRequestProcessor::MapSet(Local<String> name,
- Local<Value> value_obj,
+void JsHttpRequestProcessor::MapSet(Local<Name> name, Local<Value> value_obj,
const PropertyCallbackInfo<Value>& info) {
+ if (name->IsSymbol()) return;
+
// Fetch the map wrapped by this object.
map<string, string>* obj = UnwrapMap(info.Holder());
// Convert the key and value to std::strings.
- string key = ObjectToString(name);
+ string key = ObjectToString(Local<String>::Cast(name));
string value = ObjectToString(value_obj);
// Update the map.
@@ -405,7 +402,7 @@
Local<ObjectTemplate> result = ObjectTemplate::New(isolate);
result->SetInternalFieldCount(1);
- result->SetNamedPropertyHandler(MapGet, MapSet);
+ result->SetHandler(NamedPropertyHandlerConfiguration(MapGet, MapSet));
// Again, return the result through the current handle scope.
return handle_scope.Escape(result);