i::Handle<i::FunctionTemplateInfo> proxy_constructor =
EnsureConstructor(Utils::OpenHandle(*proxy_template));
-
+
// Set the global template to be the prototype template
// of global proxy template.
proxy_constructor->set_prototype_template(
if (!proto_template->IsUndefined()) {
js_global_template =
Handle<ObjectTemplateInfo>::cast(proto_template);
- }
+ }
}
if (js_global_template.is_null()) {
Handle<JSObject> js_global(JSObject::cast(global_context()->global()));
if (!global_proxy_template.IsEmpty()) {
- // Configure the global proxy object.
+ // Configure the global proxy object.
Handle<ObjectTemplateInfo> proxy_data =
v8::Utils::OpenHandle(*global_proxy_template);
if (!ConfigureApiObject(global_proxy, proxy_data)) return false;
Handle<FunctionTemplateInfo> proxy_constructor(
FunctionTemplateInfo::cast(proxy_data->constructor()));
if (!proxy_constructor->prototype_template()->IsUndefined()) {
- Handle<ObjectTemplateInfo> inner_data(
+ Handle<ObjectTemplateInfo> inner_data(
ObjectTemplateInfo::cast(proxy_constructor->prototype_template()));
if (!ConfigureApiObject(js_global, inner_data)) return false;
}
return true;
}
-
+
bool Genesis::ConfigureApiObject(Handle<JSObject> object,
Handle<ObjectTemplateInfo> object_template) {
ASSERT(!object_template.is_null());
// that we have the INSIDE_TYPEOF typeof state. => Need to handle global
// variables w/o reference errors elsewhere.
void CodeGenerator::LoadTypeofExpression(Expression* x) {
-
Variable* variable = x->AsVariableProxy()->AsVariable();
if (variable != NULL && !variable->is_this() && variable->is_global()) {
// NOTE: This is somewhat nasty. We force the compiler to load
int offset = Context::kHeaderSize + Context::GLOBAL_INDEX * kPointerSize;
mov(scratch, FieldOperand(scratch, offset));
mov(scratch, FieldOperand(scratch, GlobalObject::kGlobalContextOffset));
-
- // Check the context is a global context.
+
+ // Check the context is a global context.
if (FLAG_debug_code) {
push(scratch);
// Read the first word and compare to global_context_map.
// as a temporary register.
//
// TODO(119): avoid push(holder_reg)/pop(holder_reg)
- push(holder_reg);
+ push(holder_reg);
// Check that the security token in the calling global object is
// compatible with the security token in the receiving global
// object.
mov(holder_reg, FieldOperand(holder_reg, HeapObject::kMapOffset));
cmp(holder_reg, Factory::global_context_map());
Check(equal, "JSGlobalObject::global_context should be a global context.");
- pop(holder_reg);
+ pop(holder_reg);
}
int token_offset = Context::kHeaderSize +
Context::SECURITY_TOKEN_INDEX * kPointerSize;
mov(scratch, FieldOperand(scratch, token_offset));
cmp(scratch, FieldOperand(holder_reg, token_offset));
- pop(holder_reg);
+ pop(holder_reg);
j(not_equal, miss, not_taken);
bind(&same_contexts);
JSObjectVerify();
VerifyObjectField(JSGlobalProxy::kContextOffset);
// Make sure that this object has no properties, elements.
- CHECK(properties()->length() == 0);
- CHECK(elements()->length() == 0);
+ CHECK_EQ(0, properties()->length());
+ CHECK_EQ(0, elements()->length());
}
Object* proto = GetPrototype();
if (proto->IsNull()) return value;
ASSERT(proto->IsJSGlobalObject());
- return JSObject::cast(proto)->SetProperty(result, name, value, attributes);
+ return JSObject::cast(proto)->SetProperty(result, name, value, attributes);
}
if (result->IsNotFound() || !result->IsProperty()) {
// - GlobalObject
// - JSGlobalObject
// - JSBuiltinsObject
-// _ JSGlobalProxy
+// _ JSGlobalProxy
// - JSValue
// - Script
// - Array
}
-enum MayAccessDecision{
+enum MayAccessDecision {
YES, NO, UNKNOWN
};
// Get the global context of current top context.
// avoid using Top::global_context() because it uses Handle.
Context* global_context = Top::context()->global()->global_context();
- if (receiver_context == global_context) return YES;
+ if (receiver_context == global_context) return YES;
if (Context::cast(receiver_context)->security_token() ==
global_context->security_token())
// Check that env3 is not accessible from env1
{
Local<Value> r = global3->Get(v8_str("prop2"));
- CHECK(r->IsUndefined());
+ CHECK(r->IsUndefined());
}
env2.Dispose();