Remove obsolete unchecked accessors in JSFunction.

R=hpayer@chromium.org
BUG=v8:1490

Review URL: https://codereview.chromium.org/17833002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15338 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 9e0f0a73
......@@ -741,7 +741,7 @@ int JavaScriptFrame::GetArgumentsLength() const {
Code* JavaScriptFrame::unchecked_code() const {
JSFunction* function = JSFunction::cast(this->function());
return function->unchecked_code();
return function->code();
}
......
......@@ -1050,9 +1050,9 @@ void V8HeapExplorer::ExtractJSObjectReferences(
SetInternalReference(js_fun, entry,
"shared", shared_info,
JSFunction::kSharedFunctionInfoOffset);
TagObject(js_fun->unchecked_context(), "(context)");
TagObject(js_fun->context(), "(context)");
SetInternalReference(js_fun, entry,
"context", js_fun->unchecked_context(),
"context", js_fun->context(),
JSFunction::kContextOffset);
for (int i = JSFunction::kNonWeakFieldsEndOffset;
i < JSFunction::kSize;
......
......@@ -1319,7 +1319,7 @@ static inline HeapObject* ShortCircuitConsString(Object** p) {
InstanceType type = map->instance_type();
if ((type & kShortcutTypeMask) != kShortcutTypeTag) return object;
Object* second = reinterpret_cast<ConsString*>(object)->unchecked_second();
Object* second = reinterpret_cast<ConsString*>(object)->second();
Heap* heap = map->GetHeap();
if (second != heap->empty_string()) {
return object;
......@@ -1328,7 +1328,7 @@ static inline HeapObject* ShortCircuitConsString(Object** p) {
// Since we don't have the object's start, it is impossible to update the
// page dirty marks. Therefore, we only replace the string with its left
// substring when page dirty marks do not change.
Object* first = reinterpret_cast<ConsString*>(object)->unchecked_first();
Object* first = reinterpret_cast<ConsString*>(object)->first();
if (!heap->InNewSpace(object) && heap->InNewSpace(first)) return object;
*p = first;
......
......@@ -4901,12 +4901,7 @@ bool JSFunction::IsInRecompileQueue() {
Code* JSFunction::code() {
return Code::cast(unchecked_code());
}
Code* JSFunction::unchecked_code() {
return reinterpret_cast<Code*>(
return Code::cast(
Code::GetObjectFromEntryAddress(FIELD_ADDR(this, kCodeEntryOffset)));
}
......@@ -4951,11 +4946,6 @@ Context* JSFunction::context() {
}
Object* JSFunction::unchecked_context() {
return READ_FIELD(this, kContextOffset);
}
void JSFunction::set_context(Object* value) {
ASSERT(value->IsUndefined() || value->IsContext());
WRITE_FIELD(this, kContextOffset, value);
......
......@@ -864,7 +864,7 @@ void JSFunction::JSFunctionPrint(FILE* out) {
PrintF(out, "\n - name = ");
shared()->name()->Print(out);
PrintF(out, "\n - context = ");
unchecked_context()->ShortPrint(out);
context()->ShortPrint(out);
PrintF(out, "\n - literals = ");
literals()->ShortPrint(out);
PrintF(out, "\n - code = ");
......
......@@ -645,7 +645,7 @@ bool StaticMarkingVisitor<StaticVisitor>::IsFlushable(
}
// The function must have a valid context and not be a builtin.
if (!IsValidNonBuiltinContext(function->unchecked_context())) {
if (!IsValidNonBuiltinContext(function->context())) {
return false;
}
......
......@@ -6567,7 +6567,6 @@ class JSFunction: public JSObject {
// [context]: The context for this function.
inline Context* context();
inline Object* unchecked_context();
inline void set_context(Object* context);
// [code]: The generated code object for this function. Executed
......@@ -6579,8 +6578,6 @@ class JSFunction: public JSObject {
inline void set_code_no_write_barrier(Code* code);
inline void ReplaceCode(Code* code);
inline Code* unchecked_code();
// Tells whether this function is builtin.
inline bool IsBuiltin();
......
......@@ -471,7 +471,7 @@ void StringStream::PrintSecurityTokenIfChanged(Object* f) {
}
JSFunction* fun = JSFunction::cast(f);
Object* perhaps_context = fun->unchecked_context();
Object* perhaps_context = fun->context();
if (perhaps_context->IsHeapObject() &&
heap->Contains(HeapObject::cast(perhaps_context)) &&
perhaps_context->IsContext()) {
......
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