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

Unified Diff: src/runtime.cc

Issue 149068: - Inlined the code for make simple cons strings.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 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
« src/heap.cc ('K') | « src/heap.cc ('k') | src/top.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.cc
===================================================================
--- src/runtime.cc (revision 2281)
+++ src/runtime.cc (working copy)
@@ -50,9 +50,8 @@
namespace internal {
-#define RUNTIME_ASSERT(value) do { \
- if (!(value)) return IllegalOperation(); \
-} while (false)
+#define RUNTIME_ASSERT(value) \
+ if (!(value)) return Top::ThrowIllegalOperation();
// Cast the given object to a value of the specified type and store
// it in a variable with the given name. If the object is not of the
@@ -97,11 +96,6 @@
static StaticResource<StringInputBuffer> runtime_string_input_buffer;
-static Object* IllegalOperation() {
- return Top::Throw(Heap::illegal_access_symbol());
-}
-
-
static Object* DeepCopyBoilerplate(JSObject* boilerplate) {
StackLimitCheck check;
if (check.HasOverflowed()) return Top::StackOverflow();
@@ -3704,20 +3698,8 @@
static Object* Runtime_StringAdd(Arguments args) {
NoHandleAllocation ha;
ASSERT(args.length() == 2);
-
CONVERT_CHECKED(String, str1, args[0]);
CONVERT_CHECKED(String, str2, args[1]);
- int len1 = str1->length();
- int len2 = str2->length();
- if (len1 == 0) return str2;
- if (len2 == 0) return str1;
- int length_sum = len1 + len2;
- // Make sure that an out of memory exception is thrown if the length
- // of the new cons string is too large to fit in a Smi.
- if (length_sum > Smi::kMaxValue || length_sum < 0) {
- Top::context()->mark_out_of_memory();
- return Failure::OutOfMemoryException();
- }
return Heap::AllocateConsString(str1, str2);
}
@@ -4584,7 +4566,7 @@
ASSERT(args.length() == 2);
if (!args[0]->IsContext() || !args[1]->IsString()) {
- return MakePair(IllegalOperation(), NULL);
+ return MakePair(Top::ThrowIllegalOperation(), NULL);
}
Handle<Context> context = args.at<Context>(0);
Handle<String> name = args.at<String>(1);
« src/heap.cc ('K') | « src/heap.cc ('k') | src/top.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698