| Index: src/extensions/i18n/date-format.h
|
| diff --git a/src/hydrogen-infer-representation.h b/src/extensions/i18n/date-format.h
|
| similarity index 57%
|
| copy from src/hydrogen-infer-representation.h
|
| copy to src/extensions/i18n/date-format.h
|
| index 7c605696c4b956152bdd9dfc74c83e80569e3714..daa5964e254519faa7a8eef7d7a5d375562bc0ed 100644
|
| --- a/src/hydrogen-infer-representation.h
|
| +++ b/src/extensions/i18n/date-format.h
|
| @@ -24,34 +24,48 @@
|
| // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
| // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
| // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| +// limitations under the License.
|
|
|
| -#ifndef V8_HYDROGEN_INFER_REPRESENTATION_H_
|
| -#define V8_HYDROGEN_INFER_REPRESENTATION_H_
|
| +#ifndef V8_EXTENSIONS_I18N_DATE_FORMAT_H_
|
| +#define V8_EXTENSIONS_I18N_DATE_FORMAT_H_
|
|
|
| -#include "hydrogen.h"
|
| +#include "unicode/uversion.h"
|
| +#include "v8.h"
|
|
|
| -namespace v8 {
|
| -namespace internal {
|
| +namespace U_ICU_NAMESPACE {
|
| +class SimpleDateFormat;
|
| +}
|
|
|
| +namespace v8_i18n {
|
|
|
| -class HInferRepresentationPhase : public HPhase {
|
| +class DateFormat {
|
| public:
|
| - explicit HInferRepresentationPhase(HGraph* graph)
|
| - : HPhase("H_Infer representations", graph),
|
| - worklist_(8, zone()),
|
| - in_worklist_(graph->GetMaximumValueID(), zone()) { }
|
| + static void JSCreateDateTimeFormat(
|
| + const v8::FunctionCallbackInfo<v8::Value>& args);
|
|
|
| - void Run();
|
| - void AddToWorklist(HValue* current);
|
| + // Helper methods for various bindings.
|
|
|
| - private:
|
| - ZoneList<HValue*> worklist_;
|
| - BitVector in_worklist_;
|
| + // Unpacks date format object from corresponding JavaScript object.
|
| + static icu::SimpleDateFormat* UnpackDateFormat(
|
| + v8::Handle<v8::Object> obj);
|
|
|
| - DISALLOW_COPY_AND_ASSIGN(HInferRepresentationPhase);
|
| -};
|
| + // Release memory we allocated for the DateFormat once the JS object that
|
| + // holds the pointer gets garbage collected.
|
| + static void DeleteDateFormat(v8::Isolate* isolate,
|
| + v8::Persistent<v8::Object>* object,
|
| + void* param);
|
| +
|
| + // Formats date and returns corresponding string.
|
| + static void JSInternalFormat(const v8::FunctionCallbackInfo<v8::Value>& args);
|
|
|
| + // Parses date and returns corresponding Date object or undefined if parse
|
| + // failed.
|
| + static void JSInternalParse(const v8::FunctionCallbackInfo<v8::Value>& args);
|
| +
|
| + private:
|
| + DateFormat();
|
| +};
|
|
|
| -} } // namespace v8::internal
|
| +} // namespace v8_i18n
|
|
|
| -#endif // V8_HYDROGEN_INFER_REPRESENTATION_H_
|
| +#endif // V8_EXTENSIONS_I18N_DATE_FORMAT_H_
|
|
|