<commit_before>#ifndef _IV_LV5_JSSTRING_H_
#define _IV_LV5_JSSTRING_H_
#include <algorithm>
#include <iterator>
#include <cassert>
#include <gc/gc_cpp.h>
#include "conversions.h"
#include "noncopyable.h"
#include "stringpiece.h"
#include "ustringpiece.h"
#include "gc_template.h"
#include "ustring.h"
#include "icu/uconv.h"
#include "icu/ustream.h"

namespace iv {
namespace lv5 {

class Context;
class JSStringBuilder;
class JSString : public gc {
 public:
  friend class JSStringBuilder;
  typedef JSString this_type;
  typedef GCUString value_type;
  typedef value_type::iterator iterator;
  typedef value_type::const_iterator const_iterator;
  typedef value_type::reverse_iterator reverse_iterator;
  typedef value_type::const_reverse_iterator const_reverse_iterator;
  typedef value_type::size_type size_type;

  JSString()
    : string_(),
      hash_value_(core::StringToHash(string_)) {
  }

  template<class String>
  explicit JSString(const String& rhs)
    : string_(rhs.begin(), rhs.end()),
      hash_value_(core::StringToHash(string_)) {
  }

  JSString(const JSString& str)
    : string_(str.string_),
      hash_value_(str.hash_value_) {
  }

  JSString(size_type len, uc16 ch)<commit_msg>fix GC bug<commit_after>#ifndef _IV_LV5_JSSTRING_H_
#define _IV_LV5_JSSTRING_H_
#include <algorithm>
#include <iterator>
#include <cassert>
#include <gc/gc_cpp.h>
#include "conversions.h"
#include "noncopyable.h"
#include "stringpiece.h"
#include "ustringpiece.h"
#include "gc_template.h"
#include "ustring.h"
#include "icu/uconv.h"
#include "icu/ustream.h"

namespace iv {
namespace lv5 {

class Context;
class JSStringBuilder;
class JSString : public gc_cleanup {
 public:
  friend class JSStringBuilder;
  typedef JSString this_type;
  typedef GCUString value_type;
  typedef value_type::iterator iterator;
  typedef value_type::const_iterator const_iterator;
  typedef value_type::reverse_iterator reverse_iterator;
  typedef value_type::const_reverse_iterator const_reverse_iterator;
  typedef value_type::size_type size_type;

  JSString()
    : string_(),
      hash_value_(core::StringToHash(string_)) {
  }

  template<class String>
  explicit JSString(const String& rhs)
    : string_(rhs.begin(), rhs.end()),
      hash_value_(core::StringToHash(string_)) {
  }

  JSString(const JSString& str)
    : string_(str.string_),
      hash_value_(str.hash_value_) {
  }

  JSString(size_type len, uc16 ch)
{'fraction_non_alphanumeric': 0.1093167701863354, 'fraction_numerical': 0.004140786749482402, 'mean_word_length': 5.547425474254743, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6393628', 'n_tokens_mistral': 839, 'n_tokens_neox': 825, 'n_words': 173}