Ignore:
Timestamp:
Dec 1, 2016, 4:24:17 PM (8 years ago)
Author:
[email protected]
Message:

SourceCodeKey should use unlinked source code
https://bugs.webkit.org/show_bug.cgi?id=165286

Reviewed by Saam Barati.

This patch splits out UnlinkedSourceCode from SourceCode, and deploys
UnlinkedSourceCode in SourceCodeKey.

It's misleading to store SourceCode in SourceCodeKey because SourceCode
has an absolute location whereas unlinked cached code has no location.

I plan to deploy UnlinkedSourceCode in more places, to indicate code
that has no absolute location.

(JSC::UnlinkedSourceCode::toUTF8):
(JSC::SourceCode::toUTF8): Deleted.

  • parser/SourceCode.h:

(JSC::SourceCode::SourceCode):
(JSC::SourceCode::startColumn):
(JSC::SourceCode::isHashTableDeletedValue): Deleted.
(JSC::SourceCode::hash): Deleted.
(JSC::SourceCode::view): Deleted.
(JSC::SourceCode::providerID): Deleted.
(JSC::SourceCode::isNull): Deleted.
(JSC::SourceCode::provider): Deleted.
(JSC::SourceCode::startOffset): Deleted.
(JSC::SourceCode::endOffset): Deleted.
(JSC::SourceCode::length): Deleted. Move a bunch of stuff in to a new
base class, UnlinkedSourceCode.

  • parser/SourceCodeKey.h:

(JSC::SourceCodeKey::SourceCodeKey): Use UnlinkedSourceCode since code
in the cache has no location.

  • parser/UnlinkedSourceCode.h: Copied from Source/JavaScriptCore/parser/SourceCode.h.

(JSC::UnlinkedSourceCode::UnlinkedSourceCode):
(JSC::UnlinkedSourceCode::provider):
(JSC::SourceCode::SourceCode): Deleted.
(JSC::SourceCode::isHashTableDeletedValue): Deleted.
(JSC::SourceCode::hash): Deleted.
(JSC::SourceCode::view): Deleted.
(JSC::SourceCode::providerID): Deleted.
(JSC::SourceCode::isNull): Deleted.
(JSC::SourceCode::provider): Deleted.
(JSC::SourceCode::firstLine): Deleted.
(JSC::SourceCode::startColumn): Deleted.
(JSC::SourceCode::startOffset): Deleted.
(JSC::SourceCode::endOffset): Deleted.
(JSC::SourceCode::length): Deleted.
(JSC::makeSource): Deleted.
(JSC::SourceCode::subExpression): Deleted.

  • runtime/CodeCache.h: Use UnlinkedSourceCode in the cache.
File:
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/parser/UnlinkedSourceCode.cpp

    r209219 r209220  
    11/*
    2  * Copyright (C) 2013 Apple Inc. All rights reserved.
     2 * Copyright (C) 2013, 2016 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2525
    2626#include "config.h"
    27 #include "SourceCode.h"
     27#include "UnlinkedSourceCode.h"
    2828
    2929#include "JSCInlines.h"
     
    3232namespace JSC {
    3333
    34 CString SourceCode::toUTF8() const
     34CString UnlinkedSourceCode::toUTF8() const
    3535{
    3636    if (!m_provider)
Note: See TracChangeset for help on using the changeset viewer.