Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1557)

Unified Diff: src/extensions/i18n/collator.h

Issue 18487004: Import the v8-i18n extension into v8 (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/extensions/i18n/collator.h
diff --git a/src/hydrogen-infer-representation.h b/src/extensions/i18n/collator.h
similarity index 59%
copy from src/hydrogen-infer-representation.h
copy to src/extensions/i18n/collator.h
index 7c605696c4b956152bdd9dfc74c83e80569e3714..a3991b9ed244afad996cf5d547c17e077010ac60 100644
--- a/src/hydrogen-infer-representation.h
+++ b/src/extensions/i18n/collator.h
@@ -24,34 +24,45 @@
// 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_COLLATOR_H_
+#define V8_EXTENSIONS_I18N_COLLATOR_H_
-#include "hydrogen.h"
+#include "unicode/uversion.h"
+#include "v8.h"
-namespace v8 {
-namespace internal {
+namespace U_ICU_NAMESPACE {
+class Collator;
+class UnicodeString;
+}
+namespace v8_i18n {
-class HInferRepresentationPhase : public HPhase {
+class Collator {
public:
- explicit HInferRepresentationPhase(HGraph* graph)
- : HPhase("H_Infer representations", graph),
- worklist_(8, zone()),
- in_worklist_(graph->GetMaximumValueID(), zone()) { }
+ static void JSCreateCollator(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 collator object from corresponding JavaScript object.
+ static icu::Collator* UnpackCollator(v8::Handle<v8::Object> obj);
- DISALLOW_COPY_AND_ASSIGN(HInferRepresentationPhase);
-};
+ // Release memory we allocated for the Collator once the JS object that
+ // holds the pointer gets garbage collected.
+ static void DeleteCollator(v8::Isolate* isolate,
+ v8::Persistent<v8::Object>* object,
+ void* param);
+
+ // Compare two strings and returns -1, 0 and 1 depending on
+ // whether string1 is smaller than, equal to or larger than string2.
+ static void JSInternalCompare(
+ const v8::FunctionCallbackInfo<v8::Value>& args);
+ private:
+ Collator() {}
+};
-} } // namespace v8::internal
+} // namespace v8_i18n
-#endif // V8_HYDROGEN_INFER_REPRESENTATION_H_
+#endif // V8_EXTENSIONS_I18N_COLLATOR_H_

Powered by Google App Engine
This is Rietveld 408576698