i::Handle<i::Object> value_obj = Utils::OpenHandle(*value);
EXCEPTION_PREAMBLE(isolate);
i::Handle<i::Object> obj = i::SetProperty(
+ isolate,
self,
key_obj,
value_obj,
namespace v8 {
namespace internal {
-bool CodeStub::FindCodeInCache(Code** code_out) {
- Heap* heap = Isolate::Current()->heap();
- int index = heap->code_stubs()->FindEntry(GetKey());
+bool CodeStub::FindCodeInCache(Code** code_out, Isolate* isolate) {
+ UnseededNumberDictionary* stubs = isolate->heap()->code_stubs();
+ int index = stubs->FindEntry(GetKey());
if (index != UnseededNumberDictionary::kNotFound) {
- *code_out = Code::cast(heap->code_stubs()->ValueAt(index));
+ *code_out = Code::cast(stubs->ValueAt(index));
return true;
}
return false;
Heap* heap = isolate->heap();
Code* code;
if (UseSpecialCache()
- ? FindCodeInSpecialCache(&code)
- : FindCodeInCache(&code)) {
+ ? FindCodeInSpecialCache(&code, isolate)
+ : FindCodeInCache(&code, isolate)) {
ASSERT(IsPregenerated() == code->is_pregenerated());
return Handle<Code>(code);
}
}
-bool ICCompareStub::FindCodeInSpecialCache(Code** code_out) {
- Isolate* isolate = known_map_->GetIsolate();
+bool ICCompareStub::FindCodeInSpecialCache(Code** code_out, Isolate* isolate) {
Factory* factory = isolate->factory();
Code::Flags flags = Code::ComputeFlags(
static_cast<Code::Kind>(GetCodeKind()),
bool CompilingCallsToThisStubIsGCSafe() {
bool is_pregenerated = IsPregenerated();
Code* code = NULL;
- CHECK(!is_pregenerated || FindCodeInCache(&code));
+ CHECK(!is_pregenerated || FindCodeInCache(&code, Isolate::Current()));
return is_pregenerated;
}
virtual bool SometimesSetsUpAFrame() { return true; }
// Lookup the code in the (possibly custom) cache.
- bool FindCodeInCache(Code** code_out);
+ bool FindCodeInCache(Code** code_out, Isolate* isolate);
protected:
static bool CanUseFPRegisters();
virtual void AddToSpecialCache(Handle<Code> new_object) { }
// Find code in a specialized cache, work is delegated to the specific stub.
- virtual bool FindCodeInSpecialCache(Code** code_out) { return false; }
+ virtual bool FindCodeInSpecialCache(Code** code_out, Isolate* isolate) {
+ return false;
+ }
// If a stub uses a special cache override this.
virtual bool UseSpecialCache() { return false; }
Condition GetCondition() const { return CompareIC::ComputeCondition(op_); }
virtual void AddToSpecialCache(Handle<Code> new_object);
- virtual bool FindCodeInSpecialCache(Code** code_out);
+ virtual bool FindCodeInSpecialCache(Code** code_out, Isolate* isolate);
virtual bool UseSpecialCache() { return state_ == CompareIC::KNOWN_OBJECTS; }
Token::Value op_;
}
-Handle<Object> SetProperty(Handle<Object> object,
+Handle<Object> SetProperty(Isolate* isolate,
+ Handle<Object> object,
Handle<Object> key,
Handle<Object> value,
PropertyAttributes attributes,
StrictModeFlag strict_mode) {
- Isolate* isolate = Isolate::Current();
CALL_HEAP_FUNCTION(
isolate,
Runtime::SetObjectProperty(
int Utf8Length(Handle<String> str);
-Handle<Object> SetProperty(Handle<Object> object,
+Handle<Object> SetProperty(Isolate* isolate,
+ Handle<Object> object,
Handle<Object> key,
Handle<Object> value,
PropertyAttributes attributes,
Code* CompareIC::GetRawUninitialized(Token::Value op) {
ICCompareStub stub(op, UNINITIALIZED, UNINITIALIZED, UNINITIALIZED);
Code* code = NULL;
- CHECK(stub.FindCodeInCache(&code));
+ CHECK(stub.FindCodeInCache(&code, Isolate::Current()));
return code;
}
Code* stack_check_code = NULL;
if (FLAG_count_based_interrupts) {
InterruptStub interrupt_stub;
- found_code = interrupt_stub.FindCodeInCache(&stack_check_code);
+ found_code = interrupt_stub.FindCodeInCache(&stack_check_code, isolate_);
} else // NOLINT
{ // NOLINT
StackCheckStub check_stub;
- found_code = check_stub.FindCodeInCache(&stack_check_code);
+ found_code = check_stub.FindCodeInCache(&stack_check_code, isolate_);
}
if (found_code) {
Code* replacement_code =
RETURN_IF_EMPTY_HANDLE_VALUE(
isolate,
- SetProperty(scope_object,
+ SetProperty(isolate,
+ scope_object,
Handle<String>(scope_info->ContextLocalName(i)),
Handle<Object>(context->get(context_index), isolate),
NONE,
RETURN_IF_EMPTY_HANDLE_VALUE(
isolate,
- SetProperty(local_scope,
+ SetProperty(isolate,
+ local_scope,
Handle<String>(scope_info->ParameterName(i)),
value,
NONE,
for (int i = 0; i < scope_info->StackLocalCount(); ++i) {
RETURN_IF_EMPTY_HANDLE_VALUE(
isolate,
- SetProperty(local_scope,
+ SetProperty(isolate,
+ local_scope,
Handle<String>(scope_info->StackLocalName(i)),
Handle<Object>(frame_inspector->GetExpression(i)),
NONE,
Handle<String> key(String::cast(keys->get(i)));
RETURN_IF_EMPTY_HANDLE_VALUE(
isolate,
- SetProperty(local_scope,
+ SetProperty(isolate,
+ local_scope,
key,
GetProperty(ext, key),
NONE,
Handle<String> key(String::cast(keys->get(i)));
RETURN_IF_EMPTY_HANDLE_VALUE(
isolate,
- SetProperty(closure_scope,
+ SetProperty(isolate,
+ closure_scope,
key,
GetProperty(ext, key),
NONE,
isolate->factory()->NewJSObject(isolate->object_function());
RETURN_IF_EMPTY_HANDLE_VALUE(
isolate,
- SetProperty(catch_scope, name, thrown_object, NONE, kNonStrictMode),
+ SetProperty(isolate,
+ catch_scope,
+ name,
+ thrown_object,
+ NONE,
+ kNonStrictMode),
Handle<JSObject>());
return catch_scope;
}
static void SetGlobalProperty(const char* name, Object* value) {
+ Isolate* isolate = Isolate::Current();
Handle<Object> object(value);
Handle<String> symbol = FACTORY->LookupAsciiSymbol(name);
Handle<JSObject> global(Isolate::Current()->context()->global_object());
- SetProperty(global, symbol, object, NONE, kNonStrictMode);
+ SetProperty(isolate, global, symbol, object, NONE, kNonStrictMode);
}
inline v8::Context* operator*() { return *context_; }
inline bool IsReady() { return !context_.IsEmpty(); }
void ExposeDebug() {
- v8::internal::Debug* debug = v8::internal::Isolate::Current()->debug();
+ v8::internal::Isolate* isolate = v8::internal::Isolate::Current();
+ v8::internal::Debug* debug = isolate->debug();
// Expose the debug context global object in the global object for testing.
debug->Load();
debug->debug_context()->set_security_token(
v8::Utils::OpenHandle(*context_->Global())));
Handle<v8::internal::String> debug_string =
FACTORY->LookupAsciiSymbol("debug");
- SetProperty(global, debug_string,
+ SetProperty(isolate, global, debug_string,
Handle<Object>(debug->debug_context()->global_proxy()), DONT_ENUM,
::v8::internal::kNonStrictMode);
}