Index: src/asmjs/asm-typer.cc |
diff --git a/src/asmjs/asm-typer.cc b/src/asmjs/asm-typer.cc |
index 36ab1408b0984ad2e0d056ccb3f8876d4d711ea2..40683849dcd22bb129d4a91fab6cf571806f655a 100644 |
--- a/src/asmjs/asm-typer.cc |
+++ b/src/asmjs/asm-typer.cc |
@@ -20,25 +20,31 @@ |
#include "src/globals.h" |
#include "src/messages.h" |
#include "src/utils.h" |
- |
-#define FAIL_LOCATION(location, msg) \ |
- do { \ |
- Handle<String> message(isolate_->factory()->InternalizeOneByteString( \ |
- STATIC_CHAR_VECTOR(msg))); \ |
- error_message_ = MessageHandler::MakeMessageObject( \ |
- isolate_, MessageTemplate::kAsmJsInvalid, (location), message, \ |
- Handle<JSArray>::null()); \ |
- error_message_->set_error_level(v8::Isolate::kMessageWarning); \ |
- message_location_ = *(location); \ |
- return AsmType::None(); \ |
+#include "src/vector.h" |
+ |
+#define FAIL_LOCATION_RAW(location, msg) \ |
+ do { \ |
+ Handle<String> message( \ |
+ isolate_->factory()->InternalizeOneByteString(msg)); \ |
+ error_message_ = MessageHandler::MakeMessageObject( \ |
+ isolate_, MessageTemplate::kAsmJsInvalid, (location), message, \ |
+ Handle<JSArray>::null()); \ |
+ error_message_->set_error_level(v8::Isolate::kMessageWarning); \ |
+ message_location_ = *(location); \ |
+ return AsmType::None(); \ |
} while (false) |
-#define FAIL(node, msg) \ |
+#define FAIL_RAW(node, msg) \ |
do { \ |
MessageLocation location(script_, node->position(), node->position()); \ |
- FAIL_LOCATION(&location, msg); \ |
+ FAIL_LOCATION_RAW(&location, msg); \ |
} while (false) |
+#define FAIL_LOCATION(location, msg) \ |
+ FAIL_LOCATION_RAW(location, STATIC_CHAR_VECTOR(msg)) |
+ |
+#define FAIL(node, msg) FAIL_RAW(node, STATIC_CHAR_VECTOR(msg)) |
+ |
#define RECURSE(call) \ |
do { \ |
if (GetCurrentStackPosition() < stack_limit_) { \ |
@@ -530,6 +536,10 @@ AsmTyper::StandardMember AsmTyper::VariableAsStandardMember(Variable* var) { |
return member; |
} |
+AsmType* AsmTyper::FailWithMessage(const char* text) { |
+ FAIL_RAW(root_, OneByteVector(text)); |
+} |
+ |
bool AsmTyper::Validate() { |
return ValidateBeforeFunctionsPhase() && |
!AsmType::None()->IsExactly(ValidateModuleFunctions(root_)) && |