Ver código fonte

[eval] remove ropes

Turns out this is not worth it anymore with the new unicode requirements.
Simon Krajewski 6 anos atrás
pai
commit
4ef6e13131

+ 0 - 1
.merlin

@@ -3,7 +3,6 @@ B _build/src/**
 S libs/**
 S libs/**
 B libs/**
 B libs/**
 B +threads
 B +threads
-PKG rope
 PKG ptmap
 PKG ptmap
 PKG sedlex
 PKG sedlex
 PKG extlib
 PKG extlib

+ 1 - 1
Makefile

@@ -32,7 +32,7 @@ STATICLINK?=0
 HAXE_DIRECTORIES=core core/json core/display syntax context context/display codegen codegen/gencommon generators optimization filters macro macro/eval typing compiler
 HAXE_DIRECTORIES=core core/json core/display syntax context context/display codegen codegen/gencommon generators optimization filters macro macro/eval typing compiler
 EXTLIB_LIBS=extlib-leftovers extc neko javalib swflib ttflib ilib objsize pcre ziplib
 EXTLIB_LIBS=extlib-leftovers extc neko javalib swflib ttflib ilib objsize pcre ziplib
 OCAML_LIBS=unix str threads dynlink
 OCAML_LIBS=unix str threads dynlink
-OPAM_LIBS=sedlex xml-light extlib rope ptmap sha
+OPAM_LIBS=sedlex xml-light extlib ptmap sha
 
 
 FINDLIB_LIBS=$(OCAML_LIBS)
 FINDLIB_LIBS=$(OCAML_LIBS)
 FINDLIB_LIBS+=$(OPAM_LIBS)
 FINDLIB_LIBS+=$(OPAM_LIBS)

+ 0 - 1
opam

@@ -19,7 +19,6 @@ depends: [
   "ppx_tools_versioned" {build & != "5.2.1"} #https://github.com/alainfrisch/sedlex/issues/64
   "ppx_tools_versioned" {build & != "5.2.1"} #https://github.com/alainfrisch/sedlex/issues/64
   "xml-light"           {build}
   "xml-light"           {build}
   "extlib"              {build & >= "1.7"}
   "extlib"              {build & >= "1.7"}
-  "rope"                {build}
   "ptmap"               {build}
   "ptmap"               {build}
   "sha"                 {build}
   "sha"                 {build}
   "conf-libpcre"
   "conf-libpcre"

+ 6 - 6
src/macro/eval/evalContext.ml

@@ -162,7 +162,7 @@ let rec kind_name ctx kind =
 			let parent_id = env_id - 1 in
 			let parent_id = env_id - 1 in
 			let env = DynArray.get ctx.environments parent_id in
 			let env = DynArray.get ctx.environments parent_id in
 			Printf.sprintf "%s.localFunction%i" (loop env.env_info.kind parent_id) i
 			Printf.sprintf "%s.localFunction%i" (loop env.env_info.kind parent_id) i
-		| EKMethod(i1,i2),_ -> Printf.sprintf "%s.%s" (rev_hash_s i1) (rev_hash_s i2)
+		| EKMethod(i1,i2),_ -> Printf.sprintf "%s.%s" (rev_hash i1) (rev_hash i2)
 		| EKDelayed,_ -> "delayed"
 		| EKDelayed,_ -> "delayed"
 	in
 	in
 	loop kind ctx.environment_offset
 	loop kind ctx.environment_offset
@@ -284,7 +284,7 @@ let get_static_prototype_raise ctx path =
 
 
 let get_static_prototype ctx path p =
 let get_static_prototype ctx path p =
 	try get_static_prototype_raise ctx path
 	try get_static_prototype_raise ctx path
-	with Not_found -> Error.error (Printf.sprintf "[%i] Type not found: %s" ctx.ctx_id (rev_hash_s path)) p
+	with Not_found -> Error.error (Printf.sprintf "[%i] Type not found: %s" ctx.ctx_id (rev_hash path)) p
 
 
 let get_static_prototype_as_value ctx path p =
 let get_static_prototype_as_value ctx path p =
 	(get_static_prototype ctx path p).pvalue
 	(get_static_prototype ctx path p).pvalue
@@ -294,14 +294,14 @@ let get_instance_prototype_raise ctx path =
 
 
 let get_instance_prototype ctx path p =
 let get_instance_prototype ctx path p =
 	try get_instance_prototype_raise ctx path
 	try get_instance_prototype_raise ctx path
-	with Not_found -> Error.error (Printf.sprintf "[%i] Instance prototype not found: %s" ctx.ctx_id (rev_hash_s path)) p
+	with Not_found -> Error.error (Printf.sprintf "[%i] Instance prototype not found: %s" ctx.ctx_id (rev_hash path)) p
 
 
 let get_instance_constructor_raise ctx path =
 let get_instance_constructor_raise ctx path =
 	IntMap.find path ctx.constructors
 	IntMap.find path ctx.constructors
 
 
 let get_instance_constructor ctx path p =
 let get_instance_constructor ctx path p =
 	try get_instance_constructor_raise ctx path
 	try get_instance_constructor_raise ctx path
-	with Not_found -> Error.error (Printf.sprintf "[%i] Instance constructor not found: %s" ctx.ctx_id (rev_hash_s path)) p
+	with Not_found -> Error.error (Printf.sprintf "[%i] Instance constructor not found: %s" ctx.ctx_id (rev_hash path)) p
 
 
 let get_special_instance_constructor_raise ctx path =
 let get_special_instance_constructor_raise ctx path =
 	Hashtbl.find (get_ctx()).builtins.constructor_builtins path
 	Hashtbl.find (get_ctx()).builtins.constructor_builtins path
@@ -311,11 +311,11 @@ let get_proto_field_index_raise proto name =
 
 
 let get_proto_field_index proto name =
 let get_proto_field_index proto name =
 	try get_proto_field_index_raise proto name
 	try get_proto_field_index_raise proto name
-	with Not_found -> Error.error (Printf.sprintf "Field index for %s not found on prototype %s" (rev_hash_s name) (rev_hash_s proto.ppath)) null_pos
+	with Not_found -> Error.error (Printf.sprintf "Field index for %s not found on prototype %s" (rev_hash name) (rev_hash proto.ppath)) null_pos
 
 
 let get_instance_field_index_raise proto name =
 let get_instance_field_index_raise proto name =
 	IntMap.find name proto.pinstance_names
 	IntMap.find name proto.pinstance_names
 
 
 let get_instance_field_index proto name p =
 let get_instance_field_index proto name p =
 	try get_instance_field_index_raise proto name
 	try get_instance_field_index_raise proto name
-	with Not_found -> Error.error (Printf.sprintf "Field index for %s not found on prototype %s" (rev_hash_s name) (rev_hash_s proto.ppath)) p
+	with Not_found -> Error.error (Printf.sprintf "Field index for %s not found on prototype %s" (rev_hash name) (rev_hash proto.ppath)) p

+ 4 - 4
src/macro/eval/evalDebugCLI.ml

@@ -29,7 +29,7 @@ let value_string value =
 		let tabs = String.make (depth * 2) ' ' in
 		let tabs = String.make (depth * 2) ' ' in
 		let l = List.map (fun (name,value) ->
 		let l = List.map (fun (name,value) ->
 			let s_type,s_value = value_string depth value in
 			let s_type,s_value = value_string depth value in
-			Printf.sprintf "%s%s : %s = %s" tabs (rev_hash_s name) s_type s_value
+			Printf.sprintf "%s%s : %s = %s" tabs (rev_hash name) s_type s_value
 		) fields in
 		) fields in
 		Printf.sprintf "{\n%s\n%s}" (String.concat "\n" l) tabs
 		Printf.sprintf "{\n%s\n%s}" (String.concat "\n" l) tabs
 	and instance_fields depth vi =
 	and instance_fields depth vi =
@@ -43,12 +43,12 @@ let value_string value =
 		| VFalse -> "Bool","false"
 		| VFalse -> "Bool","false"
 		| VInt32 i -> "Int",Int32.to_string i
 		| VInt32 i -> "Int",Int32.to_string i
 		| VFloat f -> "Float",string_of_float f
 		| VFloat f -> "Float",string_of_float f
-		| VEnumValue ev -> rev_hash_s ev.epath,EvalString.get (s_enum_value 0 ev)
+		| VEnumValue ev -> rev_hash ev.epath,EvalString.get (s_enum_value 0 ev)
 		| VObject o -> "Anonymous",fields_string (depth + 1) (object_fields o)
 		| VObject o -> "Anonymous",fields_string (depth + 1) (object_fields o)
 		| VString s -> "String","\"" ^ (Ast.s_escape (EvalString.get s)) ^ "\""
 		| VString s -> "String","\"" ^ (Ast.s_escape (EvalString.get s)) ^ "\""
 		| VArray va -> "Array",EvalString.get (s_array (depth + 1) va)
 		| VArray va -> "Array",EvalString.get (s_array (depth + 1) va)
 		| VVector vv -> "Vector",EvalString.get (s_vector (depth + 1) vv)
 		| VVector vv -> "Vector",EvalString.get (s_vector (depth + 1) vv)
-		| VInstance vi -> rev_hash_s vi.iproto.ppath,instance_fields (depth + 1) vi
+		| VInstance vi -> rev_hash vi.iproto.ppath,instance_fields (depth + 1) vi
 		| VPrototype proto -> "Anonymous",EvalString.get (s_proto_kind proto)
 		| VPrototype proto -> "Anonymous",EvalString.get (s_proto_kind proto)
 		| VFunction _ | VFieldClosure _ -> "Function","fun"
 		| VFunction _ | VFieldClosure _ -> "Function","fun"
 		| VLazy f -> value_string depth (!f())
 		| VLazy f -> value_string depth (!f())
@@ -202,7 +202,7 @@ let rec wait ctx run env =
 			loop()
 			loop()
 		| ["classes"] ->
 		| ["classes"] ->
 			IntMap.iter (fun i _ ->
 			IntMap.iter (fun i _ ->
-				output_type_name (rev_hash_s i)
+				output_type_name (rev_hash i)
 			) ctx.type_cache;
 			) ctx.type_cache;
 			loop()
 			loop()
 		| ["mem"] ->
 		| ["mem"] ->

+ 8 - 8
src/macro/eval/evalDebugMisc.ml

@@ -40,7 +40,7 @@ let iter_breakpoints ctx f =
 	) ctx.debug.breakpoints
 	) ctx.debug.breakpoints
 
 
 let add_breakpoint ctx file line column condition =
 let add_breakpoint ctx file line column condition =
-	let hash = hash_s (Path.unique_full_path (Common.find_file (ctx.curapi.get_com()) file)) in
+	let hash = hash (Path.unique_full_path (Common.find_file (ctx.curapi.get_com()) file)) in
 	let h = try
 	let h = try
 		Hashtbl.find ctx.debug.breakpoints hash
 		Hashtbl.find ctx.debug.breakpoints hash
 	with Not_found ->
 	with Not_found ->
@@ -53,7 +53,7 @@ let add_breakpoint ctx file line column condition =
 	breakpoint
 	breakpoint
 
 
 let delete_breakpoint ctx file line =
 let delete_breakpoint ctx file line =
-	let hash = hash_s (Path.unique_full_path (Common.find_file (ctx.curapi.get_com()) file)) in
+	let hash = hash (Path.unique_full_path (Common.find_file (ctx.curapi.get_com()) file)) in
 	let h = Hashtbl.find ctx.debug.breakpoints hash in
 	let h = Hashtbl.find ctx.debug.breakpoints hash in
 	Hashtbl.remove h line
 	Hashtbl.remove h line
 
 
@@ -122,7 +122,7 @@ let get_variable capture_infos scopes name env =
 (* Expr to value *)
 (* Expr to value *)
 
 
 let resolve_ident ctx env s =
 let resolve_ident ctx env s =
-	let key = hash_s s in
+	let key = hash s in
 	try
 	try
 		(* 0. Extra locals *)
 		(* 0. Extra locals *)
 		IntMap.find key env.env_extra_locals
 		IntMap.find key env.env_extra_locals
@@ -190,7 +190,7 @@ let rec expr_to_value ctx env e =
 			end
 			end
 		| EField(e1,s) ->
 		| EField(e1,s) ->
 			let v1 = loop e1 in
 			let v1 = loop e1 in
-			let v = EvalField.field v1 (hash_s s) in
+			let v = EvalField.field v1 (hash s) in
 			v
 			v
 		| EArrayDecl el ->
 		| EArrayDecl el ->
 			let vl = List.map loop el in
 			let vl = List.map loop el in
@@ -240,7 +240,7 @@ let rec expr_to_value ctx env e =
 			begin match fst e1 with
 			begin match fst e1 with
 			| EField(ethis,s) ->
 			| EField(ethis,s) ->
 				let vthis = loop ethis in
 				let vthis = loop ethis in
-				let v1 = EvalField.field vthis (hash_s s) in
+				let v1 = EvalField.field vthis (hash s) in
 				let vl = List.map loop el in
 				let vl = List.map loop el in
 				safe_call (EvalPrinting.call_value_on vthis v1) vl
 				safe_call (EvalPrinting.call_value_on vthis v1) vl
 			| _ ->
 			| _ ->
@@ -280,7 +280,7 @@ let rec expr_to_value ctx env e =
 			List.iter (fun ((n,_),_,_,eo) ->
 			List.iter (fun ((n,_),_,_,eo) ->
 				match eo with
 				match eo with
 				| Some e ->
 				| Some e ->
-					env.env_extra_locals <- IntMap.add (hash_s n) (loop e) env.env_extra_locals
+					env.env_extra_locals <- IntMap.add (hash n) (loop e) env.env_extra_locals
 				| _ ->
 				| _ ->
 					()
 					()
 			) vl;
 			) vl;
@@ -299,7 +299,7 @@ let rec expr_to_value ctx env e =
 			let rec loop2 v sl = match sl with
 			let rec loop2 v sl = match sl with
 				| [] -> v
 				| [] -> v
 				| s :: sl ->
 				| s :: sl ->
-					loop2 (EvalField.field v (hash_s s)) sl
+					loop2 (EvalField.field v (hash s)) sl
 			in
 			in
 			let v1 = loop2 ctx.toplevel tp.tpackage in
 			let v1 = loop2 ctx.toplevel tp.tpackage in
 			let v1 = loop2 v1 [match tp.tsub with None -> tp.tname | Some s -> s] in
 			let v1 = loop2 v1 [match tp.tsub with None -> tp.tname | Some s -> s] in
@@ -316,7 +316,7 @@ and write_expr ctx env expr value =
 	begin match fst expr with
 	begin match fst expr with
 		| EField(e1,s) ->
 		| EField(e1,s) ->
 			let v1 = expr_to_value ctx env e1 in
 			let v1 = expr_to_value ctx env e1 in
-			set_field v1 (hash_s s) value;
+			set_field v1 (hash s) value;
 		| EConst (Ident s) ->
 		| EConst (Ident s) ->
 			begin try
 			begin try
 				let slot = get_var_slot_by_name env.env_debug.scopes s in
 				let slot = get_var_slot_by_name env.env_debug.scopes s in

+ 7 - 7
src/macro/eval/evalDebugSocket.ml

@@ -34,13 +34,13 @@ let var_to_json name value access =
 		| VObject o -> "{...}"
 		| VObject o -> "{...}"
 		| VString s -> string_repr s
 		| VString s -> string_repr s
 		| VArray _ | VVector _ -> "[...]"
 		| VArray _ | VVector _ -> "[...]"
-		| VInstance vi -> (rev_hash_s vi.iproto.ppath) ^ " {...}"
+		| VInstance vi -> (rev_hash vi.iproto.ppath) ^ " {...}"
 		| VPrototype proto -> EvalString.get (s_proto_kind proto)
 		| VPrototype proto -> EvalString.get (s_proto_kind proto)
 		| VFunction _ | VFieldClosure _ -> "<fun>"
 		| VFunction _ | VFieldClosure _ -> "<fun>"
 		| VLazy f -> level2_value_repr (!f())
 		| VLazy f -> level2_value_repr (!f())
 	in
 	in
 	let fields_string fields =
 	let fields_string fields =
-		let l = List.map (fun (name, value) -> Printf.sprintf "%s: %s" (rev_hash_s name) (level2_value_repr value)) fields in
+		let l = List.map (fun (name, value) -> Printf.sprintf "%s: %s" (rev_hash name) (level2_value_repr value)) fields in
 		Printf.sprintf "{%s}" (String.concat ", " l)
 		Printf.sprintf "{%s}" (String.concat ", " l)
 	in
 	in
 	let array_elems l =
 	let array_elems l =
@@ -54,7 +54,7 @@ let var_to_json name value access =
 		| VInt32 i -> jv "Int" (Int32.to_string i) false
 		| VInt32 i -> jv "Int" (Int32.to_string i) false
 		| VFloat f -> jv "Float" (string_of_float f) false
 		| VFloat f -> jv "Float" (string_of_float f) false
 		| VEnumValue ve ->
 		| VEnumValue ve ->
-			let type_s = rev_hash_s ve.epath in
+			let type_s = rev_hash ve.epath in
 			let name = EvalPrinting.s_enum_ctor_name ve in
 			let name = EvalPrinting.s_enum_ctor_name ve in
 			let value_s,is_structured = match ve.eargs with
 			let value_s,is_structured = match ve.eargs with
 				| [||] -> name, false
 				| [||] -> name, false
@@ -69,7 +69,7 @@ let var_to_json name value access =
 		| VArray va -> jv "Array" (array_elems (EvalArray.to_list va)) true (* TODO: false for empty arrays *)
 		| VArray va -> jv "Array" (array_elems (EvalArray.to_list va)) true (* TODO: false for empty arrays *)
 		| VVector vv -> jv "Vector" (array_elems (Array.to_list vv)) true
 		| VVector vv -> jv "Vector" (array_elems (Array.to_list vv)) true
 		| VInstance vi ->
 		| VInstance vi ->
-			let class_name = rev_hash_s vi.iproto.ppath in
+			let class_name = rev_hash vi.iproto.ppath in
 			jv class_name (class_name ^ " " ^ (fields_string (instance_fields vi))) true
 			jv class_name (class_name ^ " " ^ (fields_string (instance_fields vi))) true
 		| VPrototype proto -> jv "Anonymous" (EvalString.get (s_proto_kind proto)) false (* TODO: show statics *)
 		| VPrototype proto -> jv "Anonymous" (EvalString.get (s_proto_kind proto)) false (* TODO: show statics *)
 		| VFunction _ | VFieldClosure _ -> jv "Function" "<fun>" false
 		| VFunction _ | VFieldClosure _ -> jv "Function" "<fun>" false
@@ -172,7 +172,7 @@ let output_inner_vars v access =
 		| VObject o ->
 		| VObject o ->
 			let fields = object_fields o in
 			let fields = object_fields o in
 			List.map (fun (n,v) ->
 			List.map (fun (n,v) ->
-				let n = rev_hash_s n in
+				let n = rev_hash n in
 				let a = access ^ "." ^ n in
 				let a = access ^ "." ^ n in
 				n, v, a
 				n, v, a
 			) fields
 			) fields
@@ -201,7 +201,7 @@ let output_inner_vars v access =
 		| VInstance vi ->
 		| VInstance vi ->
 			let fields = instance_fields vi in
 			let fields = instance_fields vi in
 			List.map (fun (n,v) ->
 			List.map (fun (n,v) ->
-				let n = rev_hash_s n in
+				let n = rev_hash n in
 				let a = access ^ "." ^ n in
 				let a = access ^ "." ^ n in
 				n, v, a
 				n, v, a
 			) fields
 			) fields
@@ -285,7 +285,7 @@ let make_connection socket =
 						| _ ->
 						| _ ->
 							invalid_params ();
 							invalid_params ();
 					in
 					in
-					let hash = hash_s (Path.unique_full_path (Common.find_file (ctx.curapi.get_com()) file)) in
+					let hash = hash (Path.unique_full_path (Common.find_file (ctx.curapi.get_com()) file)) in
 					let h =
 					let h =
 						try
 						try
 							let h = Hashtbl.find ctx.debug.breakpoints hash in
 							let h = Hashtbl.find ctx.debug.breakpoints hash in

+ 0 - 4
src/macro/eval/evalDecode.ml

@@ -53,10 +53,6 @@ let decode_string v = match v with
 	| VString s -> EvalString.get s
 	| VString s -> EvalString.get s
 	| _ -> unexpected_value v "string"
 	| _ -> unexpected_value v "string"
 
 
-let decode_rope v = match v with
-	| VString s -> s.srope
-	| _ -> unexpected_value v "string"
-
 let decode_vstring v = match v with
 let decode_vstring v = match v with
 	| VString s -> s
 	| VString s -> s
 	| _ -> unexpected_value v "string"
 	| _ -> unexpected_value v "string"

+ 1 - 1
src/macro/eval/evalEmitter.ml

@@ -364,7 +364,7 @@ let emit_string_cca exec1 exec2 p env =
 	let s = decode_vstring (exec1 env) in
 	let s = decode_vstring (exec1 env) in
 	let index = decode_int_p (exec2 env) p in
 	let index = decode_int_p (exec2 env) p in
 	if index < 0 || index >= s.slength then vnull
 	if index < 0 || index >= s.slength then vnull
-	else if s.sascii then vint (int_of_char (String.get (Lazy.force s.sstring) index))
+	else if s.sascii then vint (int_of_char (String.get s.sstring index))
 	else vint (EvalString.read_char s (index lsl 1))
 	else vint (EvalString.read_char s (index lsl 1))
 
 
 (* Write *)
 (* Write *)

+ 1 - 7
src/macro/eval/evalEncode.ml

@@ -122,7 +122,7 @@ let encode_obj _ l =
 	}
 	}
 
 
 let encode_obj_s k l =
 let encode_obj_s k l =
-	encode_obj k (List.map (fun (s,v) -> (hash_s s),v) l)
+	encode_obj k (List.map (fun (s,v) -> (hash s),v) l)
 
 
 (* Enum values *)
 (* Enum values *)
 
 
@@ -192,12 +192,6 @@ let encode_array l =
 let encode_string s =
 let encode_string s =
 	vstring (create_ascii s)
 	vstring (create_ascii s)
 
 
-let encode_rope r =
-	vstring (create_ascii_of_rope r)
-
-let encode_rope_ucs2 r length =
-	vstring (create_ucs2_of_rope r length)
-
 let encode_bytes s =
 let encode_bytes s =
 	encode_instance key_haxe_io_Bytes ~kind:(IBytes s)
 	encode_instance key_haxe_io_Bytes ~kind:(IBytes s)
 
 

+ 97 - 104
src/macro/eval/evalHash.ml

@@ -22,119 +22,112 @@ let file_map = Hashtbl.create 0
 
 
 let rev_hash i = Hashtbl.find reverse_map i
 let rev_hash i = Hashtbl.find reverse_map i
 
 
-let rev_hash_s i = Rope.to_string (rev_hash i)
-
 let hash f =
 let hash f =
-	let i = Hashtbl.hash (Rope.to_string f) in
-	Hashtbl.replace reverse_map i f;
-	i
-
-let hash_s f =
 	let i = Hashtbl.hash f in
 	let i = Hashtbl.hash f in
-	Hashtbl.replace reverse_map i (Rope.of_string f);
+	Hashtbl.replace reverse_map i f;
 	i
 	i
 
 
-let path_hash path = hash_s (Globals.s_type_path path)
+let path_hash path = hash (Globals.s_type_path path)
 
 
 let file_hash file =
 let file_hash file =
 	let unique_file = Path.unique_full_path file in
 	let unique_file = Path.unique_full_path file in
 	Hashtbl.replace file_map unique_file file;
 	Hashtbl.replace file_map unique_file file;
-	hash_s unique_file
+	hash unique_file
 
 
 let rev_file_hash i =
 let rev_file_hash i =
-	let s = rev_hash_s i in
+	let s = rev_hash i in
 	try Hashtbl.find file_map s with Not_found -> s
 	try Hashtbl.find file_map s with Not_found -> s
 
 
-let key_length = hash_s "length"
-let key_toString = hash_s "toString"
-let key_OutsideBounds = hash_s "OutsideBounds"
-let key_low = hash_s "low"
-let key_high = hash_s "high"
-let key_next = hash_s "next"
-let key_hasNext = hash_s "hasNext"
-let key___meta__ = hash_s "__meta__"
-let key_get = hash_s "get"
-let key_pos = hash_s "pos"
-let key_len = hash_s "len"
-let key_message = hash_s "message"
-let key_Array = hash_s "Array"
-let key_eval_Vector = hash_s "eval.Vector"
-let key_String = hash_s "String"
-let key_haxe_ds_StringMap = hash_s "haxe.ds.StringMap"
-let key_haxe_ds_IntMap = hash_s "haxe.ds.IntMap"
-let key_haxe_ds_ObjectMap = hash_s "haxe.ds.ObjectMap"
-let key_haxe_macro_Position = hash_s "haxe.macro.Position"
-let key_haxe_macro_LazyType = hash_s "haxe.macro.LazyType"
-let key_haxe_macro_TypeDecl = hash_s "haxe.macro.TypeDecl"
-let key_haxe_Utf8 = hash_s "haxe.Utf8"
-let key_haxe_macro_Ref = hash_s "haxe.macro.Ref"
-let key_haxe_io_Error = hash_s "haxe.io.Error"
-let key_haxe_io_Bytes = hash_s "haxe.io.Bytes"
-let key_Date = hash_s "Date"
-let key_Dynamic = hash_s "Dynamic"
-let key_ValueType = hash_s "ValueType"
-let key_EReg = hash_s "EReg"
-let key_haxe_io_BytesBuffer = hash_s "haxe.io.BytesBuffer"
-let key_StringBuf = hash_s "StringBuf"
-let key_haxe_macro_Error = hash_s "haxe.macro.Error"
-let key_Int = hash_s "Int"
-let key_Float = hash_s "Float"
-let key_Bool = hash_s "Bool"
-let key_Class = hash_s "Class"
-let key_Enum = hash_s "Enum"
-let key_EnumValue = hash_s "EnumValue"
-let key_gid = hash_s "gid"
-let key_uid = hash_s "uid"
-let key_atime = hash_s "atime"
-let key_mtime = hash_s "mtime"
-let key_ctime = hash_s "ctime"
-let key_dev = hash_s "dev"
-let key_ino = hash_s "ino"
-let key_nlink = hash_s "nlink"
-let key_rdev = hash_s "rdev"
-let key_size = hash_s "size"
-let key_mode = hash_s "mode"
-let key_haxe__Int64____Int64 = hash_s "haxe._Int64.___Int64"
-let key_haxe_macro_Unsafe = hash_s "haxe.macro.Unsafe"
-let key_sys_io__Process_NativeProcess = hash_s "sys.io._Process.NativeProcess"
-let key_sys_io_FileOutput = hash_s "sys.io.FileOutput"
-let key_sys_io_FileInput = hash_s "sys.io.FileInput"
-let key_haxe_io_Eof = hash_s "haxe.io.Eof"
-let key_haxe_macro_ExprDef = hash_s "haxe.macro.ExprDef"
-let key_haxe_macro_Binop = hash_s "haxe.macro.Binop"
-let key_haxe_macro_Unop = hash_s "haxe.macro.Unop"
-let key_haxe_macro_Constant = hash_s "haxe.macro.Constant"
-let key_haxe_macro_TypeParam = hash_s "haxe.macro.TypeParam"
-let key_haxe_macro_ComplexType = hash_s "haxe.macro.ComplexType"
-let key_haxe_macro_FieldType = hash_s "haxe.macro.FieldType"
-let key_haxe_macro_Type = hash_s "haxe.macro.Type"
-let key_haxe_macro_FieldKind = hash_s "haxe.macro.FieldKind"
-let key_haxe_macro_MethodKind = hash_s "haxe.macro.MethodKind"
-let key_haxe_macro_VarAccess = hash_s "haxe.macro.VarAccess"
-let key_haxe_macro_Access = hash_s "haxe.macro.Access"
-let key_haxe_macro_ClassKind = hash_s "haxe.macro.ClassKind"
-let key_haxe_macro_TypedExprDef = hash_s "haxe.macro.TypedExprDef"
-let key_haxe_macro_TConstant = hash_s "haxe.macro.TConstant"
-let key_haxe_macro_ModuleType = hash_s "haxe.macro.ModuleType"
-let key_haxe_macro_FieldAccess = hash_s "haxe.macro.FieldAccess"
-let key_haxe_macro_AnonStatus = hash_s "haxe.macro.AnonStatus"
-let key_haxe_macro_ImportMode = hash_s "haxe.macro.ImportMode"
-let key_haxe_macro_QuoteStatus = hash_s "haxe.macro.QuoteStatus"
-let key_haxe_CallStack = hash_s "haxe.CallStack"
-let key___init__ = hash_s "__init__"
-let key_new = hash_s "new"
-let key_questionmark = hash_s "?"
-let key_haxe_StackItem = hash_s "haxe.StackItem"
-let key_sys_net__Socket_NativeSocket = hash_s "sys.net._Socket.NativeSocket"
-let key_ip = hash_s "ip"
-let key_port = hash_s "port"
-let key_sys_net_Socket = hash_s "sys.net.Socket"
-let key_socket = hash_s "socket"
-let key_read = hash_s "read"
-let key_write = hash_s "write"
-let key_others = hash_s "others"
-let key_eval_vm_Thread = hash_s "eval.vm.Thread"
-let key_haxe_zip_Compress = hash_s "haxe.zip.Compress"
-let key_haxe_zip_Uncompress = hash_s "haxe.zip.Uncompress"
-let key_done = hash_s "done"
-let key_eval_toplevel = hash_s "eval-toplevel"
+let key_length = hash "length"
+let key_toString = hash "toString"
+let key_OutsideBounds = hash "OutsideBounds"
+let key_low = hash "low"
+let key_high = hash "high"
+let key_next = hash "next"
+let key_hasNext = hash "hasNext"
+let key___meta__ = hash "__meta__"
+let key_get = hash "get"
+let key_pos = hash "pos"
+let key_len = hash "len"
+let key_message = hash "message"
+let key_Array = hash "Array"
+let key_eval_Vector = hash "eval.Vector"
+let key_String = hash "String"
+let key_haxe_ds_StringMap = hash "haxe.ds.StringMap"
+let key_haxe_ds_IntMap = hash "haxe.ds.IntMap"
+let key_haxe_ds_ObjectMap = hash "haxe.ds.ObjectMap"
+let key_haxe_macro_Position = hash "haxe.macro.Position"
+let key_haxe_macro_LazyType = hash "haxe.macro.LazyType"
+let key_haxe_macro_TypeDecl = hash "haxe.macro.TypeDecl"
+let key_haxe_Utf8 = hash "haxe.Utf8"
+let key_haxe_macro_Ref = hash "haxe.macro.Ref"
+let key_haxe_io_Error = hash "haxe.io.Error"
+let key_haxe_io_Bytes = hash "haxe.io.Bytes"
+let key_Date = hash "Date"
+let key_Dynamic = hash "Dynamic"
+let key_ValueType = hash "ValueType"
+let key_EReg = hash "EReg"
+let key_haxe_io_BytesBuffer = hash "haxe.io.BytesBuffer"
+let key_StringBuf = hash "StringBuf"
+let key_haxe_macro_Error = hash "haxe.macro.Error"
+let key_Int = hash "Int"
+let key_Float = hash "Float"
+let key_Bool = hash "Bool"
+let key_Class = hash "Class"
+let key_Enum = hash "Enum"
+let key_EnumValue = hash "EnumValue"
+let key_gid = hash "gid"
+let key_uid = hash "uid"
+let key_atime = hash "atime"
+let key_mtime = hash "mtime"
+let key_ctime = hash "ctime"
+let key_dev = hash "dev"
+let key_ino = hash "ino"
+let key_nlink = hash "nlink"
+let key_rdev = hash "rdev"
+let key_size = hash "size"
+let key_mode = hash "mode"
+let key_haxe__Int64____Int64 = hash "haxe._Int64.___Int64"
+let key_haxe_macro_Unsafe = hash "haxe.macro.Unsafe"
+let key_sys_io__Process_NativeProcess = hash "sys.io._Process.NativeProcess"
+let key_sys_io_FileOutput = hash "sys.io.FileOutput"
+let key_sys_io_FileInput = hash "sys.io.FileInput"
+let key_haxe_io_Eof = hash "haxe.io.Eof"
+let key_haxe_macro_ExprDef = hash "haxe.macro.ExprDef"
+let key_haxe_macro_Binop = hash "haxe.macro.Binop"
+let key_haxe_macro_Unop = hash "haxe.macro.Unop"
+let key_haxe_macro_Constant = hash "haxe.macro.Constant"
+let key_haxe_macro_TypeParam = hash "haxe.macro.TypeParam"
+let key_haxe_macro_ComplexType = hash "haxe.macro.ComplexType"
+let key_haxe_macro_FieldType = hash "haxe.macro.FieldType"
+let key_haxe_macro_Type = hash "haxe.macro.Type"
+let key_haxe_macro_FieldKind = hash "haxe.macro.FieldKind"
+let key_haxe_macro_MethodKind = hash "haxe.macro.MethodKind"
+let key_haxe_macro_VarAccess = hash "haxe.macro.VarAccess"
+let key_haxe_macro_Access = hash "haxe.macro.Access"
+let key_haxe_macro_ClassKind = hash "haxe.macro.ClassKind"
+let key_haxe_macro_TypedExprDef = hash "haxe.macro.TypedExprDef"
+let key_haxe_macro_TConstant = hash "haxe.macro.TConstant"
+let key_haxe_macro_ModuleType = hash "haxe.macro.ModuleType"
+let key_haxe_macro_FieldAccess = hash "haxe.macro.FieldAccess"
+let key_haxe_macro_AnonStatus = hash "haxe.macro.AnonStatus"
+let key_haxe_macro_ImportMode = hash "haxe.macro.ImportMode"
+let key_haxe_macro_QuoteStatus = hash "haxe.macro.QuoteStatus"
+let key_haxe_CallStack = hash "haxe.CallStack"
+let key___init__ = hash "__init__"
+let key_new = hash "new"
+let key_questionmark = hash "?"
+let key_haxe_StackItem = hash "haxe.StackItem"
+let key_sys_net__Socket_NativeSocket = hash "sys.net._Socket.NativeSocket"
+let key_ip = hash "ip"
+let key_port = hash "port"
+let key_sys_net_Socket = hash "sys.net.Socket"
+let key_socket = hash "socket"
+let key_read = hash "read"
+let key_write = hash "write"
+let key_others = hash "others"
+let key_eval_vm_Thread = hash "eval.vm.Thread"
+let key_haxe_zip_Compress = hash "haxe.zip.Compress"
+let key_haxe_zip_Uncompress = hash "haxe.zip.Uncompress"
+let key_done = hash "done"
+let key_eval_toplevel = hash "eval-toplevel"

+ 10 - 10
src/macro/eval/evalJit.ml

@@ -29,8 +29,8 @@ open EvalMisc
 (* Helper *)
 (* Helper *)
 
 
 let rope_path t = match follow t with
 let rope_path t = match follow t with
-	| TInst({cl_path=path},_) | TEnum({e_path=path},_) | TAbstract({a_path=path},_) -> Rope.of_string (s_type_path path)
-	| TDynamic _ -> Rope.of_string "Dynamic"
+	| TInst({cl_path=path},_) | TEnum({e_path=path},_) | TAbstract({a_path=path},_) -> s_type_path path
+	| TDynamic _ -> "Dynamic"
 	| TFun _ | TAnon _ | TMono _ | TType _ | TLazy _ -> assert false
 	| TFun _ | TAnon _ | TMono _ | TType _ | TLazy _ -> assert false
 
 
 let eone = mk (TConst(TInt (Int32.one))) t_dynamic null_pos
 let eone = mk (TConst(TInt (Int32.one))) t_dynamic null_pos
@@ -55,7 +55,7 @@ let rec op_assign ctx jit e1 e2 = match e1.eexpr with
 		if var.v_capture then emit_capture_write (get_capture_slot jit var.v_id) exec
 		if var.v_capture then emit_capture_write (get_capture_slot jit var.v_id) exec
 		else emit_local_write (get_slot jit var.v_id e1.epos) exec
 		else emit_local_write (get_slot jit var.v_id e1.epos) exec
 	| TField(ef,fa) ->
 	| TField(ef,fa) ->
-		let name = hash_s (field_name fa) in
+		let name = hash (field_name fa) in
 		let exec1 = jit_expr jit false ef in
 		let exec1 = jit_expr jit false ef in
 		let exec2 = jit_expr jit false e2 in
 		let exec2 = jit_expr jit false e2 in
 		begin match fa with
 		begin match fa with
@@ -71,7 +71,7 @@ let rec op_assign ctx jit e1 e2 = match e1.eexpr with
 			| FAnon cf ->
 			| FAnon cf ->
 				begin match follow ef.etype with
 				begin match follow ef.etype with
 					| TAnon an ->
 					| TAnon an ->
-						let l = PMap.foldi (fun k _ acc -> (hash_s k,()) :: acc) an.a_fields [] in
+						let l = PMap.foldi (fun k _ acc -> (hash k,()) :: acc) an.a_fields [] in
 						let proto,_ = ctx.get_object_prototype ctx l in
 						let proto,_ = ctx.get_object_prototype ctx l in
 						let i = get_instance_field_index proto name ef.epos in
 						let i = get_instance_field_index proto name ef.epos in
 						emit_anon_field_write exec1 proto i name exec2
 						emit_anon_field_write exec1 proto i name exec2
@@ -104,7 +104,7 @@ and op_assign_op jit op e1 e2 prefix = match e1.eexpr with
 		if var.v_capture then emit_capture_read_write (get_capture_slot jit var.v_id) exec op prefix
 		if var.v_capture then emit_capture_read_write (get_capture_slot jit var.v_id) exec op prefix
 		else emit_local_read_write (get_slot jit var.v_id e1.epos) exec op prefix
 		else emit_local_read_write (get_slot jit var.v_id e1.epos) exec op prefix
 	| TField(ef,fa) ->
 	| TField(ef,fa) ->
-		let name = hash_s (field_name fa) in
+		let name = hash (field_name fa) in
 		let exec1 = jit_expr jit false ef in
 		let exec1 = jit_expr jit false ef in
 		let exec2 = jit_expr jit false e2 in
 		let exec2 = jit_expr jit false e2 in
 		begin match fa with
 		begin match fa with
@@ -179,7 +179,7 @@ and jit_expr jit return e =
 	| TConst ct ->
 	| TConst ct ->
 		emit_const (eval_const ct)
 		emit_const (eval_const ct)
 	| TObjectDecl fl ->
 	| TObjectDecl fl ->
-		let fl = List.map (fun ((s,_,_),e) -> hash_s s,jit_expr jit false e) fl in
+		let fl = List.map (fun ((s,_,_),e) -> hash s,jit_expr jit false e) fl in
 		let proto,_ = ctx.get_object_prototype ctx fl in
 		let proto,_ = ctx.get_object_prototype ctx fl in
 		let fl = List.map (fun (s,exec) -> get_instance_field_index proto s e.epos,exec) fl in
 		let fl = List.map (fun (s,exec) -> get_instance_field_index proto s e.epos,exec) fl in
 		let fa = Array.of_list fl in
 		let fa = Array.of_list fl in
@@ -294,13 +294,13 @@ and jit_expr jit return e =
 		begin match e1.eexpr with
 		begin match e1.eexpr with
 		| TField({eexpr = TConst TSuper;epos=pv},FInstance(c,_,cf)) ->
 		| TField({eexpr = TConst TSuper;epos=pv},FInstance(c,_,cf)) ->
 			let proto = get_instance_prototype ctx (path_hash c.cl_path) e1.epos in
 			let proto = get_instance_prototype ctx (path_hash c.cl_path) e1.epos in
-			let name = hash_s cf.cf_name in
+			let name = hash cf.cf_name in
 			let i = get_proto_field_index proto name in
 			let i = get_proto_field_index proto name in
 			let slot = get_slot jit 0 pv in
 			let slot = get_slot jit 0 pv in
 			let execs = List.map (jit_expr jit false) el in
 			let execs = List.map (jit_expr jit false) el in
 			emit_super_field_call slot proto i execs e.epos
 			emit_super_field_call slot proto i execs e.epos
 		| TField(ef,fa) ->
 		| TField(ef,fa) ->
-			let name = hash_s (field_name fa) in
+			let name = hash (field_name fa) in
 			let execs = List.map (jit_expr jit false) el in
 			let execs = List.map (jit_expr jit false) el in
 			(* let is_overridden c s_name =
 			(* let is_overridden c s_name =
 				try
 				try
@@ -412,7 +412,7 @@ and jit_expr jit return e =
 		if var.v_capture then emit_capture_read (get_capture_slot jit var.v_id)
 		if var.v_capture then emit_capture_read (get_capture_slot jit var.v_id)
 		else emit_local_read (get_slot jit var.v_id e.epos)
 		else emit_local_read (get_slot jit var.v_id e.epos)
 	| TField(e1,fa) ->
 	| TField(e1,fa) ->
-		let name = hash_s (field_name fa) in
+		let name = hash (field_name fa) in
 		begin match fa with
 		begin match fa with
 			| FInstance({cl_path=([],"Array")},_,{cf_name="length"}) -> emit_array_length_read (jit_expr jit false e1)
 			| FInstance({cl_path=([],"Array")},_,{cf_name="length"}) -> emit_array_length_read (jit_expr jit false e1)
 			| FInstance({cl_path=(["eval"],"Vector")},_,{cf_name="length"}) -> emit_vector_length_read (jit_expr jit false e1)
 			| FInstance({cl_path=(["eval"],"Vector")},_,{cf_name="length"}) -> emit_vector_length_read (jit_expr jit false e1)
@@ -428,7 +428,7 @@ and jit_expr jit return e =
 			| FAnon _ ->
 			| FAnon _ ->
 				begin match follow e1.etype with
 				begin match follow e1.etype with
 					| TAnon an ->
 					| TAnon an ->
-						let l = PMap.foldi (fun k _ acc -> (hash_s k,()) :: acc) an.a_fields [] in
+						let l = PMap.foldi (fun k _ acc -> (hash k,()) :: acc) an.a_fields [] in
 						let proto,_ = ctx.get_object_prototype ctx l in
 						let proto,_ = ctx.get_object_prototype ctx l in
 						let i = get_instance_field_index proto name e1.epos in
 						let i = get_instance_field_index proto name e1.epos in
 						emit_anon_field_read (jit_expr jit false e1) proto i name e1.epos
 						emit_anon_field_read (jit_expr jit false e1) proto i name e1.epos

+ 13 - 13
src/macro/eval/evalMain.ml

@@ -151,7 +151,7 @@ let call_path ctx path f vl api =
 		in
 		in
 		catch_exceptions ctx ~final:(fun () -> ctx.curapi <- old) (fun () ->
 		catch_exceptions ctx ~final:(fun () -> ctx.curapi <- old) (fun () ->
 			let vtype = get_static_prototype_as_value ctx (path_hash path) api.pos in
 			let vtype = get_static_prototype_as_value ctx (path_hash path) api.pos in
-			let vfield = field vtype (hash_s f) in
+			let vfield = field vtype (hash f) in
 			call_value_on vtype vfield vl
 			call_value_on vtype vfield vl
 		) api.pos
 		) api.pos
 	end
 	end
@@ -170,9 +170,9 @@ let value_signature v =
 			Hashtbl.add scache s (Hashtbl.length scache);
 			Hashtbl.add scache s (Hashtbl.length scache);
 			addc 'y';
 			addc 'y';
 			let s = EvalStdLib.StdStringTools.url_encode s in
 			let s = EvalStdLib.StdStringTools.url_encode s in
-			add (string_of_int (Rope.length s));
+			add (string_of_int (String.length s));
 			addc ':';
 			addc ':';
-			add (Rope.to_string s)
+			add s
 	in
 	in
 	let cache = ValueHashtbl.create 0 in
 	let cache = ValueHashtbl.create 0 in
 	let cache_length = ref 0 in
 	let cache_length = ref 0 in
@@ -207,7 +207,7 @@ let value_signature v =
 		| VEnumValue ve ->
 		| VEnumValue ve ->
 			cache v (fun () ->
 			cache v (fun () ->
 				addc 'j';
 				addc 'j';
-				adds (rev_hash_s ve.epath);
+				adds (rev_hash ve.epath);
 				addc ':';
 				addc ':';
 				add (string_of_int ve.eindex);
 				add (string_of_int ve.eindex);
 				addc ':';
 				addc ':';
@@ -230,7 +230,7 @@ let value_signature v =
 			cache v (fun() ->
 			cache v (fun() ->
 				addc 'b';
 				addc 'b';
 				StringHashtbl.iter (fun s value ->
 				StringHashtbl.iter (fun s value ->
-					adds (Lazy.force s.sstring);
+					adds s.sstring;
 					loop value
 					loop value
 				) map;
 				) map;
 				addc 'h'
 				addc 'h'
@@ -271,13 +271,13 @@ let value_signature v =
 		| VInstance i ->
 		| VInstance i ->
 			cache v (fun () ->
 			cache v (fun () ->
 				addc 'c';
 				addc 'c';
-				adds (rev_hash_s i.iproto.ppath);
+				adds (rev_hash i.iproto.ppath);
 				let fields = instance_fields i in
 				let fields = instance_fields i in
 				loop_fields fields;
 				loop_fields fields;
 				addc 'g';
 				addc 'g';
 			)
 			)
 		| VString s ->
 		| VString s ->
-			adds (Lazy.force s.sstring)
+			adds s.sstring
 		| VArray {avalues = a} | VVector a ->
 		| VArray {avalues = a} | VVector a ->
 			cache v (fun () ->
 			cache v (fun () ->
 				addc 'a';
 				addc 'a';
@@ -301,10 +301,10 @@ let value_signature v =
 			)
 			)
 		| VPrototype {pkind = PClass _; ppath = path} ->
 		| VPrototype {pkind = PClass _; ppath = path} ->
 			addc 'A';
 			addc 'A';
-			adds (rev_hash_s path)
+			adds (rev_hash path)
 		| VPrototype {pkind = PEnum _; ppath = path} ->
 		| VPrototype {pkind = PEnum _; ppath = path} ->
 			addc 'B';
 			addc 'B';
-			adds (rev_hash_s path)
+			adds (rev_hash path)
 		| VPrototype _ ->
 		| VPrototype _ ->
 			assert false
 			assert false
 		| VFunction _ | VFieldClosure _ ->
 		| VFunction _ | VFieldClosure _ ->
@@ -318,7 +318,7 @@ let value_signature v =
 			loop (!f())
 			loop (!f())
 	and loop_fields fields =
 	and loop_fields fields =
 		List.iter (fun (name,v) ->
 		List.iter (fun (name,v) ->
-			adds (rev_hash_s name);
+			adds (rev_hash name);
 			loop v;
 			loop v;
 		) fields
 		) fields
 	in
 	in
@@ -400,7 +400,7 @@ let rec value_to_expr v p =
 	| VString s -> (EConst (String (EvalString.get s)),p)
 	| VString s -> (EConst (String (EvalString.get s)),p)
 	| VArray va -> (EArrayDecl (List.map (fun v -> value_to_expr v p) (EvalArray.to_list va)),p)
 	| VArray va -> (EArrayDecl (List.map (fun v -> value_to_expr v p) (EvalArray.to_list va)),p)
 	| VObject o -> (EObjectDecl (List.map (fun (k,v) ->
 	| VObject o -> (EObjectDecl (List.map (fun (k,v) ->
-			let n = rev_hash_s k in
+			let n = rev_hash k in
 			((n,p,(if Lexer.is_valid_identifier n then NoQuotes else DoubleQuotes)),(value_to_expr v p))
 			((n,p,(if Lexer.is_valid_identifier n then NoQuotes else DoubleQuotes)),(value_to_expr v p))
 		) (object_fields o)),p)
 		) (object_fields o)),p)
 	| VEnumValue e ->
 	| VEnumValue e ->
@@ -425,7 +425,7 @@ let rec value_to_expr v p =
 
 
 let encode_obj = encode_obj_s
 let encode_obj = encode_obj_s
 
 
-let field v f = field v (EvalHash.hash_s f)
+let field v f = field v (EvalHash.hash f)
 
 
 let value_string = value_string
 let value_string = value_string
 
 
@@ -448,7 +448,7 @@ let handle_decoding_error f v t =
 				incr line;
 				incr line;
 				f (Printf.sprintf "\n%s%s: " (tabs ^ "\t") cf.cf_name);
 				f (Printf.sprintf "\n%s%s: " (tabs ^ "\t") cf.cf_name);
 				try
 				try
-					let vf = field_raise v (EvalHash.hash_s cf.cf_name) in
+					let vf = field_raise v (EvalHash.hash cf.cf_name) in
 					begin match vf with
 					begin match vf with
 					| VNull when not (is_explicit_null cf.cf_type) -> error "expected value" vf
 					| VNull when not (is_explicit_null cf.cf_type) -> error "expected value" vf
 					| _ -> loop (tabs ^ "\t") cf.cf_type vf
 					| _ -> loop (tabs ^ "\t") cf.cf_type vf

+ 3 - 3
src/macro/eval/evalMisc.ml

@@ -105,8 +105,8 @@ let rec compare a b =
 	| VFalse,VTrue -> CInf
 	| VFalse,VTrue -> CInf
 	| VTrue,VFalse -> CSup
 	| VTrue,VFalse -> CSup
 	| VString s1,VString s2 ->
 	| VString s1,VString s2 ->
-		let s1' = Lazy.force s1.sstring in
-		let s2' = Lazy.force s2.sstring in
+		let s1' = s1.sstring in
+		let s2' = s2.sstring in
 		let s1,s2 = match s1.sascii,s2.sascii with
 		let s1,s2 = match s1.sascii,s2.sascii with
 		| true,true
 		| true,true
 		| false,false -> s1',s2'
 		| false,false -> s1',s2'
@@ -155,7 +155,7 @@ and equals_structurally a b =
 	| VFloat a,VFloat b -> a = b
 	| VFloat a,VFloat b -> a = b
 	| VFloat a,VInt32 b -> a = (Int32.to_float b)
 	| VFloat a,VInt32 b -> a = (Int32.to_float b)
 	| VInt32 a,VFloat b -> (Int32.to_float a) = b
 	| VInt32 a,VFloat b -> (Int32.to_float a) = b
-	| VString s1,VString s2 -> Lazy.force s1.sstring = Lazy.force s2.sstring (* STODO *)
+	| VString s1,VString s2 -> s1.sstring = s2.sstring (* STODO *)
 	| VArray a,VArray b -> a == b || arrays_equal equals_structurally a.avalues b.avalues
 	| VArray a,VArray b -> a == b || arrays_equal equals_structurally a.avalues b.avalues
 	| VVector a,VVector b -> a == b || arrays_equal equals_structurally a b
 	| VVector a,VVector b -> a == b || arrays_equal equals_structurally a b
 	| VObject a,VObject b -> a == b || arrays_equal equals_structurally a.ofields b.ofields
 	| VObject a,VObject b -> a == b || arrays_equal equals_structurally a.ofields b.ofields

+ 1 - 2
src/macro/eval/evalPrinting.ml

@@ -23,7 +23,6 @@ open EvalValue
 open EvalContext
 open EvalContext
 open EvalField
 open EvalField
 open EvalHash
 open EvalHash
-open Rope
 open EvalString
 open EvalString
 
 
 let rempty = create_ascii ""
 let rempty = create_ascii ""
@@ -48,7 +47,7 @@ let s_date d =
 	let t = localtime d in
 	let t = localtime d in
 	create_ascii (Printf.sprintf "%.4d-%.2d-%.2d %.2d:%.2d:%.2d" (t.tm_year + 1900) (t.tm_mon + 1) t.tm_mday t.tm_hour t.tm_min t.tm_sec)
 	create_ascii (Printf.sprintf "%.4d-%.2d-%.2d %.2d:%.2d:%.2d" (t.tm_year + 1900) (t.tm_mon + 1) t.tm_mday t.tm_hour t.tm_min t.tm_sec)
 
 
-let s_hash key = create_ascii_of_rope (EvalHash.rev_hash key)
+let s_hash key = create_ascii (EvalHash.rev_hash key)
 
 
 let rec s_object depth o =
 let rec s_object depth o =
 	let fields = object_fields o in
 	let fields = object_fields o in

+ 11 - 11
src/macro/eval/evalPrototype.ml

@@ -189,15 +189,15 @@ let create_static_prototype ctx mt =
 		let delays = DynArray.create() in
 		let delays = DynArray.create() in
 		if not c.cl_extern then List.iter (fun cf -> match cf.cf_kind,cf.cf_expr with
 		if not c.cl_extern then List.iter (fun cf -> match cf.cf_kind,cf.cf_expr with
 			| Method _,Some {eexpr = TFunction tf; epos = pos} ->
 			| Method _,Some {eexpr = TFunction tf; epos = pos} ->
-				let name = hash_s cf.cf_name in
+				let name = hash cf.cf_name in
 				PrototypeBuilder.add_proto_field pctx name (lazy (vstatic_function (jit_tfunction ctx key name tf true pos)));
 				PrototypeBuilder.add_proto_field pctx name (lazy (vstatic_function (jit_tfunction ctx key name tf true pos)));
 			| Var _,Some e ->
 			| Var _,Some e ->
-				let name = hash_s cf.cf_name in
+				let name = hash cf.cf_name in
 				PrototypeBuilder.add_proto_field pctx name (lazy vnull);
 				PrototypeBuilder.add_proto_field pctx name (lazy vnull);
 				let i = DynArray.length pctx.PrototypeBuilder.fields - 1 in
 				let i = DynArray.length pctx.PrototypeBuilder.fields - 1 in
 				DynArray.add delays (fun proto -> proto.pfields.(i) <- (match eval_expr ctx key name e with Some e -> e | None -> vnull))
 				DynArray.add delays (fun proto -> proto.pfields.(i) <- (match eval_expr ctx key name e with Some e -> e | None -> vnull))
 			| _,None when is_physical_field cf ->
 			| _,None when is_physical_field cf ->
-				PrototypeBuilder.add_proto_field pctx (hash_s cf.cf_name) (lazy vnull);
+				PrototypeBuilder.add_proto_field pctx (hash cf.cf_name) (lazy vnull);
 			|  _ ->
 			|  _ ->
 				()
 				()
 		) fields;
 		) fields;
@@ -214,7 +214,7 @@ let create_static_prototype ctx mt =
 				vstatic_function f
 				vstatic_function f
 			| _ -> encode_enum_value key ef.ef_index [||] (Some ef.ef_pos)
 			| _ -> encode_enum_value key ef.ef_index [||] (Some ef.ef_pos)
 		in
 		in
-		PMap.iter (fun name ef -> PrototypeBuilder.add_proto_field pctx (hash_s name ) (lazy (enum_field_value ef))) en.e_constrs;
+		PMap.iter (fun name ef -> PrototypeBuilder.add_proto_field pctx (hash name ) (lazy (enum_field_value ef))) en.e_constrs;
 		PrototypeBuilder.finalize pctx,[];
 		PrototypeBuilder.finalize pctx,[];
 	| TAbstractDecl a ->
 	| TAbstractDecl a ->
 		let pctx = PrototypeBuilder.create ctx key None (PClass []) meta in
 		let pctx = PrototypeBuilder.create ctx key None (PClass []) meta in
@@ -224,9 +224,9 @@ let create_static_prototype ctx mt =
 	in
 	in
 	let rec loop v name path = match path with
 	let rec loop v name path = match path with
 		| [] ->
 		| [] ->
-			set_field v (hash_s name) (vprototype (fst (fst o)))
+			set_field v (hash name) (vprototype (fst (fst o)))
 		| s :: sl ->
 		| s :: sl ->
-			let key = hash_s s in
+			let key = hash s in
 			let v2 = EvalField.field v key in
 			let v2 = EvalField.field v key in
 			let v2 = match v2 with
 			let v2 = match v2 with
 				| VNull -> encode_obj None []
 				| VNull -> encode_obj None []
@@ -251,12 +251,12 @@ let create_instance_prototype ctx c =
 		()
 		()
 	else List.iter (fun cf -> match cf.cf_kind,cf.cf_expr with
 	else List.iter (fun cf -> match cf.cf_kind,cf.cf_expr with
 		| Method meth,Some {eexpr = TFunction tf; epos = pos} ->
 		| Method meth,Some {eexpr = TFunction tf; epos = pos} ->
-			let name = hash_s cf.cf_name in
+			let name = hash cf.cf_name in
 			let v = lazy (vfunction (jit_tfunction ctx key name tf false pos)) in
 			let v = lazy (vfunction (jit_tfunction ctx key name tf false pos)) in
 			if meth = MethDynamic then PrototypeBuilder.add_instance_field pctx name v;
 			if meth = MethDynamic then PrototypeBuilder.add_instance_field pctx name v;
 			PrototypeBuilder.add_proto_field pctx name v
 			PrototypeBuilder.add_proto_field pctx name v
 		| Var _,_ when is_physical_field cf ->
 		| Var _,_ when is_physical_field cf ->
-			let name = hash_s cf.cf_name in
+			let name = hash cf.cf_name in
 			PrototypeBuilder.add_instance_field pctx name (lazy vnull);
 			PrototypeBuilder.add_instance_field pctx name (lazy vnull);
 		|  _ ->
 		|  _ ->
 			()
 			()
@@ -265,12 +265,12 @@ let create_instance_prototype ctx c =
 
 
 let get_object_prototype ctx l =
 let get_object_prototype ctx l =
 	let l = List.sort (fun (i1,_) (i2,_) -> if i1 = i2 then 0 else if i1 < i2 then -1 else 1) l in
 	let l = List.sort (fun (i1,_) (i2,_) -> if i1 = i2 then 0 else if i1 < i2 then -1 else 1) l in
-	let sfields = String.concat "," (List.map (fun (i,_) -> rev_hash_s i) l) in
+	let sfields = String.concat "," (List.map (fun (i,_) -> rev_hash i) l) in
 	let key = Hashtbl.hash sfields in
 	let key = Hashtbl.hash sfields in
 	try
 	try
 		IntMap.find key ctx.instance_prototypes,l
 		IntMap.find key ctx.instance_prototypes,l
 	with Not_found ->
 	with Not_found ->
-		let name = hash_s (Printf.sprintf "eval.object.Object[%s]" sfields) in
+		let name = hash (Printf.sprintf "eval.object.Object[%s]" sfields) in
 		let pctx = PrototypeBuilder.create ctx name None PObject None in
 		let pctx = PrototypeBuilder.create ctx name None PObject None in
 		List.iter (fun (name,_) -> PrototypeBuilder.add_instance_field pctx name (lazy vnull)) l;
 		List.iter (fun (name,_) -> PrototypeBuilder.add_instance_field pctx name (lazy vnull)) l;
 		let proto = fst (PrototypeBuilder.finalize pctx) in
 		let proto = fst (PrototypeBuilder.finalize pctx) in
@@ -293,7 +293,7 @@ let add_types ctx types ready =
 			ready mt;
 			ready mt;
 			ctx.type_cache <- IntMap.add key mt ctx.type_cache;
 			ctx.type_cache <- IntMap.add key mt ctx.type_cache;
 			if ctx.debug.support_debugger then begin
 			if ctx.debug.support_debugger then begin
-				let file_key = hash_s inf.mt_module.m_extra.m_file in
+				let file_key = hash inf.mt_module.m_extra.m_file in
 				if not (Hashtbl.mem ctx.debug.breakpoints file_key) then begin
 				if not (Hashtbl.mem ctx.debug.breakpoints file_key) then begin
 					Hashtbl.add ctx.debug.breakpoints file_key (Hashtbl.create 0)
 					Hashtbl.add ctx.debug.breakpoints file_key (Hashtbl.create 0)
 				end
 				end

+ 104 - 106
src/macro/eval/evalStdLib.ml

@@ -353,7 +353,7 @@ module StdBytes = struct
 			let s = maybe_extend_ascii s in
 			let s = maybe_extend_ascii s in
 			encode_bytes (Bytes.of_string s)
 			encode_bytes (Bytes.of_string s)
 		end else begin
 		end else begin
-			let s' = Lazy.force s.sstring in
+			let s' = s.sstring in
 			let s = if s.sascii then s' else utf16_to_utf8 s' in
 			let s = if s.sascii then s' else utf16_to_utf8 s' in
 			encode_bytes (Bytes.of_string s)
 			encode_bytes (Bytes.of_string s)
 		end
 		end
@@ -485,9 +485,9 @@ module StdBytesBuffer = struct
 		let this = this vthis in
 		let this = this vthis in
 		let src = decode_vstring src in
 		let src = decode_vstring src in
 		let s = if src.sascii || StdBytes.encode_native encoding then
 		let s = if src.sascii || StdBytes.encode_native encoding then
-			Lazy.force src.sstring
+			src.sstring
 		else
 		else
-			utf16_to_utf8 (Lazy.force src.sstring)
+			utf16_to_utf8 src.sstring
 		in
 		in
 		Buffer.add_string this s;
 		Buffer.add_string this s;
 		vnull
 		vnull
@@ -555,7 +555,7 @@ module StdCallStack = struct
 				let local_function = encode_enum_value key_haxe_StackItem 4 [|vint i|] None in
 				let local_function = encode_enum_value key_haxe_StackItem 4 [|vint i|] None in
 				DynArray.add l (file_pos local_function);
 				DynArray.add l (file_pos local_function);
 			| EKMethod(st,sf) ->
 			| EKMethod(st,sf) ->
-				let local_function = encode_enum_value key_haxe_StackItem 3 [|create_unknown (rev_hash_s st); create_unknown (rev_hash_s sf)|] None in
+				let local_function = encode_enum_value key_haxe_StackItem 3 [|create_unknown (rev_hash st); create_unknown (rev_hash sf)|] None in
 				DynArray.add l (file_pos local_function);
 				DynArray.add l (file_pos local_function);
 			| EKDelayed ->
 			| EKDelayed ->
 				()
 				()
@@ -796,7 +796,7 @@ module StdEReg = struct
 		let this = this vthis in
 		let this = this vthis in
 		let s = decode_string s in
 		let s = decode_string s in
 		let l = String.length s in
 		let l = String.length s in
-		let buf = Rope.Buffer.create 0 in
+		let buf = Buffer.create 0 in
 		let rec loop pos =
 		let rec loop pos =
 			if pos >= l then
 			if pos >= l then
 				()
 				()
@@ -804,31 +804,31 @@ module StdEReg = struct
 				let a = exec ~rex:this.r ~pos s in
 				let a = exec ~rex:this.r ~pos s in
 				this.r_groups <- [|a|];
 				this.r_groups <- [|a|];
 				let (first,last) = get_substring_ofs a 0 in
 				let (first,last) = get_substring_ofs a 0 in
-				Rope.Buffer.add_substring buf s pos (first - pos);
-				Rope.Buffer.add_string buf (decode_string (call_value_on vthis f [vthis]));
+				Buffer.add_substring buf s pos (first - pos);
+				Buffer.add_string buf (decode_string (call_value_on vthis f [vthis]));
 				if last = first then begin
 				if last = first then begin
 					if last >= l then
 					if last >= l then
 						()
 						()
 					else begin
 					else begin
 						if this.r_global then begin
 						if this.r_global then begin
-							Rope.Buffer.add_substring buf s first 1;
+							Buffer.add_substring buf s first 1;
 							loop (first + 1)
 							loop (first + 1)
 						end else
 						end else
-							Rope.Buffer.add_substring buf s first (l - first)
+							Buffer.add_substring buf s first (l - first)
 					end
 					end
 				end else if this.r_global then
 				end else if this.r_global then
 					loop last
 					loop last
 				else
 				else
-					Rope.Buffer.add_substring buf s last (l - last)
+					Buffer.add_substring buf s last (l - last)
 			with Not_found ->
 			with Not_found ->
-				Rope.Buffer.add_substring buf s pos (l - pos)
+				Buffer.add_substring buf s pos (l - pos)
 			end
 			end
 		in
 		in
 		this.r_string <- s;
 		this.r_string <- s;
 		loop 0;
 		loop 0;
 		this.r_string <- "";
 		this.r_string <- "";
 		this.r_groups <- [||];
 		this.r_groups <- [||];
-		create_unknown (Rope.to_string (Rope.Buffer.contents buf))
+		create_unknown (Buffer.contents buf)
 	)
 	)
 
 
 	let match' = vifun1 (fun vthis s ->
 	let match' = vifun1 (fun vthis s ->
@@ -1221,30 +1221,30 @@ end
 
 
 module StdGc = struct
 module StdGc = struct
 	open Gc
 	open Gc
-	let key_minor_heap_size = hash_s "minor_heap_size"
-	let key_major_heap_increment = hash_s "major_heap_increment"
-	let key_space_overhead = hash_s "space_overhead"
-	let key_verbose = hash_s "verbose"
-	let key_max_overhead = hash_s "max_overhead"
-	let key_stack_limit = hash_s "stack_limit"
-	let key_allocation_policy = hash_s "allocation_policy"
-	let key_minor_words = hash_s "minor_words"
-	let key_minor_words = hash_s "minor_words"
-	let key_promoted_words = hash_s "promoted_words"
-	let key_major_words = hash_s "major_words"
-	let key_minor_collections = hash_s "minor_collections"
-	let key_major_collections = hash_s "major_collections"
-	let key_heap_words = hash_s "heap_words"
-	let key_heap_chunks = hash_s "heap_chunks"
-	let key_live_words = hash_s "live_words"
-	let key_live_blocks = hash_s "live_blocks"
-	let key_free_words = hash_s "free_words"
-	let key_free_blocks = hash_s "free_blocks"
-	let key_largest_free = hash_s "largest_free"
-	let key_fragments = hash_s "fragments"
-	let key_compactions = hash_s "compactions"
-	let key_top_heap_words = hash_s "top_heap_words"
-	let key_stack_size = hash_s "stack_size"
+	let key_minor_heap_size = hash "minor_heap_size"
+	let key_major_heap_increment = hash "major_heap_increment"
+	let key_space_overhead = hash "space_overhead"
+	let key_verbose = hash "verbose"
+	let key_max_overhead = hash "max_overhead"
+	let key_stack_limit = hash "stack_limit"
+	let key_allocation_policy = hash "allocation_policy"
+	let key_minor_words = hash "minor_words"
+	let key_minor_words = hash "minor_words"
+	let key_promoted_words = hash "promoted_words"
+	let key_major_words = hash "major_words"
+	let key_minor_collections = hash "minor_collections"
+	let key_major_collections = hash "major_collections"
+	let key_heap_words = hash "heap_words"
+	let key_heap_chunks = hash "heap_chunks"
+	let key_live_words = hash "live_words"
+	let key_live_blocks = hash "live_blocks"
+	let key_free_words = hash "free_words"
+	let key_free_blocks = hash "free_blocks"
+	let key_largest_free = hash "largest_free"
+	let key_fragments = hash "fragments"
+	let key_compactions = hash "compactions"
+	let key_top_heap_words = hash "top_heap_words"
+	let key_stack_size = hash "stack_size"
 
 
 	let encode_stats stats =
 	let encode_stats stats =
 		encode_obj None [
 		encode_obj None [
@@ -1376,9 +1376,9 @@ module StdHost = struct
 end
 end
 
 
 module StdLog = struct
 module StdLog = struct
-	let key_fileName = hash_s "fileName"
-	let key_lineNumber = hash_s "lineNumber"
-	let key_customParams = hash_s "customParams"
+	let key_fileName = hash "fileName"
+	let key_lineNumber = hash "lineNumber"
+	let key_customParams = hash "customParams"
 
 
 	let trace = vfun2 (fun v infos ->
 	let trace = vfun2 (fun v infos ->
 		let s = value_string v in
 		let s = value_string v in
@@ -1433,7 +1433,6 @@ module StdMap (Hashtbl : Hashtbl.S) = struct
 			enc_inst copied
 			enc_inst copied
 		);
 		);
 		"toString",vifun0 (fun vthis ->
 		"toString",vifun0 (fun vthis ->
-			let open Rope in
 			let l = Hashtbl.fold (fun key vvalue acc -> (join rempty [str key; create_ascii " => "; s_value 0 vvalue]) :: acc) (this vthis) [] in
 			let l = Hashtbl.fold (fun key vvalue acc -> (join rempty [str key; create_ascii " => "; s_value 0 vvalue]) :: acc) (this vthis) [] in
 			let s = join rcomma l in
 			let s = join rcomma l in
 			let s = join rempty [rbropen;s;rbrclose] in
 			let s = join rempty [rbropen;s;rbrclose] in
@@ -1608,7 +1607,7 @@ module StdReflect = struct
 	)
 	)
 
 
 	let deleteField = vfun2 (fun o name ->
 	let deleteField = vfun2 (fun o name ->
-		let name = hash_s (get (decode_vstring name)) in
+		let name = hash (get (decode_vstring name)) in
 		match vresolve o with
 		match vresolve o with
 		| VObject o ->
 		| VObject o ->
 			let found = ref false in
 			let found = ref false in
@@ -1629,7 +1628,7 @@ module StdReflect = struct
 	)
 	)
 
 
 	let field' = vfun2 (fun o name ->
 	let field' = vfun2 (fun o name ->
-		if o = vnull then vnull else dynamic_field o (hash_s (get (decode_vstring name)))
+		if o = vnull then vnull else dynamic_field o (hash (get (decode_vstring name)))
 	)
 	)
 
 
 	let fields = vfun1 (fun o ->
 	let fields = vfun1 (fun o ->
@@ -1642,19 +1641,19 @@ module StdReflect = struct
 			| VString _ | VArray _ | VVector _ -> [key_length]
 			| VString _ | VArray _ | VVector _ -> [key_length]
 			| _ -> unexpected_value o "object"
 			| _ -> unexpected_value o "object"
 		in
 		in
-		encode_array (List.map (fun i -> encode_rope (rev_hash i)) fields)
+		encode_array (List.map (fun i -> encode_string (rev_hash i)) fields)
 	)
 	)
 
 
 	let getProperty = vfun2 (fun o name ->
 	let getProperty = vfun2 (fun o name ->
 		let name = decode_vstring name in
 		let name = decode_vstring name in
-		let name_get = hash_s (get (concat r_get_ name)) in
+		let name_get = hash (get (concat r_get_ name)) in
 		let vget = field o name_get in
 		let vget = field o name_get in
 		if vget <> VNull then call_value_on o vget []
 		if vget <> VNull then call_value_on o vget []
-		else dynamic_field o (hash_s (get name))
+		else dynamic_field o (hash (get name))
 	)
 	)
 
 
 	let hasField = vfun2 (fun o field ->
 	let hasField = vfun2 (fun o field ->
-		let name = hash_s (get (decode_vstring field)) in
+		let name = hash (get (decode_vstring field)) in
 		let b = match vresolve o with
 		let b = match vresolve o with
 			| VObject o -> IntMap.mem name o.oproto.pinstance_names
 			| VObject o -> IntMap.mem name o.oproto.pinstance_names
 			| VInstance vi -> IntMap.mem name vi.iproto.pinstance_names || IntMap.mem name vi.iproto.pnames
 			| VInstance vi -> IntMap.mem name vi.iproto.pinstance_names || IntMap.mem name vi.iproto.pnames
@@ -1685,16 +1684,16 @@ module StdReflect = struct
 	)
 	)
 
 
 	let setField = vfun3 (fun o name v ->
 	let setField = vfun3 (fun o name v ->
-		set_field o (hash_s (get (decode_vstring name))) v; vnull
+		set_field o (hash (get (decode_vstring name))) v; vnull
 	)
 	)
 
 
 	let setProperty = vfun3 (fun o name v ->
 	let setProperty = vfun3 (fun o name v ->
 		let name = decode_vstring name in
 		let name = decode_vstring name in
-		let name_set = hash_s (get (concat r_set_ name)) in
+		let name_set = hash (get (concat r_set_ name)) in
 		let vset = field o name_set in
 		let vset = field o name_set in
 		if vset <> VNull then call_value_on o vset [v]
 		if vset <> VNull then call_value_on o vset [v]
 		else begin
 		else begin
-			set_field o (hash_s (get name)) v;
+			set_field o (hash (get name)) v;
 			vnull
 			vnull
 		end
 		end
 	)
 	)
@@ -1922,10 +1921,10 @@ module StdString = struct
 	let charAt = vifun1 (fun vthis index ->
 	let charAt = vifun1 (fun vthis index ->
 		let this = this vthis in
 		let this = this vthis in
 		let i = decode_int index in
 		let i = decode_int index in
-		if i < 0 || i >= this.slength then encode_rope Rope.empty
+		if i < 0 || i >= this.slength then encode_string ""
 		else begin
 		else begin
-			let s = Lazy.force this.sstring in
-			if this.sascii then encode_rope (Rope.of_char (String.get s i))
+			let s = this.sstring in
+			if this.sascii then encode_string (String.make 1 (String.get s i))
 			else begin
 			else begin
 				let b = Bytes.create 2 in
 				let b = Bytes.create 2 in
 				EvalBytes.write_ui16 b 0 (read_char this (i lsl 1));
 				EvalBytes.write_ui16 b 0 (read_char this (i lsl 1));
@@ -1941,7 +1940,7 @@ module StdString = struct
 		let this = this vthis in
 		let this = this vthis in
 		let i = decode_int index in
 		let i = decode_int index in
 		if i < 0 || i >= this.slength then vnull
 		if i < 0 || i >= this.slength then vnull
-		else if this.sascii then vint (int_of_char (String.get (Lazy.force this.sstring) i))
+		else if this.sascii then vint (int_of_char (String.get this.sstring i))
 		else vint (read_char this (i lsl 1))
 		else vint (read_char this (i lsl 1))
 	)
 	)
 
 
@@ -1961,10 +1960,10 @@ module StdString = struct
 		let this = this vthis in
 		let this = this vthis in
 		let i = default_int startIndex 0 in
 		let i = default_int startIndex 0 in
 		try
 		try
-			if Rope.length str.srope = 0 then
+			if str.slength = 0 then
 				vint (max 0 (min i this.slength))
 				vint (max 0 (min i this.slength))
 			else if this.sascii then
 			else if this.sascii then
-				vint (Rope.search_forward_string (Lazy.force str.sstring) this.srope i)
+				vint ((fst (find_substring this str false i)))
 			else begin
 			else begin
 				vint ((fst (find_substring this str false (i lsl 1))) lsr 1)
 				vint ((fst (find_substring this str false (i lsl 1))) lsr 1)
 			end
 			end
@@ -1976,15 +1975,15 @@ module StdString = struct
 		let str = this str in
 		let str = this str in
 		let this = this vthis in
 		let this = this vthis in
 		try
 		try
-			if Rope.length str.srope = 0 then begin
+			if str.slength = 0 then begin
 				let i = default_int startIndex this.slength in
 				let i = default_int startIndex this.slength in
 				vint (max 0 (min i this.slength))
 				vint (max 0 (min i this.slength))
 			end else begin
 			end else begin
 				let i = default_int startIndex (this.slength - 1) in
 				let i = default_int startIndex (this.slength - 1) in
 				if i >= this.slength || i < 0 then raise Not_found;
 				if i >= this.slength || i < 0 then raise Not_found;
-				let s = Lazy.force this.sstring in
+				let s = this.sstring in
 				if this.sascii then
 				if this.sascii then
-					vint (Str.search_backward (Str.regexp_string (Lazy.force str.sstring)) s i)
+					vint (Str.search_backward (Str.regexp_string str.sstring) s i)
 				else
 				else
 					vint ((fst (find_substring this str true (i lsl 1))) lsr 1)
 					vint ((fst (find_substring this str true (i lsl 1))) lsr 1)
 			end
 			end
@@ -1995,15 +1994,15 @@ module StdString = struct
 	let split = vifun1 (fun vthis delimiter ->
 	let split = vifun1 (fun vthis delimiter ->
 		let this' = this vthis in
 		let this' = this vthis in
 		let ascii = this'.sascii in
 		let ascii = this'.sascii in
-		let this,s = this'.srope,Lazy.force this'.sstring in
+		let s = this'.sstring in
 		let delimiter' = (decode_vstring delimiter) in
 		let delimiter' = (decode_vstring delimiter) in
-		let delimiter = Lazy.force delimiter'.sstring in
+		let delimiter = delimiter'.sstring in
 		let l_delimiter = String.length delimiter in
 		let l_delimiter = String.length delimiter in
-		let l_this = Rope.length this in
+		let l_this = String.length s in
 		let encode_range pos length =
 		let encode_range pos length =
-			let s = Rope.sub this pos length in
-			if ascii then encode_rope s
-			else encode_rope_ucs2 s (length lsr 1)
+			let s = String.sub s pos length in
+			if ascii then encode_string s
+			else vstring (create_ucs2 s (length lsr 1))
 		in
 		in
 		if l_delimiter = 0 then begin
 		if l_delimiter = 0 then begin
 			if ascii then
 			if ascii then
@@ -2020,7 +2019,7 @@ module StdString = struct
 				encode_array (DynArray.to_list acc)
 				encode_array (DynArray.to_list acc)
 			end
 			end
 		end else if l_delimiter > l_this then
 		end else if l_delimiter > l_this then
-			encode_array [encode_range 0 (Rope.length this)]
+			encode_array [encode_range 0 (String.length s)]
 		else begin
 		else begin
 			let acc = DynArray.create () in
 			let acc = DynArray.create () in
 			let f = find_substring this' delimiter' false in
 			let f = find_substring this' delimiter' false in
@@ -2039,38 +2038,39 @@ module StdString = struct
 
 
 	let substr = vifun2 (fun vthis pos len ->
 	let substr = vifun2 (fun vthis pos len ->
 		let this = this vthis in
 		let this = this vthis in
+		let s = this.sstring in
+		let l_this = String.length s in
 		let pos = decode_int pos in
 		let pos = decode_int pos in
-		let r = this.srope in
 		if pos >= this.slength then
 		if pos >= this.slength then
-			encode_rope Rope.empty
+			encode_string ""
 		else begin
 		else begin
 			let pos = if pos < 0 then begin
 			let pos = if pos < 0 then begin
 				let pos = this.slength + pos in
 				let pos = this.slength + pos in
 				if pos < 0 then 0 else pos
 				if pos < 0 then 0 else pos
 			end else pos in
 			end else pos in
 			if this.sascii then begin
 			if this.sascii then begin
-				let len = default_int len (Rope.length r - pos) in
-				let len = if len < 0 then Rope.length r + len - pos else len in
+				let len = default_int len (l_this - pos) in
+				let len = if len < 0 then l_this + len - pos else len in
 				let s =
 				let s =
-					if len < 0 then Rope.empty
-					else if len + pos > Rope.length r then Rope.sub r pos (Rope.length r - pos)
-					else Rope.sub r pos len
+					if len < 0 then ""
+					else if len + pos > l_this then String.sub s pos (l_this - pos)
+					else String.sub s pos len
 				in
 				in
-				encode_rope s
+				encode_string s
 			end else begin
 			end else begin
 				let pos = pos lsl 1 in
 				let pos = pos lsl 1 in
 				let len = match len with
 				let len = match len with
-					| VNull -> (Rope.length r - pos)
+					| VNull -> (l_this - pos)
 					| VInt32 i -> Int32.to_int i lsl 1
 					| VInt32 i -> Int32.to_int i lsl 1
 					| _ -> unexpected_value len "int"
 					| _ -> unexpected_value len "int"
 				in
 				in
-				let len = if len < 0 then Rope.length r + len - pos else len in
+				let len = if len < 0 then l_this + len - pos else len in
 				let s =
 				let s =
-					if len < 0 then Rope.empty
-					else if len + pos > Rope.length r then Rope.sub r pos (Rope.length r - pos)
-					else Rope.sub r pos len
+					if len < 0 then ""
+					else if len + pos > l_this then String.sub s pos (l_this - pos)
+					else String.sub s pos len
 				in
 				in
-				vstring (create_ucs2_of_rope s (len lsr 1))
+				vstring (create_ucs2 s (len lsr 1))
 			end
 			end
 		end
 		end
 	)
 	)
@@ -2085,16 +2085,16 @@ module StdString = struct
 		let first,last = if first > last then last,first else first,last in
 		let first,last = if first > last then last,first else first,last in
 		let last = if last > l then l else last in
 		let last = if last > l then l else last in
 		if first > l then
 		if first > l then
-			encode_rope Rope.empty
+			encode_string ""
 		else begin
 		else begin
 			if this.sascii then
 			if this.sascii then
-				encode_rope (Rope.sub this.srope first (last - first))
+				encode_string (String.sub this.sstring first (last - first))
 			else begin
 			else begin
 				let first = first lsl 1 in
 				let first = first lsl 1 in
 				let last = last lsl 1 in
 				let last = last lsl 1 in
 				let length = last - first in
 				let length = last - first in
-				let r = Rope.sub this.srope first length in
-				vstring (create_ucs2_of_rope r length)
+				let r = String.sub this.sstring first length in
+				vstring (create_ucs2 r length)
 			end
 			end
 		end
 		end
 	)
 	)
@@ -2102,7 +2102,7 @@ module StdString = struct
 	let toLowerCase = vifun0 (fun vthis ->
 	let toLowerCase = vifun0 (fun vthis ->
 		let this = this vthis in
 		let this = this vthis in
 		if this.sascii then
 		if this.sascii then
-			encode_rope (Rope.lowercase this.srope)
+			encode_string (String.lowercase this.sstring)
 		else
 		else
 			vstring (case_map this false)
 			vstring (case_map this false)
 	)
 	)
@@ -2112,7 +2112,7 @@ module StdString = struct
 	let toUpperCase = vifun0 (fun vthis ->
 	let toUpperCase = vifun0 (fun vthis ->
 		let this = this vthis in
 		let this = this vthis in
 		if this.sascii then
 		if this.sascii then
-			encode_rope (Rope.uppercase this.srope)
+			encode_string (String.uppercase this.sstring)
 		else
 		else
 			vstring (case_map this true)
 			vstring (case_map this true)
 	)
 	)
@@ -2125,8 +2125,6 @@ module StdString = struct
 end
 end
 
 
 module StdStringBuf = struct
 module StdStringBuf = struct
-	module Buffer = Rope.Buffer
-
 	let this vthis = match vthis with
 	let this vthis = match vthis with
 		| VInstance {ikind = IBuffer sb} -> sb
 		| VInstance {ikind = IBuffer sb} -> sb
 		| v -> unexpected_value v "string"
 		| v -> unexpected_value v "string"
@@ -2177,13 +2175,13 @@ module StdStringBuf = struct
 		let i = decode_int pos in
 		let i = decode_int pos in
 		let i = if s.sascii then i else i lsl 1 in
 		let i = if s.sascii then i else i lsl 1 in
 		let len = match len with
 		let len = match len with
-			| VNull -> Rope.length s.srope - i
+			| VNull -> String.length s.sstring - i
 			| VInt32 i -> Int32.to_int i lsl (if s.sascii then 0 else 1)
 			| VInt32 i -> Int32.to_int i lsl (if s.sascii then 0 else 1)
 			| _ -> unexpected_value len "int"
 			| _ -> unexpected_value len "int"
 		in
 		in
-		let s' = Rope.sub s.srope i len in
-		let s' = if s.sascii then create_ascii_of_rope s'
-		else create_ucs2_of_rope s' (len lsr 1) in
+		let s' = String.sub s.sstring i len in
+		let s' = if s.sascii then create_ascii s'
+		else create_ucs2 s' (len lsr 1) in
 		AwareBuffer.add_string this s';
 		AwareBuffer.add_string this s';
 		vnull
 		vnull
 	)
 	)
@@ -2202,15 +2200,15 @@ end
 
 
 module StdStringTools = struct
 module StdStringTools = struct
 	let url_encode s =
 	let url_encode s =
-		let b = Rope.Buffer.create 0 in
-		Common.url_encode s (Rope.Buffer.add_char b);
-		Rope.Buffer.contents b
+		let b = Buffer.create 0 in
+		Common.url_encode s (Buffer.add_char b);
+		Buffer.contents b
 
 
 	let fastCodeAt = StdString.charCodeAt
 	let fastCodeAt = StdString.charCodeAt
 
 
 	let urlEncode = vfun1 (fun s ->
 	let urlEncode = vfun1 (fun s ->
 		let s = decode_string s in
 		let s = decode_string s in
-		encode_rope (url_encode s)
+		encode_string (url_encode s)
 	)
 	)
 
 
 	let urlDecode = vfun1 (fun s ->
 	let urlDecode = vfun1 (fun s ->
@@ -2434,7 +2432,7 @@ module StdType = struct
 			begin try
 			begin try
 				let l = ExtList.List.filter_map (fun s ->
 				let l = ExtList.List.filter_map (fun s ->
 					try
 					try
-						begin match proto_field_direct proto (hash_s s) with
+						begin match proto_field_direct proto (hash s) with
 							| VEnumValue _ as v -> Some v
 							| VEnumValue _ as v -> Some v
 							| _ -> None
 							| _ -> None
 						end
 						end
@@ -2461,7 +2459,7 @@ module StdType = struct
 	)
 	)
 
 
 	let createEnum = vfun3 (fun e constr params ->
 	let createEnum = vfun3 (fun e constr params ->
-		let constr = hash_s (get (decode_vstring constr)) in
+		let constr = hash (get (decode_vstring constr)) in
 		create_enum e constr params
 		create_enum e constr params
 	)
 	)
 
 
@@ -2470,7 +2468,7 @@ module StdType = struct
 		match e with
 		match e with
 		| VPrototype {pkind = PEnum names} ->
 		| VPrototype {pkind = PEnum names} ->
 			begin try
 			begin try
-				create_enum e (hash_s (List.nth names index)) params
+				create_enum e (hash (List.nth names index)) params
 			with Not_found ->
 			with Not_found ->
 				vnull
 				vnull
 			end
 			end
@@ -2540,14 +2538,14 @@ module StdType = struct
 	let getClassFields = vfun1 (fun v ->
 	let getClassFields = vfun1 (fun v ->
 		match v with
 		match v with
 		| VPrototype {pkind = PClass _;pnames = names} ->
 		| VPrototype {pkind = PClass _;pnames = names} ->
-			encode_array (IntMap.fold (fun name _ acc -> (encode_rope (rev_hash name)) :: acc) names []);
+			encode_array (IntMap.fold (fun name _ acc -> (encode_string (rev_hash name)) :: acc) names []);
 		| _ ->
 		| _ ->
 			vnull
 			vnull
 	)
 	)
 
 
 	let getClassName = vfun1 (fun v ->
 	let getClassName = vfun1 (fun v ->
 		match v with
 		match v with
-		| VPrototype {pkind = PClass _; ppath = path} -> encode_rope (rev_hash path)
+		| VPrototype {pkind = PClass _; ppath = path} -> encode_string (rev_hash path)
 		| _ -> vnull
 		| _ -> vnull
 	)
 	)
 
 
@@ -2571,7 +2569,7 @@ module StdType = struct
 
 
 	let getEnumName = vfun1 (fun v ->
 	let getEnumName = vfun1 (fun v ->
 		match v with
 		match v with
-		| VPrototype {pkind = PEnum _; ppath = path} -> encode_rope (rev_hash path)
+		| VPrototype {pkind = PEnum _; ppath = path} -> encode_string (rev_hash path)
 		| _ -> vnull
 		| _ -> vnull
 	)
 	)
 
 
@@ -2588,7 +2586,7 @@ module StdType = struct
 					IntMap.fold (fun name _ acc -> IntMap.add name 0 acc) proto.pnames acc
 					IntMap.fold (fun name _ acc -> IntMap.add name 0 acc) proto.pnames acc
 				in
 				in
 				let proto = get_instance_prototype (get_ctx()) proto.ppath null_pos in
 				let proto = get_instance_prototype (get_ctx()) proto.ppath null_pos in
-				encode_array (List.map (fun i -> encode_rope (rev_hash i)) (ptmap_keys (loop IntMap.empty proto)))
+				encode_array (List.map (fun i -> encode_string (rev_hash i)) (ptmap_keys (loop IntMap.empty proto)))
 			with Not_found ->
 			with Not_found ->
 				vnull
 				vnull
 			end
 			end
@@ -2604,13 +2602,13 @@ module StdType = struct
 
 
 	let resolveClass = vfun1 (fun v ->
 	let resolveClass = vfun1 (fun v ->
 		let name = get (decode_vstring v) in
 		let name = get (decode_vstring v) in
-		try (get_static_prototype_raise (get_ctx()) (hash_s name)).pvalue with Not_found -> vnull
+		try (get_static_prototype_raise (get_ctx()) (hash name)).pvalue with Not_found -> vnull
 	)
 	)
 
 
 	let resolveEnum = vfun1 (fun v ->
 	let resolveEnum = vfun1 (fun v ->
 		let name = get (decode_vstring v) in
 		let name = get (decode_vstring v) in
 		try
 		try
-			let proto = get_static_prototype_raise (get_ctx()) (hash_s name) in
+			let proto = get_static_prototype_raise (get_ctx()) (hash name) in
 			begin match proto.pkind with
 			begin match proto.pkind with
 				| PEnum _ -> proto.pvalue
 				| PEnum _ -> proto.pvalue
 				| _ -> vnull
 				| _ -> vnull
@@ -2743,7 +2741,7 @@ module StdUtf8 = struct
 end
 end
 
 
 let init_fields builtins path static_fields instance_fields =
 let init_fields builtins path static_fields instance_fields =
-	let map (name,v) = (hash_s name,v) in
+	let map (name,v) = (hash name,v) in
 	let path = path_hash path in
 	let path = path_hash path in
 	builtins.static_builtins <- IntMap.add path (List.map map static_fields) builtins.static_builtins;
 	builtins.static_builtins <- IntMap.add path (List.map map static_fields) builtins.static_builtins;
 	builtins.instance_builtins <- IntMap.add path (List.map map instance_fields) builtins.instance_builtins
 	builtins.instance_builtins <- IntMap.add path (List.map map instance_fields) builtins.instance_builtins
@@ -2857,7 +2855,7 @@ let init_empty_constructors builtins =
 	Hashtbl.add h key_eval_Vector (fun () -> encode_vector_instance (Array.make 0 vnull));
 	Hashtbl.add h key_eval_Vector (fun () -> encode_vector_instance (Array.make 0 vnull));
 	Hashtbl.add h key_Date (fun () -> encode_instance key_Date ~kind:(IDate 0.));
 	Hashtbl.add h key_Date (fun () -> encode_instance key_Date ~kind:(IDate 0.));
 	Hashtbl.add h key_EReg (fun () -> encode_instance key_EReg ~kind:(IRegex {r = Pcre.regexp ""; r_global = false; r_string = ""; r_groups = [||]}));
 	Hashtbl.add h key_EReg (fun () -> encode_instance key_EReg ~kind:(IRegex {r = Pcre.regexp ""; r_global = false; r_string = ""; r_groups = [||]}));
-	Hashtbl.add h key_String (fun () -> encode_rope Rope.empty);
+	Hashtbl.add h key_String (fun () -> encode_string "");
 	Hashtbl.add h key_haxe_Utf8 (fun () -> encode_instance key_haxe_Utf8 ~kind:(IUtf8 (UTF8.Buf.create 0)));
 	Hashtbl.add h key_haxe_Utf8 (fun () -> encode_instance key_haxe_Utf8 ~kind:(IUtf8 (UTF8.Buf.create 0)));
 	Hashtbl.add h key_haxe_ds_StringMap (fun () -> encode_instance key_haxe_ds_StringMap ~kind:(IStringMap (StringHashtbl.create 0)));
 	Hashtbl.add h key_haxe_ds_StringMap (fun () -> encode_instance key_haxe_ds_StringMap ~kind:(IStringMap (StringHashtbl.create 0)));
 	Hashtbl.add h key_haxe_ds_IntMap (fun () -> encode_instance key_haxe_ds_IntMap ~kind:(IIntMap (IntHashtbl.create 0)));
 	Hashtbl.add h key_haxe_ds_IntMap (fun () -> encode_instance key_haxe_ds_IntMap ~kind:(IIntMap (IntHashtbl.create 0)));

+ 22 - 38
src/macro/eval/evalString.ml

@@ -22,29 +22,13 @@ open EvalValue
 open EvalBytes
 open EvalBytes
 
 
 let create_ascii s = {
 let create_ascii s = {
-	srope = Rope.of_string s;
-	sstring = lazy s;
+	sstring = s;
 	slength = String.length s;
 	slength = String.length s;
 	sascii = true;
 	sascii = true;
 }
 }
 
 
-let create_ascii_of_rope r = {
-	srope = r;
-	sstring = lazy (Rope.to_string r);
-	slength = Rope.length r;
-	sascii = true;
-}
-
 let create_ucs2 s length = {
 let create_ucs2 s length = {
-	srope = Rope.of_string s;
-	sstring = lazy s;
-	slength = length;
-	sascii = false;
-}
-
-let create_ucs2_of_rope r length = {
-	srope = r;
-	sstring = lazy (Rope.to_string r);
+	sstring = s;
 	slength = length;
 	slength = length;
 	sascii = false;
 	sascii = false;
 }
 }
@@ -55,40 +39,40 @@ module AwareBuffer = struct
 	type t = vstring_buffer
 	type t = vstring_buffer
 
 
 	let create () = {
 	let create () = {
-		bbuffer = Rope.Buffer.create 0;
+		bbuffer = Buffer.create 0;
 		blength = 0;
 		blength = 0;
 		bascii = true;
 		bascii = true;
 	}
 	}
 
 
 	let promote_to_ucs this =
 	let promote_to_ucs this =
-		let current = Rope.to_string (Rope.Buffer.contents this.bbuffer) in
+		let current = Buffer.contents this.bbuffer in
 		let current = extend_ascii current in
 		let current = extend_ascii current in
-		Rope.Buffer.clear this.bbuffer;
+		Buffer.clear this.bbuffer;
 		this.bascii <- false;
 		this.bascii <- false;
-		Rope.Buffer.add_string this.bbuffer current
+		Buffer.add_string this.bbuffer current
 
 
 	let add_string this s =
 	let add_string this s =
 		begin match s.sascii,this.bascii with
 		begin match s.sascii,this.bascii with
 		| true,true
 		| true,true
 		| false,false ->
 		| false,false ->
-			Rope.Buffer.add_rope this.bbuffer s.srope
+			Buffer.add_string this.bbuffer s.sstring
 		| true,false ->
 		| true,false ->
-			Rope.Buffer.add_string this.bbuffer (extend_ascii (Lazy.force s.sstring))
+			Buffer.add_string this.bbuffer (extend_ascii s.sstring)
 		| false,true ->
 		| false,true ->
 			promote_to_ucs this;
 			promote_to_ucs this;
-			Rope.Buffer.add_rope this.bbuffer s.srope
+			Buffer.add_string this.bbuffer s.sstring
 		end;
 		end;
 		this.blength <- this.blength + s.slength
 		this.blength <- this.blength + s.slength
 
 
 	let contents this =
 	let contents this =
 		if this.bascii then
 		if this.bascii then
-			create_ascii_of_rope (Rope.Buffer.contents this.bbuffer)
+			create_ascii (Buffer.contents this.bbuffer)
 		else
 		else
-			create_ucs2_of_rope (Rope.Buffer.contents this.bbuffer) this.blength
+			create_ucs2 (Buffer.contents this.bbuffer) this.blength
 end
 end
 
 
 let read_char s =
 let read_char s =
-	read_ui16 (Bytes.unsafe_of_string (Lazy.force s.sstring))
+	read_ui16 (Bytes.unsafe_of_string s.sstring)
 
 
 let utf8_to_utf16 s =
 let utf8_to_utf16 s =
 	let only_ascii = ref true in
 	let only_ascii = ref true in
@@ -170,7 +154,7 @@ let utf16_to_utf8 s =
 	Buffer.contents buf
 	Buffer.contents buf
 
 
 let maybe_extend_ascii s =
 let maybe_extend_ascii s =
-	let s' = Lazy.force s.sstring in
+	let s' = s.sstring in
 	if s.sascii then begin
 	if s.sascii then begin
 		extend_ascii s'
 		extend_ascii s'
 	end else
 	end else
@@ -179,13 +163,13 @@ let maybe_extend_ascii s =
 let concat s1 s2 =
 let concat s1 s2 =
 	match s1.sascii,s2.sascii with
 	match s1.sascii,s2.sascii with
 	| true,true ->
 	| true,true ->
-		create_ascii_of_rope (Rope.concat2 s1.srope s2.srope)
+		create_ascii (s1.sstring ^ s2.sstring)
 	| false,false ->
 	| false,false ->
-		create_ucs2_of_rope (Rope.concat2 s1.srope s2.srope) (s1.slength + s2.slength)
+		create_ucs2 (s1.sstring ^ s2.sstring) (s1.slength + s2.slength)
 	| true,false ->
 	| true,false ->
-		create_ucs2 ((extend_ascii (Lazy.force s1.sstring)) ^ (Lazy.force s2.sstring)) (s1.slength + s2.slength)
+		create_ucs2 ((extend_ascii s1.sstring) ^ s2.sstring) (s1.slength + s2.slength)
 	| false,true ->
 	| false,true ->
-		create_ucs2 ((Lazy.force s1.sstring) ^ (extend_ascii (Lazy.force s2.sstring))) (s1.slength + s2.slength)
+		create_ucs2 (s1.sstring ^ (extend_ascii s2.sstring)) (s1.slength + s2.slength)
 
 
 let join sep sl =
 let join sep sl =
 	let buf = AwareBuffer.create () in
 	let buf = AwareBuffer.create () in
@@ -215,7 +199,7 @@ let create_unknown s =
 exception InvalidUnicodeChar
 exception InvalidUnicodeChar
 
 
 let case_map this upper =
 let case_map this upper =
-	let dest = Bytes.of_string (Lazy.force this.sstring) in
+	let dest = Bytes.of_string this.sstring in
 	let a,m = if upper then EvalBytes.Unicase._UPPER,1022 else EvalBytes.Unicase._LOWER,1021 in
 	let a,m = if upper then EvalBytes.Unicase._UPPER,1022 else EvalBytes.Unicase._LOWER,1021 in
 	let f i c =
 	let f i c =
 		let up = c lsr 6 in
 		let up = c lsr 6 in
@@ -257,9 +241,9 @@ let from_char_code i =
 		raise InvalidUnicodeChar
 		raise InvalidUnicodeChar
 
 
 let find_substring this sub reverse =
 let find_substring this sub reverse =
-	let l_this = Rope.length this.srope in
-	let s_this = Lazy.force this.sstring in
-	let s_sub = if not this.sascii then maybe_extend_ascii sub else Lazy.force sub.sstring in
+	let s_this = this.sstring in
+	let l_this = String.length s_this in
+	let s_sub = if not this.sascii then maybe_extend_ascii sub else sub.sstring in
 	let l_sub = String.length s_sub in
 	let l_sub = String.length s_sub in
 	let rec scan i k =
 	let rec scan i k =
 		if k = l_sub then true
 		if k = l_sub then true
@@ -288,6 +272,6 @@ let find_substring this sub reverse =
 	end
 	end
 
 
 let get s =
 let get s =
-	let s' = Lazy.force s.sstring in
+	let s' = s.sstring in
 	if s.sascii then s'
 	if s.sascii then s'
 	else utf16_to_utf8 s'
 	else utf16_to_utf8 s'

+ 8 - 10
src/macro/eval/evalValue.ml

@@ -27,11 +27,9 @@ type cmp =
 	| CUndef
 	| CUndef
 
 
 type vstring = {
 type vstring = {
-	(* The rope representation of the string. This is what we mainly use. *)
-	srope   : Rope.t;
 	(* The bytes representation of the string. This is only evaluated if we
 	(* The bytes representation of the string. This is only evaluated if we
 	   need it for something like random access. *)
 	   need it for something like random access. *)
-	sstring : string Lazy.t;
+	sstring : string;
 	(* The length of the string. *)
 	(* The length of the string. *)
 	slength : int;
 	slength : int;
 	(* If true, the string is one-byte-per-character ASCII. Otherwise, it is
 	(* If true, the string is one-byte-per-character ASCII. Otherwise, it is
@@ -40,7 +38,7 @@ type vstring = {
 }
 }
 
 
 type vstring_buffer = {
 type vstring_buffer = {
-	        bbuffer : Rope.Buffer.t;
+	        bbuffer : Buffer.t;
 	mutable blength : int;
 	mutable blength : int;
 	mutable bascii  : bool;
 	mutable bascii  : bool;
 }
 }
@@ -55,18 +53,18 @@ let extend_ascii s =
 
 
 let vstring_equal s1 s2 =
 let vstring_equal s1 s2 =
 	if s1.sascii = s2.sascii then
 	if s1.sascii = s2.sascii then
-		s1.srope == s2.srope || Lazy.force s1.sstring = Lazy.force s2.sstring
+		s1.sstring = s2.sstring
 	else if not s2.sascii then
 	else if not s2.sascii then
-		extend_ascii (Lazy.force s1.sstring) = Lazy.force s2.sstring
+		extend_ascii s1.sstring = s2.sstring
 	else
 	else
-		Lazy.force s1.sstring = extend_ascii (Lazy.force s2.sstring)
+		s1.sstring = extend_ascii s2.sstring
 
 
 module StringHashtbl = Hashtbl.Make(struct
 module StringHashtbl = Hashtbl.Make(struct
 	type t = vstring
 	type t = vstring
 	let equal = vstring_equal
 	let equal = vstring_equal
 	let hash s =
 	let hash s =
-		let s = if s.sascii then extend_ascii (Lazy.force s.sstring)
-		else Lazy.force s.sstring in
+		let s = if s.sascii then extend_ascii s.sstring
+		else s.sstring in
 		Hashtbl.hash s
 		Hashtbl.hash s
 end)
 end)
 
 
@@ -117,7 +115,7 @@ and vobject = {
 }
 }
 
 
 and vprototype = {
 and vprototype = {
-	(* The path of the prototype. Using rev_hash_s on this gives the original dot path. *)
+	(* The path of the prototype. Using rev_hash on this gives the original dot path. *)
 	ppath : int;
 	ppath : int;
 	(* The fields of the prototype itself (static fields). *)
 	(* The fields of the prototype itself (static fields). *)
 	pfields : value array;
 	pfields : value array;