Commit 5a215129 authored by ulan@chromium.org's avatar ulan@chromium.org

Handle retry-after-gc failures within KeyedLoadIC::Load and KeyedStoreIC::Store.

Returning retry-after-gc failure from these functions causes them to be
re-executed after ic state change, which breaks stub computation assumptions.

R=verwaest@chromium.org
BUG=222301
TEST=mjsunit/array-bounds-check-removal.js --gc_interval=10 in x64.debug

Review URL: https://chromiumcodereview.appspot.com/14251014

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14321 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 3e31a67b
......@@ -623,6 +623,13 @@ Isolate* Heap::isolate() {
CALL_AND_RETRY(ISOLATE, FUNCTION_CALL, return, return)
#define CALL_HEAP_FUNCTION_PASS_EXCEPTION(ISOLATE, FUNCTION_CALL) \
CALL_AND_RETRY(ISOLATE, \
FUNCTION_CALL, \
return __object__, \
return __maybe_object__)
#ifdef DEBUG
inline bool Heap::allow_allocation(bool new_state) {
......
......@@ -1384,7 +1384,7 @@ MaybeObject* KeyedLoadIC::Load(State state,
}
return Runtime::GetObjectProperty(isolate(), object, key);
return Runtime::GetObjectPropertyOrFail(isolate(), object, key);
}
......@@ -1972,7 +1972,7 @@ MaybeObject* KeyedStoreIC::Store(State state,
TRACE_IC("KeyedStoreIC", key, state, target());
}
return Runtime::SetObjectProperty(
return Runtime::SetObjectPropertyOrFail(
isolate(), object , key, value, NONE, strict_mode);
}
......
......@@ -4094,6 +4094,13 @@ MaybeObject* Runtime::HasObjectProperty(Isolate* isolate,
return isolate->heap()->ToBoolean(object->HasProperty(*name));
}
MaybeObject* Runtime::GetObjectPropertyOrFail(
Isolate* isolate,
Handle<Object> object,
Handle<Object> key) {
CALL_HEAP_FUNCTION_PASS_EXCEPTION(isolate,
GetObjectProperty(isolate, object, key));
}
MaybeObject* Runtime::GetObjectProperty(Isolate* isolate,
Handle<Object> object,
......@@ -4378,6 +4385,18 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_GetDataProperty) {
}
MaybeObject* Runtime::SetObjectPropertyOrFail(
Isolate* isolate,
Handle<Object> object,
Handle<Object> key,
Handle<Object> value,
PropertyAttributes attr,
StrictModeFlag strict_mode) {
CALL_HEAP_FUNCTION_PASS_EXCEPTION(isolate,
SetObjectProperty(isolate, object, key, value, attr, strict_mode));
}
MaybeObject* Runtime::SetObjectProperty(Isolate* isolate,
Handle<Object> object,
Handle<Object> key,
......
......@@ -702,6 +702,14 @@ class Runtime : public AllStatic {
PropertyAttributes attr,
StrictModeFlag strict_mode);
MUST_USE_RESULT static MaybeObject* SetObjectPropertyOrFail(
Isolate* isolate,
Handle<Object> object,
Handle<Object> key,
Handle<Object> value,
PropertyAttributes attr,
StrictModeFlag strict_mode);
MUST_USE_RESULT static MaybeObject* ForceSetObjectProperty(
Isolate* isolate,
Handle<JSObject> object,
......@@ -725,6 +733,11 @@ class Runtime : public AllStatic {
Handle<Object> object,
Handle<Object> key);
MUST_USE_RESULT static MaybeObject* GetObjectPropertyOrFail(
Isolate* isolate,
Handle<Object> object,
Handle<Object> key);
// Helper functions used stubs.
static void PerformGC(Object* result);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment